General Topics
Markets
Technical Topics
Brokerage Firms
Community Lounge
Site Support

Discussion in 'Technical Analysis' started by themickey, May 8, 2010.

1. ### themickey

Would anyone know how to plot the formula for the spread between two companies using RSI within Amibroker?
Below is how I've attempted the formula.
I'm attempting to compare the RSI of the Dow vs other stocks.
The R2 line of the formula below appears incorrect.

R1 = RSI(14); // company RSI
R2 = Foreign( "DJ", "R1 "); // Foreign stock RSI
R3 = R1 - R2;

_SECTION_END();

2. ### auric

this might do..

_SECTION_BEGIN("rsi");
Ticker= ParamStr("Short ticker", "?");//short stock
tickersc=Foreign( ticker, "C");//Short stock
/////////////////////////////////////
ticker2=C;//long stock
/////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
////////////////cci//////////////////
N=Param("N",14,2,34,1);

_SECTION_END();

3. ### empee

dj=foreign("DJ","C");

R1 = RSI(14); // company RSI
R2 = RSIa(dj,14)
R3 = R1 - R2;

_SECTION_END();

To see it:

4. ### themickey

Thankyou auric and empee.
I noticed after my first posting that foreign was limited to datafields of O,C,H,L,V and OI and I couldn't get my head around on how to use it otherwise.
I have 2 of Bandy's books on using AB formulas but still couldn't suss it out.
Thanks again.

5. ### gjohn

Hi, could anyone have the Amibroker formula for candlestick spread between two stocks? I have only spread with plotting just line of EOD prices, but I need candlestick chart of OHLC spread prices. Thanks.

ET IS FREE BECAUSE OF THE FINANCIAL SUPPORT FROM THESE COMPANIES: