i want to code afl for my following logic:
buy when 20 ema >50 ema and next candle is half percent higher than previous candle close value.
i have following code but not working
Up = Ema (C, 20) > Ema (C, 50);
BuyV = up AND (C > ( Ref(C, -1)+ C*.0005));
Down = Ema (C, 50) > Ema (C, 20);
SellV = down AND (C < ( Ref(C, -1)-C*.0005)) ;
buy when 20 ema >50 ema and next candle is half percent higher than previous candle close value.
i have following code but not working
Up = Ema (C, 20) > Ema (C, 50);
BuyV = up AND (C > ( Ref(C, -1)+ C*.0005));
Down = Ema (C, 50) > Ema (C, 20);
SellV = down AND (C < ( Ref(C, -1)-C*.0005)) ;