First Steps - EA does not run as it should - page 3 123 New comment vla 2014.11.28 13:43 #21 do say if I use e.g. while loop the order will close itself if the condition is not given anymore? vla 2014.11.28 16:58 #22 alright. I have found another way. I'm using OrdersTotalHistory()+1 William Roeder 2014.11.29 17:44 #23 TheOneWhoKnocks: I have found another way. I'm using OrdersTotalHistory()+1What does the number of orders in history have to do with closing open orders?History positions are [0 .. OrdersTotalHistory() - 1] for a count of OrdersTotalHistory(). +1 is bogus. vla 2014.11.30 11:04 #24 logic:ticketnumber of open trade = number of all orders in trading history +1 But you are absolutely right. using loop makes way more sense. Syed Naufal Gaddafi 2014.11.30 11:25 #25 Just use condition and loop. No need to use While.ticketnumber of open trade = number of all orders in trading history +1 No offense here but the logic fails miserably. You need to think again why. William Roeder 2014.12.01 18:53 #26 TheOneWhoKnocks: logic: ticketnumber of open trade = number of all orders in trading history +1Only in the tester barnacle7 2014.12.02 07:24 #27 I have used this sample in MQl4 Book: https://book.mql4.com/samples/expertIt is in pre: MT4 Build 600 code however the structure/process/Logic is still useful.Not sure if it helps you or not , vla 2014.12.02 19:45 #28 Thanks guys for your help! The hint using the for loop was very helpful. I looked at some other experts and found it a lot. But the mql4 book look very helpful too. Thanks WHRoeder for your advice! 123 New comment
logic:
ticketnumber of open trade = number of all orders in trading history +1
But you are absolutely right. using loop makes way more sense.
Just use condition and loop. No need to use While.
ticketnumber of open trade = number of all orders in trading history +1No offense here but the logic fails miserably. You need to think again why.
I have used this sample in MQl4 Book: https://book.mql4.com/samples/expert
It is in pre: MT4 Build 600 code however the structure/process/Logic is still useful.
Not sure if it helps you or not ,