Hi Steve,
Just downloaded this one (1J) out of interest and noticed that it freezes the tester as soon as it opens the first trade (a sell in my case). I'm still looking for possible causes.
I did notice that there is a bug in IsClosedTradeRogue()
Code: Select all
//Subtract the OrderCloseTime from the OrderOpenTime. There must be a minimum of > MinMinutesBetweenTradeOpenClose minutes between the open and the close. < this indicates possible rogue behaviour.
if (OrderOpenTime() - OrderCloseTime() < (MinMinutesBetweenTradeOpenClose * 60) )
I think what you wanted to check was OrderCloseTime() - OrderOpenTime()
Also, the break following the test means that once you have found and checked one history trade (with matching magic no, etc) and it's open & close times were OK, then it can exit the loop. However, this assumes that the history trade you found was the very last one closed which may not always be the case since the order of trades is arbitary. Remember a good while back when I sent you some history checking code (it was to find the last closed order) for something that was exhibiting strange behaviour which was down to this issue?
Regards, Paul.