Help required in modifying this formula for Buy / Sell

#1
Hello Members,

Need help in the following AFL, which, as a newbie, was unable to get any output:
Logic:
Buy : Current candle is above the previous 2 candles and ALL of them are above the 5EMA and 10MA; Crossover above EMA and MA has happened 2 candles ago
Current Candle > Ref(C,-1);
Ref (C,-1) < Ref(C,-2);
Ref(C,-2) AND Ref(C,-1) > EMA(C,5) and MA(C,10)

Sell : Vice-versa
Current Candle < Ref(c,-1);
Ref(C,-2) > Ref(C,-1);
Ref(C,-2) AND Ref(C,-1) < EMA(C,5) and MA(C,10)

Output in Explore Window with Time of Buy/Sell generated, Scrip name, Signal (B/S), Target (as BBandTop for Buy and BBandBot for Sell);

Also pls correct me in the AA window, as follows :
Apply to : All Symbols
Range : n Last Quotations where n=1;
Would this be RIGHT??

Thanks in Advance.

warm regards...rbhapkar
 
#2
Hello Members,

Need help in the following AFL, which, as a newbie, was unable to get any output:
Logic:
Buy : Current candle is above the previous 2 candles and ALL of them are above the 5EMA and 10MA; Crossover above EMA and MA has happened 2 candles ago
Current Candle > Ref(C,-1);
Ref (C,-1) < Ref(C,-2);
Ref(C,-2) AND Ref(C,-1) > EMA(C,5) and MA(C,10)

Sell : Vice-versa
Current Candle < Ref(c,-1);
Ref(C,-2) > Ref(C,-1);
Ref(C,-2) AND Ref(C,-1) < EMA(C,5) and MA(C,10)

Output in Explore Window with Time of Buy/Sell generated, Scrip name, Signal (B/S), Target (as BBandTop for Buy and BBandBot for Sell);

Also pls correct me in the AA window, as follows :
Apply to : All Symbols
Range : n Last Quotations where n=1;
Would this be RIGHT??

Thanks in Advance.

warm regards...rbhapkar
This is for Buy signal:

Condition1=C>=HHV(C,3);
Condition2=Ref(C,-2)>Max(Ref(EMA(C,5),-2),Ref(MA(C,10),-2));
Condition3=Ref(C,-3)<Max(Ref(EMA(C,5),-3),Ref(MA(C,10),-3));
Buy=Condition1 AND Condition2 AND Condition3 ;
Filter=Buy;
AddColumn(V,"volume",1.0);

you can make sell signal for yourself

hope this help
 
Last edited:

Similar threads