Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.2.0 Released
by DdlV. 12/01/21 18:04
Oanda LotAmount in Trade Mode
by JayWilly. 12/01/21 15:08
Price of entry with OrderDelay
by Zheka. 11/30/21 09:56
Issues with Binance Futures Plugin v1.0.2.9
by degenerate_762. 11/30/21 09:03
Lapsa's very own thread
by Lapsa. 11/29/21 00:56
Basic Time Windowed profit taking
by Petra. 11/28/21 07:38
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 11/27/21 15:02
Should be possible
by AndrewAMD. 11/27/21 14:56
AUM Magazine
Latest Screens
Tactics of World War I
Hecknex World
Scheherazade's Journey
Paradox Vector
Who's Online Now
9 registered members (ozgur, AndrewAMD, Grant, Quad, 3run, Lapsa, degenerate_762, jack800, 1 invisible), 482 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
allelxr, dcointrade, mcyr, AlgOz, Dark_Saber
18710 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: v 2.42.4 First entry into TMF with OrderDelay [Re: Zheka] #484389
10/19/21 00:18
10/19/21 00:18
Joined: Jul 2017
Posts: 604
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 604
I made a mistake in the prior code: of course, if TradeIsEntry then returning 4 will lead to a missed entry.

But returning 4 on the first run of a TMF, prevents TMF from running on subsequent ticks and leads to no entries at all ( it does in 2.37.3).
Code
int tmf() {
	
if (TradeIsNewBar) return 4;

 watch("#time=",tod(0));

	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:
Code
[103: Fri 21-01-08 07:00c] 1.22585/1.22687\1.22581/1.22641 -0.0
Enter Long EUR/USD  Entry -0.00030000 at 07:00:00
(EUR/USD::L) Long 1@1.22611 Entry limit

[104: Fri 21-01-08 08:00c] 0000 0 0/0 1.22641/1.22697\1.22329/1.22395 -0.0
(EUR/USD::L) Missed entry 1.2261 after 1 bar


Last edited by Zheka; 10/19/21 00:18.
Re: v 2.42.4 First entry into TMF with OrderDelay [Re: Zheka] #484401
10/22/21 09:46
10/22/21 09:46
Joined: Jul 2000
Posts: 27,653
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,653
Frankfurt
Confirmed. This will be fixed in the next beta.

Re: v 2.42.4 First entry into TMF with OrderDelay [Re: Zheka] #484415
10/23/21 19:43
10/23/21 19:43
Joined: Jul 2017
Posts: 604
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 604
v 2.43.1 fixes the problem.

Would appreciate if you could also improve on entry prices with OrderDelay:

When Slippage=0:

[448: Fri 21-01-29 01:00c] -14.80 0 14/15 1.21216/1.21226\1.21043/1.21079 -0.0
Enter Long EUR/USD Entry -0.00030000 Delay 60.0 at 01:00:00
(EUR/USD::L) Long 1@1.21049 Entry limit
time= 100 1.21216 1.21226 1.21043 1.21079
time= 101 1.21079 1.21087 1.21070 1.21081 <---price increased during the tick
time= 102 1.21079 1.21091 1.21070 1.21082 <--price further increased, made a new high
[EUR/USD::L44905] Long 1@1.21075 x at 01:02:00

With OrderDelay=60, the entry price should be 1.21081 at time =101. Why shouldn't it ?

When Slippage is not set/ left at default:

[103: Fri 21-01-08 07:00c] 1.22585/1.22687\1.22581/1.22641 -0.0
Enter Long EUR/USD Entry -0.00030000 Delay 60.0 at 07:00:00
(EUR/USD::L) Long 1@1.22611 Entry limit
time= 700 1.22585 1.22687 L=1.22581 C=1.22641
time= 701 1.22641 1.22641 L=1.22619 C=1.22626
time= 702 1.22641 1.22654 L=1.22619 C=1.22642
[EUR/USD::L10402] Long 1@1.22605 x at 07:02:00

How can the entry price be better than the low of the bar by the time of entry??




Last edited by Zheka; 10/23/21 19:44.
Page 2 of 2 1 2

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1