I´m trying to get this figured out, but no luck yet.
I am trying to get (in this case) long trade to be triggered, when the price is first above EMA, after that price makes LOW, which is under EMA, and after that price gets up again and crosses above EMA. That´s where the trigger should be, the crossing.
Strategy is calculating OnEachTick and all that mentioned above, should take place intrabar, during only one bar.
I used few variables to narrow down the right place before the final trigger, here is that part of the code (little simflified):
LongShort = (Open[0] - EMA1[0]); // Detects that the current bar has opened above EMA (positive value for LONGs)
Low1 = (Low[0] - (EMA1[0]); // Detects if the low of current bar has reached value under EMA value (negative value for LONGs)
if ((LongShort > 0)
&& (Low1 < 0))
To this point all goes fine, and strategy detects these places.
But if I add (CrossAbove(Close, EMA1, 1)) to the if statement, nothing happens. No trades are made.
This action should be possible using CrossBelow/-Above?
Any ideas what´s wrong with my logic?
Thanks in advance!
-Paroooni-
Comment