Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 470 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 6 of 10 1 2 4 5 6 7 8 9 10
Re: New Zorro version 2.30 [Re: jcl] #481073
08/05/20 12:17
08/05/20 12:17
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
To answer the second question: TMF parameters are for numbers only. They are stored in floats and cannot hold a DATE variable in full precision.

Re: New Zorro version 2.30 [Re: jcl] #481076
08/05/20 15:30
08/05/20 15:30
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
The manual says otherwise:
Quote
If the TMF is passed to an enter command, it can receive up to 8 additional var parameters following the function name: enterLong(MyTMF, parameter1, parameter2...). They must also appear in the function's parameter list and keep their values during the lifetime of the trade. The global manage function has no parameters.
Also, 2-minute difference is 0.00138888. If there is any rounding involved internally, downcasting a var to a float, this shouldn't cause difference up in the 3-rd significant digit.

Re: New Zorro version 2.30 [Re: jcl] #481077
08/05/20 15:44
08/05/20 15:44
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
var are being cast to float here.

It is about 44046 days since January 1, 1900, so your date value of 44046.00138888 vs 44046.00000000 requires more significant digits than you suggest.

Re: New Zorro version 2.30 [Re: jcl] #481079
08/05/20 17:58
08/05/20 17:58
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
I meant 3rd decimal digit, sorry.

But this line:
Quote
print(TO_LOG,"\n wdate as var=%.7f, wdate in float=%.7f, %s", wdate(0), (var)(float)wdate(0), strdate(HMS,(var)(float)wdate(0) ) );
when run in lite-C indeed shows 1:52 min difference after downcasting, but in C++ both values are exactly the same.

The difference is quite significant, how come?

Re: New Zorro version 2.30 [Re: jcl] #481081
08/05/20 18:40
08/05/20 18:40
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Maybe your recast is incomplete in C++? Declare and initialize a float to the value, and use that instead. Then your floating precision should actually decay.

Also, significant figures are quite relevant:
https://www.geeksforgeeks.org/difference-float-double-c-cpp/
Quote
float is a 32 bit IEEE 754 single precision Floating Point Number (1 bit for the sign, 8 bits for the exponent, and 23* for the value), i.e. float has 7 decimal digits of precision.

double is a 64 bit IEEE 754 double precision Floating Point Number (1 bit for the sign, 11 bits for the exponent, and 52* bits for the value), i.e. double has 15 decimal digits of precision.

Re: New Zorro version 2.30 [Re: jcl] #481083
08/05/20 19:47
08/05/20 19:47
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
If I declare and initialize a var to a value, and then recast to float and back, I indeed see the difference. Why doesn't it happen if recasting the result of wdate()?

Re: New Zorro version 2.30 [Re: jcl] #481085
08/05/20 21:28
08/05/20 21:28
Joined: Mar 2018
Posts: 62
hast29 Offline
Junior Member
hast29  Offline
Junior Member

Joined: Mar 2018
Posts: 62
Hi,

is the 2.30.3 release considered to update the running Z Strategies and their parameters?

If yes, the Z7 strategy has some new PDD algorithm, which behaves strange.

This algorithm has opened and saved into „trades.csv“ long and short trades at the same minute bar with the same asset. It happened several times during the back test.

Attached Files hedge.png
Re: New Zorro version 2.30 [Re: jcl] #481086
08/06/20 08:03
08/06/20 08:03
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
-Z7 behaves strange: it now trades 2 PDD variants with different patterns. But they should normally not trade against each other. We'll look into that.

-Zheka's TMF entered at wrong price: Caused by setting an entry stop, but entering via TMF. Set TradeEntryLimit to 0 before returning 2. This will be fixed in the next update.

Re: New Zorro version 2.30 [Re: jcl] #481096
08/06/20 14:09
08/06/20 14:09
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
Originally Posted by jcl
Caused by setting an entry stop, but entering via TMF
Its pretty normal to have some initial Entry, but modified later in a tmf.
I actually needed a 'bracket' order, setting a limit via Entry and then adding a stop in a tmf. Which led to some 'great results' in backtesting, but failed in live.
Would be great if Zorro had a bracket order functionality out of the box.
Quote
This will be fixed in the next update
You mean the entry price will be correct and not 1-tick earlier (without having to set TradeEntryLimit=0 before that)?

Last edited by Zheka; 08/06/20 14:20.
Re: New Zorro version 2.30 [Re: jcl] #481100
08/06/20 16:11
08/06/20 16:11
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
No, I meant that you can then have an entry limit and enter via TMF at the same time. Modifying limits or bracket orders have nothing to do with that.

Page 6 of 10 1 2 4 5 6 7 8 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