Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 735 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
TRAINMODE and history length #470178
01/01/18 15:18
01/01/18 15:18
Joined: Jul 2016
Posts: 51
H
hatten Offline OP
Junior Member
hatten  Offline OP
Junior Member
H

Joined: Jul 2016
Posts: 51
I have to issues that I have been unable to resolve myself:

1. It would be valuable to have access to the length of the history of each asset downloaded. When running assetHistory the number of bars is printed in the zorro panel, but can this value be retrieved or stored for use in the program? If so, how?

2. The Z8/Z9 strategy has a useful function incorporated. When pressing the train button key asset values are printed in the zorro window and a correlation chart is plotted. I would love to use the possibility of triggering such output functions when pressing the train button, but I have been unsuccesful to accomplish this by simply verifying with

if (is(TRAINMODE)) printf("...

or

if (is(TRAINMODE) && is(EXITRUN)) printf("...

So what needs to be done? Do I need to donwload the asset history again and calculate whatever I wish to print?

Thanks for any help.

Re: TRAINMODE and history length [Re: hatten] #470182
01/01/18 17:09
01/01/18 17:09
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I think you get the bars only by opening the .t6 dataset. The idea with the trainmode was correct, only printf does not print in training mode.

Re: TRAINMODE and history length [Re: jcl] #470185
01/01/18 20:33
01/01/18 20:33
Joined: Jul 2016
Posts: 51
H
hatten Offline OP
Junior Member
hatten  Offline OP
Junior Member
H

Joined: Jul 2016
Posts: 51
Well, then how do I print something in the zorro window during train mode. The Z8 and Z9 strategies succeed in doing so! Basically my question remains unanswered.

Re: TRAINMODE and history length [Re: hatten] #470187
01/01/18 21:16
01/01/18 21:16
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
The manual mentions +TRAINMODE to print also in train mode.
Rather than printf, you would use print. For example to print to window, log file, and in train mode:

Code:
print(TO_WINDOW+TRAINMODE,"<br>Low volatility - ATR30 = %.3f",ATR(30));



You could also use TO_ANY for short:

Code:
print(TO_ANY,"<br>Low volatility - ATR30 = %.3f",ATR(30));



More details here
http://manual.zorro-trader.com/printf.htm

Re: TRAINMODE and history length [Re: Dalla] #470188
01/01/18 21:36
01/01/18 21:36
Joined: Jul 2016
Posts: 51
H
hatten Offline OP
Junior Member
hatten  Offline OP
Junior Member
H

Joined: Jul 2016
Posts: 51
Excellent. Thank you.

Re: TRAINMODE and history length [Re: hatten] #470283
01/06/18 19:04
01/06/18 19:04
Joined: Jul 2016
Posts: 51
H
hatten Offline OP
Junior Member
hatten  Offline OP
Junior Member
H

Joined: Jul 2016
Posts: 51
Just in case anyone cares. I solved my question on how to retrieve the length of the history of an asset in the following fashion assuming the filename is contained in the string tempname:

string tempname = "History\<asset>.t6";
int HAsset;
HAsset = dataLoad(1,tempname,7);

Really simple, but it takes some reading in the manual to figure it out.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1