_SECTION_BEGIN("Background_Setting");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
ParamColor("BgBottom", colorDarkGrey),ParamColor("TitleBack",colorGrey40));
SetChartBkColor(ParamColor("Outer Panel",colorPaleBlue));
SetChartOptions(0,chartShowArrows|chartShowDates);
_SECTION_END();
FirstScrip=ParamList("First Scrip", "NIFTY|BANKNIFTY|HINDUNILVR|LT|SBIN|TATASTEEL|TATA MOTORS|TCS" );
expiry1 = ParamList("Expiry1", "15JAN|15FEB|15MAR|15APR|15MAY|15JUN|15JUL" );
Strike1=Param("Strike1", 0,0,20000,1 );
type1 = ParamList("Type1", "CE|PE" );
SecondScrip=ParamList("Second Scrip", "NIFTY|BANKNIFTY|HINDUNILVR|LT|SBIN|TATASTEEL|TATA MOTORS|TCS" );
expiry2 = ParamList("Expiry2", "15JAN|15FEB|15MAR|15APR|15MAY|15JUN|15JUL" );
Strike2=Param("Strike2", 0,0,20000,1 );
type2 = ParamList("Type2", "CE|PE" );
Symbol1= FirstScrip+expiry1+Strike1+type1;
Symbol2= SecondScrip+expiry2+Strike2+type2;
_SECTION_BEGIN("Price_idx1");
Index1 = ParamStr("Index1", "NIFTY_CE"); // getting CE data in this name in rt mode
idx1c=Foreign(Index1,"C"); // Here's the index
idx1o=Foreign(Index1,"o");
idx1h=Foreign(Index1,"h");
idx1l=Foreign(Index1,"l");
_SECTION_END();
_SECTION_BEGIN("Price_idx2");
Index2 = ParamStr("Index2", "NIFTY_PE"); // getting PE data in this name in rt mode
idx2c=Foreign(Index2,"C");
idx2o=Foreign(Index2,"o");
idx2h=Foreign(Index2,"h");
idx2l=Foreign(Index2,"l");
_SECTION_END();
af=idx1c+idx2c;
_SECTION_BEGIN("Price");
PlotOHLC( idx1o, idx1h, idx1l, idx1c, "(" + Index1+" ) ", colorblue, 64);
PlotOHLC( idx2o, idx2h, idx2l, idx2c, "(" +Index2 + ") ", colorGreen, 64);
PlotOHLC( idx1o+idx2o, idx1h+idx2h, idx1l+idx2l, idx1c+idx2c, "(" + Index1+" + "+Index2 + ") ", coloryellow, 64);
Title = EncodeColor(colorYellow) + "CE+PE \n" + EncodeColor(colorWhite)+ ""+Date() + " \n" + EncodeColor(colorGreen) +
EncodeColor(colorSkyblue) +symbol1+ " ,Close = "+ NumToStr(idx1c,1.2)+"\n"+
EncodeColor(colorSeaGreen) +symbol2+ " ,Close = "+ NumToStr(idx2c,1.2)+
EncodeColor(colorSkyblue) +"\nClose of 2 series = "+ NumToStr(af,1.2);
GraphXSpace=10;
_SECTION_END();