Hi,

There is a change in behavior in 2.4x vs 2.37.3 in a situation when TMF is used and OrderDelay is set.
Code
int tmf() {
	watch("#time=",tod(0));
	return 0;
}

function run() {
	NumYears=1;
	
	set(LOGFILE, TICKS);
		
	LifeTime=5;
	
	Entry=-1*PIP;
	
	OrderDelay=59.99; // or 119.99
	
	if (NumOpenLong==0)
	 if (priceClose(0)>priceClose(20) ) enterLong(tmf); 	
}

in v 2.37.3, TMF is entered on the 1st tick of the next bar - as expected:
Quote
[[[103: Fri 21-01-08 07:00] (1.22641) <----with OrderDelay=119.99
(EUR/USD::L) Long 1@1.22631 Entry limit
(EUR/USD::L) Entry limit 1.22631 hit by 1.22619 at 07:01:00
time= 701
[EUR/USD::L10402] Long 1@1.22610 x at 07:01:00
time= 701
......
..........
[165: Wed 21-01-13 00:00] -3.45 0 1/3 (1.22094) <----with OrderDelay=59.99
(EUR/USD::L) Long 1@1.22084 Entry limit
[EUR/USD::L16602] Long 1@1.22103 x at 00:01:00
time= 1
time= 2

in 2.42.4 however, TMF is entered only on the next tick:
Quote
[103: Fri 21-01-08 07:00] (1.22641) <----with OrderDelay=59.99
(EUR/USD::L) Long 1@1.22631 Entry limit
[EUR/USD::L10402] Long 1@1.22610 x at 07:01:00
time= 702

[i][103: Fri 21-01-08 07:00] (1.22641) <----with OrderDelay=119.99
(EUR/USD::L) Long 1@1.22631 Entry limit
(EUR/USD::L) Entry limit 1.22631 hit at 1.22619 07:01:00
time= 701 <---- OK
[EUR/USD::L10402] Long 1@1.22610 x at 07:01:00
time= 702

...................
....................
[165: Wed 21-01-13 00:00] -3.45 0 1/3 (1.22094) <----with OrderDelay=59.99
(EUR/USD::L) Long 1@1.22084 Entry limit
[EUR/USD::L16602] Long 1@1.22103 x at 00:01:00
time= 2
time= 3[/i]

[165: Wed 21-01-13 00:00] -3.40 0 1/3 (1.22094) <----with OrderDelay=119.99
(EUR/USD::L) Long 1@1.22084 Entry limit
[EUR/USD::L16602] Long 1@1.22111 x at 00:02:00
time= 3
time= 4

I am relying on the time of tmf entry in my code to later adjust entry/stop/tp - so this is a "code breaking change'.
Can this behavior please be reverted?

Last edited by Zheka; 10/10/21 13:24.