How to apply RSI on spread line

Hi everybody, i need advice how to apply RSI indicator on spread line (calculated as difference close prices), i am trying create chart for futures spreads (between two same futures with different contract months). In Amibroker there is indicator called spread, but i need calculate RSI on that spread and RSI indicator is calculated from main graph. It is possible change calculation of RSI to spread calculation not bar calculation? Thanks for your advice.

@cactuszlm you can use RSIa().

RSIa accepts an input array as the first parameter, so its RSI can be applied to your calculated spread.

5 Likes

Hi
Has anyone managed to plot this RSI?

Thanks

this is my attempt on the close price

however not sure how I use the price parameter

_N( Symbol2= ParamStr("Symbol2", "SPY") );
 Period=Param("Spread Rsi",100,2,100,1); 
 P = ParamField( "Price field" );

oversold = Param( "Oversold level", 20, 1, 100, 1 );
overbought = Param( "Overbought level", 80, 1, 100, 1 );

SetForeign( Symbol2 );
C2 = C;
H2 = H;
L2 = L;
O2 = O;
V2 = V;
RestorePriceArrays();

spread = ( c/c2);



 spreadrsi = RSIa(spread,period);
 Plot(spreadrsi,"RSI",colorBlack ,styleLine ); 
 PlotGrid( oversold );
PlotGrid( overbought);
 
1 Like