I don't think that my OrderTotals() loop is working in Strategy Tester(build445)

 

Hi all,

I am curious if there is a reason that OrderTotals() loop doesn't work in strategy tester(MT4build445)..

My expert is written that when there are no open orders, i'm expecting the ea to print to journal - that it did not select any orders(in strategy tester).

Just trying to get an order out of my EA at the moment.

//=problems when using strategy tester=
// 1. gets signal one bar late.
// 2. doesn't open an order.
//    A. doesn't print if it has found an order.
//    B. doesn't print if it has NOT found an order like "No orders are open at this time or EA could not select its order(s)."
// 3. can run slow on strategy tester on speed="31".

code is attached because "text too long." came up when trying to post with SRC.


Thanks ya'll

Files:
haf3.zip  9 kb
 
Subgenius:

Hi all,

I am curious if there is a reason that OrderTotals() loop doesn't work in strategy tester(MT4build445)..

My expert is written that when there are no open orders, i'm expecting the ea to print to journal - that it did not select any orders(in strategy tester).

Just trying to get an order out of my EA at the moment.

code is attached because "text too long." came up when trying to post with SRC.

Have you verified that the IBFX - Quick Scripts.mqh  actually do what you think they should do ?  after a quick look I can see how they can easily get things wrong . . .  why don't you just use standard mql4 functions ?
 
RaptorUK:
Have you verified that the IBFX - Quick Scripts.mqh  actually do what you think they should do ?  after a quick look I can see how they can easily get things wrong . . .  why don't you just use standard mql4 functions ?


sure this has worked before..


WAS Trying to see a print "No orders are open at this time or EA could not select its order(s)." if there are no orders. 

now works though.. some reason i had orderstotal - 1 and >=0 so no nested else if there..


thanks

 
Subgenius:

sure this has worked before..


WAS Trying to see a print "No orders are open at this time or EA could not select its order(s)." if there are no orders. 

now works though.. some reason i had orderstotal - 1 and >=0 so no nested else if there..


thanks

If you feel inclined,  a little experiment.

Just before your line of code that places an Order add a line of code that creates an Object,  any Object it doesn't matter and then duplicate the exact same line of code so the same object with the same object name is created twice.  I suspect that this will cause the  IBFX - Quick Scripts.mqh  code to see an error that comes from the Object creation and it will fail to set the SL & TP for the Order.