Code Problem

Back to topics list To post a new topic, please log in or register
avatar
5
Lorenzo171298 2015.08.22 15:55
 
Hi, I have a problem: my program during the test send only one order even if looking at the charts it could do many more order. Please can you help me?
Attached files:
  programma1.mq4  (4.05 KB)
avatar
Moderator
3418
GumRai 2015.08.22 20:26 #
 

It is not a good idea to use Global Variables of the client terminal in this way. If the EA is running on more than 1 chart they will interfere with each other.

There is no check in your code to see if the trade was closed by SL or TP. The variable is only reset if the trade is closed by the EA. Check OrderCloseTime() and if it !=0, reset the variable.

avatar
5
Lorenzo171298 2015.08.23 01:47 #
 
GumRai:

It is not a good idea to use Global Variables of the client terminal in this way. If the EA is running on more than 1 chart they will interfere with each other.

There is no check in your code to see if the trade was closed by SL or TP. The variable is only reset if the trade is closed by the EA. Check OrderCloseTime() and if it !=0, reset the variable.

OK thanks now I've corrected my program

Back to topics list  

To add comments, please log in or register