Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, 7th_zorro, VoroneTZ, Quad), 901 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Unable to load multi-year 1h t6 file #485437
03/10/22 05:17
03/10/22 05:17
Joined: Feb 2022
Posts: 21
T
TrumpLost Offline OP
Newbie
TrumpLost  Offline OP
Newbie
T

Joined: Feb 2022
Posts: 21
I'm having trouble loading my t6 file, it has 1 hour data that I converted from CSV using the CSVtoHistory script. This is my script:
Code
void main() {
    BarPeriod = 60;
    // StartDate = "2011-08-18";
    asset("BTCUSD");
    History = "History\\*_1h.t6";
    set(PLOTNOW);
}

void run() {
    vars Prices = series(price());
}


First I just want to plot my BTC 1hour data, and once I can do that, I want to try some analysis. But I can't even get the price chart to come up. I can't figure out what Zorro wants from me.

Here's Zorro's output when I run the script:
Code
Warning 034: BTCUSD not in asset list
Error 047: BTCUSD no 2017 history (History\BTCUSD.t6)
Error 047: BTCUSD 2017..2022 no data
Error 047: No bars generated
Error 047: No bars to plot


So given this unhelpful error message, I thought I should try setting the StartDate value, which you can see is commented out in my code. If I uncomment and run, Zorro crashes.

I'm a little frustrated. Could somebody tell me what I need to do to tell Zorro to use my t6 file?

Re: Unable to load multi-year 1h t6 file [Re: TrumpLost] #485438
03/10/22 09:51
03/10/22 09:51
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
Normally the .t6 file would be BTCUSD_YYYY.t6 for this asset, but you define it like BTCUSD_1h.t6 in your History setting. Is that file available in your history folder?

Your StartDate syntax is wrong, it should be YYYYMMDD

Code
Warning 034: BTCUSD not in asset list


This isn't an 'unhelpful error message', it means that you need to define BTCUSD in your asset list.

Last edited by Grant; 03/10/22 17:34.
Re: Unable to load multi-year 1h t6 file [Re: TrumpLost] #485441
03/10/22 17:06
03/10/22 17:06
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
Fix the asset list, fix the wrong start date and and set History before loading it and not afterwards.

Re: Unable to load multi-year 1h t6 file [Re: TrumpLost] #485443
03/10/22 18:49
03/10/22 18:49
Joined: Feb 2022
Posts: 21
T
TrumpLost Offline OP
Newbie
TrumpLost  Offline OP
Newbie
T

Joined: Feb 2022
Posts: 21
Okay, thanks for the help folks. I've made the corrections mentioned and it works now.

Here's the updated script:
Code
void main() {
    BarPeriod = 60;
    StartDate = 20110818;
    History = "History\\*_1h.t6";
    asset("BTC/USD");
    set(PLOTNOW);
}

void run() {
    vars Prices = series(price());
}


Note: The following code won't work:
Code
History = "History\\BTCUSD_1h.t6";


Zorro interprets this as `History\BTCUSDBTCUSD_1h.t6`. I guess Zorro demands that the asset name be dynamically prepended to whatever filename I give it.

I haven't seen a tutorial for this elsewhere, so I'd suggest one be added. If I can volunteer to contribute the tutorial, I'm happy to do so. I used Jupyter Notebook to DL the OHLC data from Bitstamp and save to CSV, so I could run it through CSVtoHistory. Is there an easier way to do this? Given that Bitstamp data is JSON format, is formatting to CSV using Pandas the most efficient approach?

Another question: In the CSVtoHistory script, some of the date format strings start with `+-`, and I don't see an explanation for the `-` symbol in the Zorro help docs. I understand that the `+` means ascending order, but what does the `-` mean? Here's an example of one such format string:
Code
// STK line format "12/23/2016,2300.00,SPY, 225.63, 225.68, 225.72, 225.62,1148991"
//string Format = "+-%m/%d/%Y,%H%M,,f3,f4,f1,f2,f6";


Last edited by TrumpLost; 03/10/22 18:51.
Re: Unable to load multi-year 1h t6 file [Re: TrumpLost] #485444
03/10/22 20:39
03/10/22 20:39
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
The History isn't meant to define a specific file name.

https://zorro-project.com/manual/en/script.htm

'-' simply means descending order

Re: Unable to load multi-year 1h t6 file [Re: TrumpLost] #485482
03/16/22 23:30
03/16/22 23:30
Joined: Feb 2022
Posts: 21
T
TrumpLost Offline OP
Newbie
TrumpLost  Offline OP
Newbie
T

Joined: Feb 2022
Posts: 21
So '+-' means either ascending or descending order, "please figure it out"?


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1