Hi coders, I have a technical issue that I cannot resolve it. I have an entry condition as follows :-
To place a BUY (BuySignal), it must be a "Lo0>Lo1" condition, otherwise my EA should not proceed to BUY, and vice versa for SELL signal.
。 。 。 。 。
Now, during my demo testing, I found that my EA yet placed BUY/SELL orders even through "Lo0<=Lo1" and "Hi0>=Hi1" happened respectively, and this should not happen at all.
。 。 。 。 。
In my opinion, the problem is on the Lo0 and Hi0 because the Bar0 is yet not a complete full bar.
I need coder's help and advice, how to resolve the Bar0 issue ? Thanks.
Inserted Code
double Hi0=iHigh(sym,60,0), Hi1=iHigh(sym,60,1), Lo0=iLow(sym,60,0), Lo1=iLow(sym,60,1); bool BuySignal= ... && Lo0>Lo1 && ...; bool SelSignal= ... && Hi0<Hi1 && ...;
To place a BUY (BuySignal), it must be a "Lo0>Lo1" condition, otherwise my EA should not proceed to BUY, and vice versa for SELL signal.
。 。 。 。 。
Now, during my demo testing, I found that my EA yet placed BUY/SELL orders even through "Lo0<=Lo1" and "Hi0>=Hi1" happened respectively, and this should not happen at all.
。 。 。 。 。
In my opinion, the problem is on the Lo0 and Hi0 because the Bar0 is yet not a complete full bar.
I need coder's help and advice, how to resolve the Bar0 issue ? Thanks.