Phantom trade functionality not working

Posted By: Zheka

Phantom trade functionality not working - 05/30/21 11:22

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.
Posted By: Zheka

Re: Phantom trade functionality not working - 05/30/21 19:58

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.
Posted By: jcl

Re: Phantom trade functionality not working - 06/01/21 07:04

Can you post the code?
Posted By: Zheka

Re: Phantom trade functionality not working - 06/07/21 12:32

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.
Posted By: Zheka

Re: Phantom trade functionality not working - 06/14/21 08:01

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?
Posted By: jcl

Re: Phantom trade functionality not working - 06/14/21 08:38

This was indeed a bug. It will be fixed in the next beta.
© 2024 lite-C Forums