Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 712 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Phantom trade functionality not working #483432
05/30/21 11:22
05/30/21 11:22
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
In 2.38.1, phantom trades are just "missed" and their Trade entry/exit, etc variables are not recorded.

Consequently, all ..Long/...Short trade statistics is incorrect.

Re: Phantom trade functionality not working [Re: Zheka] #483436
05/30/21 19:58
05/30/21 19:58
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
I had some 10 asset () calls in the INITRUN, and then with while (asset(loop ("EUR/USD", " ",...) ).
Besides the above, this in 2.38.1 started to cause other problems when TICKS was set (trades were only entered for the first asset in the loop() macro (changing the asset order changed the asset with trades).

Without TICKS, trades were entered for all assets in the loop().

Once I removed asset () calls in the if (Init) {} , prior to loop() - both problems disappeared.

The script has been working for over a year in prior versions without any such problems.

Re: Phantom trade functionality not working [Re: Zheka] #483447
06/01/21 07:04
06/01/21 07:04
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Can you post the code?

Re: Phantom trade functionality not working [Re: Zheka] #483503
06/07/21 12:32
06/07/21 12:32
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Here is the demo script :
Code
function run () {
	
	if (is(INITRUN) ) {	
	
		set(LOGFILE);
		set(PLOTNOW);
		
		Verbose =3;
							
		NumYears=1;
					
	}	

	vars rsi = series(RSI(seriesC(),5), 10);
	
	EntryTime=1;
	
	Entry = -1.5*PIP;
	
	Lots=1;
		
	if (rsi[0]>70 and rsi[1]<70) { 
		exitLong(); 
		if (WinStreakShort>5) Lots=-1; 
		enterShort();
	} 
	else
	if (rsi[0]<30 and rsi[1]>30) { 
		exitShort(); 
		if (WinStreakLong>5) Lots=-1;
		enterLong();
	} 		
}
. After several first real trades, phantom trades are subsequently "missed" - despite price penetrating the entry limit level, e.g.:
Code
[525: Wed 21-02-03 09:00c] 1.20382/1.20428\1.20317/1.20320 -0.00003
Exit  EUR/USD  0
Enter Long EUR/USD  Entry -0.00015000 at 09:00:00
(EUR/USD::l) Long 1@1.20305 Entry limit

[526: Wed 21-02-03 10:00] -3.21 0 24/17 1.20320/1.20325\1.20097/1.20235 -0.00003
(EUR/USD::l) Missed entry 1.2031 after 1 bar
The problem disappears, if either:
EntryTime is set to 2 :
Code
[525: Wed 21-02-03 09:00c] -2.84 +1.61 28/20 1.20382/1.20428\1.20317/1.20320 -0.00003
Exit  EUR/USD  0
Enter Long EUR/USD  Entry -0.00015000 at 09:00:00
(EUR/USD::L) Long 1@1.20305 Entry limit
(EUR/USD::L) Entry limit 1.20305 hit by 1.20097 at 09:00:00
[EUR/USD::L52606] Long 1@1.20296  at 09:00:00
Com 0.0570  Mrg 39.37  Net 3

[526: Wed 21-02-03 10:00] -2.84 -1.64 27/22 1.20320/1.20325\1.20097/1.20235 -0.00003
, or when trades are not "exited" before entry (i.e. exitLong()/Short() ) are commented out.

Re: Phantom trade functionality not working [Re: Zheka] #483550
06/14/21 08:01
06/14/21 08:01
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Spirit,

I read your reply in an email, but cannot see it here..

The new trade expiration behavior - prioritizing Stops/TP processing over a timed exit - makes sense and is a welcome improvement.

But the case above is about entries, and does not seem applicable. Is it?

Re: Phantom trade functionality not working [Re: Zheka] #483551
06/14/21 08:38
06/14/21 08:38
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
This was indeed a bug. It will be fixed in the next beta.


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