Hello Members,
Below is a code which is a simple "Explore" to get the list of stocks which have gone into Buy / Sell zone, basis the EMA Crossover / Crossunder....
In this formulae, the BUY is working properly. However, SELL does not work. I even tried using CL_Sell (which is mentioned below as comments, in line7). But it just does not work.
Criteria :
Sell if Close < Min EMA AND crossover of EMA has happened i.e 200EMA > 100EMA > 50EMA (and close is below that) - NOT WORKING
Buy if Close > Max EMA AND crossover of EMA has happened. i.e. 50EMA > 100EMA > 200EMA (and Close is above that) - THIS IS WORKING...
Can someone please check and modify the code to correct the problem?
Thanking you in anticipation.
Warm Regards...RB
e1=EMA(C,50);
e2=EMA(C,100);
e3=EMA(C,200);
Maxema=Max(e3,Max(e2,e1));
Minema=Min(e1,Min(e2,e3));
//CL_Buy = e1>e1>e3;
//CL_Sell = e1<e2<e3;
EMA_buy=IIf((Close>Maxema) AND (C > (e1>e2>e3)),1,0);
EMA_sell=IIf((Close<Minema) AND (C < (e3>e2>e1)),1,0);
Filter = EMA_Buy OR EMA_Sell ;
AddColumn(EMA_buy,"EMA_Buy", format = 1.2, IIf(EMA_Buy == True, textColor = colorGreen, textColor = colorLightGrey));
AddColumn(EMA_sell,"EMA_Sell", format = 1.2, IIf(EMA_Sell == True, textColor = colorRed, textColor = colorLightGrey));
Below is a code which is a simple "Explore" to get the list of stocks which have gone into Buy / Sell zone, basis the EMA Crossover / Crossunder....
In this formulae, the BUY is working properly. However, SELL does not work. I even tried using CL_Sell (which is mentioned below as comments, in line7). But it just does not work.
Criteria :
Sell if Close < Min EMA AND crossover of EMA has happened i.e 200EMA > 100EMA > 50EMA (and close is below that) - NOT WORKING
Buy if Close > Max EMA AND crossover of EMA has happened. i.e. 50EMA > 100EMA > 200EMA (and Close is above that) - THIS IS WORKING...
Can someone please check and modify the code to correct the problem?
Thanking you in anticipation.
Warm Regards...RB
e1=EMA(C,50);
e2=EMA(C,100);
e3=EMA(C,200);
Maxema=Max(e3,Max(e2,e1));
Minema=Min(e1,Min(e2,e3));
//CL_Buy = e1>e1>e3;
//CL_Sell = e1<e2<e3;
EMA_buy=IIf((Close>Maxema) AND (C > (e1>e2>e3)),1,0);
EMA_sell=IIf((Close<Minema) AND (C < (e3>e2>e1)),1,0);
Filter = EMA_Buy OR EMA_Sell ;
AddColumn(EMA_buy,"EMA_Buy", format = 1.2, IIf(EMA_Buy == True, textColor = colorGreen, textColor = colorLightGrey));
AddColumn(EMA_sell,"EMA_Sell", format = 1.2, IIf(EMA_Sell == True, textColor = colorRed, textColor = colorLightGrey));