SetChartOptions(0,chartShowDates);
BaseMkt=".nsei"; // <-------------- Index Symbol ----
base_p = Foreign(BaseMkt, "C",TRUE);
mabase=MA(base_p,15);
Plot(base_p,"",4,1);
Plot(MABASE,"",3,1);
Buyok = Cross(base_p,mabase);
sellok = Cross(mabase,base_P);
PlotShapes(Buyok*shapeUparrow+Sellok*shapeDownarrow, IIf(Buyok,colorgreen,colorred),0,IIf(Buyok,mabase-3,mabase+3)) ;
xx=BarIndex();x=xx;Lx=LastValue(x);
fvb=Status("firstvisiblebarindex");
lvb=Min(Lx,Status("lastvisiblebarindex"));
dt=DateTime() ;//
bdt=ValueWhen(buyok,dt);
sdt=ValueWhen(sellok,dt);
for(i=fvb;i<lvb;i++)
{
if(buyok) PlotTextSetFont(""+DateTimeToStr( bdt [ i ] ),"Ariel",8,i,mabase,colorGreen,colordefault,-15);
if(sellok) PlotTextSetFont(""+DateTimeToStr( sdt [ i ] ),"Ariel",8,i,mabase,colorred,colordefault,15);
}
watchlistCheck = InWatchList( 1 ) ;//OR InWatchList( 2 );
Buy = watchlistCheck AND Buyok ;
sell = watchlistCheck AND sellok;
BuyPrice=SellPrice=Close;
Filter=1; // t
AddColumn(IIf(Buy,BuyPrice,Null),"Buy",1.2,2,colorGreen);
AddColumn(IIf(sell,sellPrice,Null),"Sell",1.2,2,colorred);