Need help for a EA making

 

Dear guys

I am new in MT4 coding. I made a EA base on a indicator. I am using icustom. But I am facing a problem. indicator give buy/sell signal on 5 TF of a candle  then my EA take immediately trade on indicator signal.

problem is that when my trade close on same candle, EA trade again because indicator signal is still valid. I don't want trade again on same candle after a trade already taken.

 

How can I give condition that EA not take trade again. just one trade on one candle.

 

does anybody help me out. or is there any of type EA exist in MQL community . Please let me know.    

 
dralialadin:

Dear guys

I am new in MT4 coding. I made a EA base on a indicator. I am using icustom. But I am facing a problem. indicator give buy/sell signal on 5 TF of a candle  then my EA take immediately trade on indicator signal.

problem is that when my trade close on same candle, EA trade again because indicator signal is still valid. I don't want trade again on same candle after a trade already taken.

 

How can I give condition that EA not take trade again. just one trade on one candle.

Look at the OrderOpenTime() for the orders that have closed,  if any (for your EA) have the same time as Time[0], the current bar,  do not place a new order based on the current signal from the Indicator.
 
RaptorUK:
Look at the OrderOpenTime() for the orders that have closed,  if any (for your EA) have the same time as Time[0], the current bar,  do not place a new order based on the current signal from the Indicator.

thanks