Thank you all for the answers!
@Noobywan: you are right I didn’t specify it because I thought CROSSES OVER meant that the current candle open below the MA and close above it. I did know I should consider the previous xclose to be below MA and current xclose to be above MA. Thank you a lot to clarify.
I think to have that condition I have to use something like this:
c1 = xOpen < indicator1 and xClose > indicator1
About that position I mentioned you were right I think, I had a better look to the charts and the bar before the doji was a bearish HA and close was few decimal of pips below the MA which were rounded like this:
MA: 1,0792
Xclose: 1,0791
Instead investing.com reports them as both at 1.0792 and a loss postion would have not been opened.
@Nicolas, here is the HA, I will post them to be sure:
xClose = (open+high+low+close)/4
IF BarIndex=0 THEN
xOpen = open
xHigh = high
xLow = low
ELSE
xOpen = (xOpen[1] + xClose[1])/2
xHigh = Max(Max(high, xOpen), xClose)
xLow = Min(Min(low, xOpen), xClose)
ENDIF
and this too (even if I’m using the first and the results do not changes):
IF BarIndex = 0 THEN
XClose = TotalPrice
XOpen = (Open + Close) / 2
xHigh = high
xLow = low
ELSE
XClose = TotalPrice
XOpen = (XOpen[1] + Xclose[1]) / 2
xHigh = Max(Max(high, xOpen), xClose)
xLow = Min(Min(low, xOpen), xClose)
ENDIF
Thank you all again for your support and sorry for the bad reading value, anyway I’ve learned how the CROSSES OVER and UNDER behave.
Now I will have to study a way to avoid this situation.
Thank you!:)