1 registered members (AndrewAMD),
1,244
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
v 2.42.4 First entry into TMF with OrderDelay
#484335
10/10/21 12:37
10/10/21 12:37
|
Joined: Jul 2017
Posts: 785
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 785
|
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. 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: [[[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: [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.
|
|
|
Re: v 2.42.4 First entry into TMF with OrderDelay
[Re: Zheka]
#484356
10/13/21 17:25
10/13/21 17:25
|
Joined: Jul 2017
Posts: 785
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 785
|
I am not using the time of tmf entry per se. I am using prices, spread,etc at the time of enterLong/Short to dynamically adjust TradeEntryLimit. For this, I assume//rely on that a tmf is entered into at the time of enterLong/Short, at least at the next available tick. The manual states that "Since a TMF runs at every tick, it has access to the most recent price quote" and in ALL prior versions this has been the case (I relied on this and 100% sure of this). Now, this is what happens in 2.42.4 ( if you comment out OrderDelay): [151: Tue 21-01-12 10:00] (1.21624) (EUR/USD::L) Long 1@1.21604 Entry limit (EUR/USD::L) Entry limit 1.21604 hit at 1.21599 10:08:00 time= 1008 [EUR/USD::L15202] Long 1@1.21615 x at 10:08:00 time= 1009 i.e. a TMF is not entered at all until the Entry limit is hit! With this, adjustments to TradeEntryLimit while a TradeIsPending are impossible; one can now only manage Exits with the tmf, but not micro-manage Entries. This could hardly be the intention.
Last edited by Zheka; 10/13/21 17:26.
|
|
|
Re: v 2.42.4 First entry into TMF with OrderDelay
[Re: Zheka]
#484363
10/15/21 10:53
10/15/21 10:53
|
Joined: Jul 2017
Posts: 785
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 785
|
As for TMF running when TradeIsEntry, - I stand corrected, it actually does run as stated in v 2.4x.
But in general, " running on ticks when pending" was an integral part of working TMF functionality in versions prior to 2.4x.
I am kindly asking to fix this regression in the next beta, not a 'new version' (which I guess means 2.5...or so?).
I could continue using 2.37.3 for now, but there are 2 features in 2.42.4 that make life easier: LookBackResolution and waiting for the complete 1st bar to run in Live.
P.S.: it would be nice to also have a TradeEntryDate available somehow.
Last edited by Zheka; 10/15/21 10:58.
|
|
|
Re: v 2.42.4 First entry into TMF with OrderDelay
[Re: Zheka]
#484365
10/15/21 11:31
10/15/21 11:31
|
Joined: Jul 2017
Posts: 785
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 785
|
Thank you. In v2.37.3, this code: int tmf() {
watch("#time=",tod(0));
return 0;
}
function run() {
NumYears=1;
set(LOGFILE);
set(TICKS);
LifeTime=5;
Entry=-2*PIP;
//OrderDelay=59.9;
if (NumOpenLong==0)
if (priceClose(0)>priceClose(20) )
enterLong(tmf);
} produces this output: [151: Tue 21-01-12 10:00] -6.15 0 0/2 (1.21624)
(EUR/USD::L) Long 1@1.21604 Entry limit
time= 1001
time= 1002
time= 1003
time= 1004
time= 1005
time= 1006
time= 1007
(EUR/USD::L) Entry limit 1.21604 hit by 1.21599 at 10:08:00
time= 1008
[EUR/USD::L15202] Long 1@1.21615 x at 10:08:00
time= 1008
|
|
|
Re: v 2.42.4 First entry into TMF with OrderDelay
[Re: Zheka]
#484368
10/15/21 16:17
10/15/21 16:17
|
Joined: Jul 2017
Posts: 785
Zheka
OP
User
|
OP
User
Joined: Jul 2017
Posts: 785
|
jcl, in 2.42.5, TMFs are now called when a trade is pending, great. However, there is something wonky going on when TMF returns 4. int tmf() {
watch("#time=",tod(0));
if (TradeIsEntry) return 4;
return 0;
}
function run() {
NumYears=1;
set(LOGFILE, TICKS);
LifeTime=5;
Entry=-3*PIP;
if (NumOpenLong==0)
if (priceClose(0)>priceClose(20) )
enterLong(tmf);
} produces some weird output: [104: Fri 21-01-08 08:00] 0000 0 0/0 (0.776700)
(AUD/USD::L) Long 1@0.776400 Entry limit
time= 800
(AUD/USD::L) Missed entry 0.77753 after 1 bar <---???
(AUD/USD::L) Entry limit 0.776400 hit at 0.776090 08:01:00
time= 801
[105: Fri 21-01-08 09:00] 0000 0 0/0 (0.776450)
(AUD/USD::L) Long 1@0.776150 Entry limit
time= 900
(AUD/USD::L) Missed entry 0.77640 after 1 bar <---???
time= 901
time= 902
time= 903
time= 904
(AUD/USD::L) Entry limit 0.776150 hit at 0.776080 09:05:00
time= 905 TMF now does not run once the trade is open!?
Last edited by Zheka; 10/15/21 16:18.
|
|
|
|