Here is the following code:
if cross_20_200=-1 or cross_50_200=-1 or cross_20_50=-1 then
if CrossAbove(ema20,ema50) and
return Close<ema20 and Close\1\<ema20;
Besides, for the successful work of this strategy, it will be necessary to copy the attached BarsSince.tfn file to Alyuda Tradecision\Funct catalogue.
Tradecision Support Team
I would appreciate your help in building a strategy that I have tried to explain in the best possible way.
Strategy: 20 EMA & 50 EMA
Entry Long: 20 EMA crosses 200 EMA up from below,
50 EMA crosses 200 EMA up from below…
Then, 20 EMA goes below 50 EMA and comes back above 50 EMA, you enter long
Exit Long: 2 closes below 20 EMA
What we are trying to do is longs are not entered the first time when 20 EMA & 50 EMA crosses above 200 EMA but when 20 EMA crosses below 50 EMA and then goes back above it, it should trigger a buy.
Thanks in advance.