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 (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 10 1 2 3 4 9 10
Re: New Zorro version 2.30 [Re: jcl] #480891
07/22/20 10:03
07/22/20 10:03
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
Bug#2:
The manual states:

for(last_trades)
Quote
A for loop that cycles backwards through open, pending, and closed trades with the current asset and algo, starting with the last trade

The provided log shows that it delivers not only "open, pending and closed" trades but also some missed, 'invalid' trades (that are neither) - which - as YOU WROTE - Zorro is not even supposed to store!

Right now, to achieve their stated objective, does one have to write

for(last_trades)
if (TradeIsPending or TradeIsOpen or TradeIsClosed)
.....
???

The same issue is with for(all_trades) and for(past_trades).

I do not believe you meant (and there is any valid purpose) delivering such 'invalid' trades with these macros.

So, let's just make them actually do what they are supposed to.


This is a bug and it is in v 2.30.

Re: New Zorro version 2.30 [Re: jcl] #480893
07/22/20 12:21
07/22/20 12:21
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Ok, I'll improve the wording in the manual. Next posts in this thread please only about real issues with 2.30. Thank you.

Re: New Zorro version 2.30 [Re: jcl] #480894
07/22/20 13:01
07/22/20 13:01
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
Why not just fix the macros?

Re: New Zorro version 2.30 [Re: jcl] #480897
07/22/20 13:40
07/22/20 13:40
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
You mean filtering the trades already in the macro? That could break existing scripts.

Re: New Zorro version 2.30 [Re: jcl] #480899
07/22/20 14:09
07/22/20 14:09
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
The macros should deliver only 'real' trades - either pending, open or closed. Without **trades** 'attempted' with Entry but missed.
Bug#2.5
With this bug all functions currently using these macros (like plotTradeProfile(), plotMAEGraph(), etc, possibly results() ) return results with artifacts, processing 'trades' with zero profit/mae/mfe, but counting such as 'trades' .
Code
for(all_trades) 
		{
			var vResult = toPIP(TradeResult);
			var vMAE = TradeMAE/PIP/vStep;
			int n = floor(vMAE);
			plotBar("Profit",n,n*vStep,0,AVG|BARS|LBL2,COLOR_PROFIT);
			if(vResult > 0)
				plotGraph("Win",vMAE,vResult,DOT,GREEN);
			else
				plotGraph("Loss",vMAE,vResult,DOT,RED);
		}



So, either really do not preserve such **trades" (as you confirmed), or make for(..._trades) macros skip those.

Re: New Zorro version 2.30 [Re: jcl] #480907
07/22/20 17:08
07/22/20 17:08
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Indeed. It made probably not much difference, but an if(TradeIsClosed) should be in the plotMAE functions - this will be corrected. It is really a bug.

Re: New Zorro version 2.30 [Re: jcl] #480918
07/24/20 10:19
07/24/20 10:19
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
But what about the macros delivering ONLY REAL trades as intended?

What the use case for getting *attempted but missed* orders (that have no internal status anyway)??

Last edited by Zheka; 07/24/20 10:20.
Re: New Zorro version 2.30 [Re: jcl] #480924
07/24/20 13:52
07/24/20 13:52
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
That will be unchanged.

Re: New Zorro version 2.30 [Re: jcl] #480927
07/24/20 15:32
07/24/20 15:32
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
Bug#3:
results() does not work correctly:
Code
function run()
{
	BarPeriod = 60; 
		
	StartDate = 2019; 
	EndDate   = 2020;
	
	
	asset("EUR/USD");
	
	var atr = ATR(24);
	
	LifeTime=4;
	
	Entry = -0.5*atr;
	
	if (lhour(ET,0)==15)
		enterLong();
	
	if ( (NumWinTotal+NumLossTotal)==30 )
	{
		var NumWins = results(1+24,30);	// Number of winning and won trades
		var NumLosses = results(1+4+24,30);	// Number of losing and lost trades

		var pipWins = results(2+24,30)/PIP;	   // Total win in pips
		var pipLosses = results(2+4+24,30)/PIP;	// /PIPTotal loss in pips
		
		print(TO_LOG,"\n NumWins=%i, NumLosses=%i, resNumWins=%.0f, resNumLosses=%.0f, pipWins=%.2f, pipLosses=%.2f", NumWinTotal,NumLossTotal,NumWins,NumLosses,pipWins,pipLosses);
		
	}
} 
prints:
Quote
[2825: Thu 19-06-20 00:00] 3.15 -0.60 15/15 (1.12358)
[EUR/USD::L82129] Expired 1@1.12359: -0.59
[2826: Thu 19-06-20 01:00] 2.56 0 15/15 (1.12575)
NumWins=15, NumLosses=15, resNumWins=6, resNumLosses=24, pipWins=52.45, pipLosses=213003.51



Last edited by Zheka; 07/27/20 20:15.
Re: New Zorro version 2.30 [Re: jcl] #480951
07/27/20 09:55
07/27/20 09:55
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
What is wrong in which way?

Page 2 of 10 1 2 3 4 9 10

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