2 registered members (Imhotep, opm),
785
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Import data from .csv
#471889
03/23/18 07:31
03/23/18 07:31
|
Joined: Feb 2018
Posts: 236 Italy
tradingest
OP
Member
|
OP
Member
Joined: Feb 2018
Posts: 236
Italy
|
Hi all,
Is it possible to import data withon Zorro through csv file? Convert a .csv in .t6 or .t1 format?
Thanks
Last edited by tradingest; 03/23/18 07:32.
|
|
|
Re: Import data from .csv
[Re: AndrewAMD]
#472126
04/09/18 18:52
04/09/18 18:52
|
Joined: Feb 2018
Posts: 236 Italy
tradingest
OP
Member
|
OP
Member
Joined: Feb 2018
Posts: 236
Italy
|
Hi all, I used the script "CSVtoHistory" but I don't find where the file .t6 is generated. https://unsee.cc/68f1fa14/ Somebody can you help me?
Last edited by tradingest; 04/09/18 19:19.
|
|
|
Re: Import data from .csv
[Re: AndrewAMD]
#472128
04/09/18 19:45
04/09/18 19:45
|
Joined: Feb 2018
Posts: 236 Italy
tradingest
OP
Member
|
OP
Member
Joined: Feb 2018
Posts: 236
Italy
|
I modified the script but I don't see the file .t6 I should see it in History folder hwere is present the .csv file http://prntscr.com/j30yfnCan you help me with an example?
|
|
|
Re: Import data from .csv
[Re: AndrewAMD]
#472332
04/21/18 13:57
04/21/18 13:57
|
Joined: Apr 2018
Posts: 26
Fuchs
Newbie
|
Newbie
Joined: Apr 2018
Posts: 26
|
Ok, I got just one step further, but am stuck with it. For any other beginner, like me, I tell you what I did so far: 1. Open the history folder and dump in a csv file from http://www.histdata.com2. Edited the CSVtoHistory script to the name of my CSV file, and renamed string OutName = "testConversion.t6"; 3. Run the script - all was good and I see the file "testConversion.t6" in the history folder. But now I am stuck, because if I run any strategy (whether Z or workshop 4), I can not select the testConversion file from the pulldown menu to the right of the strategy. (btw, I also can not find the selection for the default generated original "USDZAR_2015.t6" file, so it seems not to be the choice of my file, but a general preselection feature I don't know how to deal with.) any help anyone ?
Last edited by Fuchs; 04/23/18 22:18.
|
|
|
Re: Import data from .csv
[Re: jcl]
#472606
05/07/18 22:38
05/07/18 22:38
|
Joined: Apr 2018
Posts: 26
Fuchs
Newbie
|
Newbie
Joined: Apr 2018
Posts: 26
|
Thanks jcl (not only for your answers but for the strategies in general). Because nothing happened last week until the weekend I thought that nothing is lost in checking what happens when I restart my laptop and yes, it all started from scratch again. So far I read the main topics and programming instructions of the manual and checked http://zorro-project.com/manual/en/zsystems.htm . I figured out that Z12 for example brings up some errors when trading with a demo account with global prime, which I first did set up with a leverage of only 1 (to simulate a cautious first trading). So I have to learn more about them, because my suspicion is that Z8 needs a leverage of at least 2 and Z1,2 or 12 (and maybe also the others) a leverage of at least 200. Someone told me NOT to play around with those leverages because it could be dangerous, so I won't, and whilst I experience how to run your Z strategies I of course will learn to write my own one. Is there some more information to be found on the strategies, the meaning of the errors, and what happens in case a broker doesn't provide all currencies normally used by a strategy ?
|
|
|
Re: Import data from .csv
[Re: tradingest]
#473036
06/11/18 00:27
06/11/18 00:27
|
Joined: Jun 2018
Posts: 3
madeinquant
Guest
|
Guest
Joined: Jun 2018
Posts: 3
|
There is a customized script "CSVtoHistory.c" for your reference. this is a customized script to import yahoo's CSV and to convert into .t6 file. However, I don't know how to retrieve the .t6 file for conversion. I would convert .t6 file into artificial option chains. There is a script "OptionSimulate.c" but this script import historical data from quandl. I want to import SP500 historical data locally. Please feel free to comment.
//////////////////////////////////////////////// // Convert price history from .csv to .t6 // The Format string determines the CSV format (see examples) ////////////////////////////////////////////////
// #define SPLIT_YEARS // split into separate years //#define FIX_ZONE -1 // add a time zone difference, f.i. for converting CST -> EST
//string InName = "DAT_ASCII_USDZAR_M1_2015.csv"; // name of a single year CSV file //string OutName = "USDZAR_2015.t6"; //string InName = "D:HistoryVIX_2013_2016.stk"; //string OutName = "VIX"; // for separate years, f.i. VIX_2016.t6, VIX_2015.t6 etc. string InName = "GSPC.CSV"; string OutName = "GSPC.t6"; // for separate years, f.i. VIX_2016.t6, VIX_2015.t6 etc.
// HISTDATA line format: "20100103 170000;1.430100;1.430400;1.430100;1.430400;0" //string Format = "+%Y%m%d %H%M%S;f3;f1;f2;f4;f6;f";
// YAHOO line format "2015-05-29,43.45,43.59,42.81,42.94,10901500,42.94" string Format = "%Y-%m-%d,f3,f1,f2,f4,f6,f5"; // unadjusted
// TRADESTATION line format "06/30/2016,17:00:00,2086.50,2086.50,2086.50,2086.50,319,0" //string Format = "+%m/%d/%Y,%H:%M:%S,f3,f1,f2,f4,f6,f5";
// 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,f";
function main() { int Records = dataParse(1,Format,InName); printf("n%d lines read",Records); #ifdef FIX_ZONE int i; for(i=0; i<Records; i++) dataSet(1,i,0,dataVar(1,i,0)+FIX_ZONE/24.); #endif #ifndef SPLIT_YEARS if(Records) dataSave(1,OutName); #else int i, Start = 0, Year, LastYear = 0; for(i=0; i<Records; i++) { Year = atoi(strdate("%Y",dataVar(1,i,0))); if(!LastYear) LastYear = Year; if(i == Records-1) { // end of file LastYear = Year; Year = 0; } if(Year != LastYear) { string NewName = strf("%s_%4i.t6",strxc(OutName,'.',0),LastYear); printf("n%s",NewName); dataSave(1,NewName,Start,i-Start); Start = i; LastYear = Year; } } #endif }
|
|
|
|