Hi,
The afl for plotting Spread is as under,
_N( Symbol2= ParamStr("Symbol2", "MSFT") );
Mode = ParamToggle("Mode", "Difference (Symbol1-Symbol2)|Ratio (Symbol1/Symbol2)");
SetForeign( Symbol2 );
C2 = C;
H2 = H;
L2 = L;
O2 = O;
V2 = V;
RestorePriceArrays();
Color = ParamColor( "Color", colorDefault );
Style = ParamStyle( "Style", styleLine, maskPrice );
if( Mode == 0 )
PlotOHLC( O-O2, H-H2, L-L2, C-C2, "(" + Name()+" - "+Symbol2 + ") spread", Color, style );
else
PlotOHLC( O/O2, H/H2, L/L2, C/C2, "(" + Name()+" / "+Symbol2 + ") spread", Color, style );
Needed help to modify / include the following
(i) Instead of plotting the active symbol, can a provision be made to enter thru the parameters box, the 2 symbols whose spread is to be plotted
(ii) the current afl has provision for Difference, Ratio. Can "Sum" function also be included as one of the options under Mode in Parameters box.
The afl for plotting Spread is as under,
_N( Symbol2= ParamStr("Symbol2", "MSFT") );
Mode = ParamToggle("Mode", "Difference (Symbol1-Symbol2)|Ratio (Symbol1/Symbol2)");
SetForeign( Symbol2 );
C2 = C;
H2 = H;
L2 = L;
O2 = O;
V2 = V;
RestorePriceArrays();
Color = ParamColor( "Color", colorDefault );
Style = ParamStyle( "Style", styleLine, maskPrice );
if( Mode == 0 )
PlotOHLC( O-O2, H-H2, L-L2, C-C2, "(" + Name()+" - "+Symbol2 + ") spread", Color, style );
else
PlotOHLC( O/O2, H/H2, L/L2, C/C2, "(" + Name()+" / "+Symbol2 + ") spread", Color, style );
Needed help to modify / include the following
(i) Instead of plotting the active symbol, can a provision be made to enter thru the parameters box, the 2 symbols whose spread is to be plotted
(ii) the current afl has provision for Difference, Ratio. Can "Sum" function also be included as one of the options under Mode in Parameters box.