Thank you guys. I solved that problem and now I got one more. I'm sorry for this, but this is so confusing. Is there a reason why using the last tick and the previous RSI tick value only works on the 1 minute chart and not on the 5 minute one? Because that's exactly what's happening right now. Y'all being kind and I'm here confused. Thank you a lot you guys.
That isn't what OP asked. “I'm trying to make my EA to open a single long trade ONLY.”
That isn't what OP asked. “I'm trying to make my EA to open a single long trade ONLY.”
Is there anyway to know if a trade is long or short through a if?
Of course, but I can't answer since I don't know MT5 enough.
Is there anyway to know if a trade is long or short through a if?
Yes, you can use PositionGetInteger(POSITION_TYPE) then check if its equal to POSITION_TYPE_BUY or POSITION_TYPE_SELL.
You can say in the OnTick() function