Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by 7th_zorro. 04/16/24 13:19
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
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (rki, Ayumi), 475 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
read asset price history directly from CSV? #468089
09/18/17 08:43
09/18/17 08:43
Joined: Feb 2017
Posts: 20
G
Gloria Offline OP
Newbie
Gloria  Offline OP
Newbie
G

Joined: Feb 2017
Posts: 20
Hi,

I wonder whether I can read an asset's price history directly from a CSV file. The point is to avoid first converting from CSV to .t6 and instead directly feed a CSV into a series(..) array.

The context of my question is the following. My strategy trades a futures contract on minute bars. The current contract changes once every three months.

But I want to use the 200-day (> 3 months) moving average in my strategy. Therefore, some external program that I already have, concatenates the various futures contracts according to some roll schedule and provides a single time series in CSV format. From this time series, I'd like to compute the 200-day moving average on which my strategy depends.

From what I have read so far, I'd guess the best way of dealing with this issue in Zorro would be to base the strategy on two assets:
+ the current futures contract on minute bars that is traded
+ the coninuous daily time series read in from the CSV file that has no life ticks and that is not traded

So my question is how can I set up an asset(..) with history(..) in my run() function that gets the external daily CSV time series directly into a series(...)?

Thank you in advance for your help. Kind regards,

Gloria

Re: read asset price history directly from CSV? [Re: Gloria] #468098
09/18/17 11:24
09/18/17 11:24
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I would either scan the CSV file directly f.i. with the file_content function, or use the dataParse function for parsing it into a dataset.

Re: read asset price history directly from CSV? [Re: jcl] #468130
09/19/17 13:28
09/19/17 13:28
Joined: Feb 2017
Posts: 20
G
Gloria Offline OP
Newbie
Gloria  Offline OP
Newbie
G

Joined: Feb 2017
Posts: 20
Thanks, I figured out how to read the data into a dataset.

Is there any way I can run a Zorro strategy with two different assets whose historical data have different bar periods? (i.e. the current contract with minute bars and an external time series with daily bars) Is that explained anywhere in the manual or in the forum? If yes, I would simply put my CSV time series into a separate asset and could apply the usual indicators. If not, is there any way of working with the dataset that avoids re-implementing all the indicators?

Kind regards and thanks for your help.

Gloria


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