hi polpolik here is an afl that might help just open heating oil chart up and type the crude and gasoline tickers in the parameter box
still learning how to do spreads in ami not much help around
cheers kg
//2Gasoline +1 Heating Oil - 3Crude Oil
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorDarkGreen));
//////////////////////////////////////////////
Tickerg= ParamStr("long ticker", "type in Gasoline ticker");//long
///////////////
tickersgc=Foreign( tickerg, "C");//long gasoline
tickersgo=Foreign( tickerg, "O");//long gasoline
tickersgh=Foreign( tickerg, "H");//long gasoline
tickersgl=Foreign( tickerg, "L");//long gasoline
////////////////////////////////////////////
Ticker= ParamStr("Short ticker", "type in crude ticker");//short stock
//////////////////////////////////////
tickersc=Foreign( ticker, "C");//Short crude
tickerso=Foreign( ticker, "O");//Short crude
tickersh=Foreign( ticker, "H");//Short crude
tickersl=Foreign( ticker, "L");//Short crude
/////////////////////////////////////////////////////////////////
Longt=Param("Gasoline contracts",2,1,5,1);
Shortt=Param("Crude contracts",3,1,5,1);
//////////////////////////////////////////////////////////////////
spreadc=(((Longt)*(tickersgc))+C)-((Shortt)*(tickersc));
spreado=(((Longt)*(tickersgo))+O)-((Shortt)*(tickerso));
spreadh=(((Longt)*(tickersgh))+H)-((Shortt)*(tickersh));
spreadl=(((Longt)*(tickersgl))+L)-((Shortt)*(tickersl));
////////////////2 period moving average////////////////////////////////////
Cc1=EMA(spreadc,2);
Plot( spreadc,""+Ticker,colorGold,styleDashed);
Plot(Cc1,"",colorBrightGreen,5);
///////////displaced moving average////////////////////////
x1=MA(Cc1,13);
x2=Ref(x1,-3);
Plot(x2,"3 displaced 13 MA ",0,5);
///////////bollinger bands of ///////////////////////////////////
bb=1.7*(StDev( spreadc, 11 )) ;
Plot(Cc1+bb,"",54,styleDashed);
Plot(Cc1-bb,"",54,styleDashed);