6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood),
1,268
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Processing Tick data for zorro strategy
#474708
10/31/18 11:30
10/31/18 11:30
|
Joined: Sep 2018
Posts: 8
adityam
OP
Newbie
|
OP
Newbie
Joined: Sep 2018
Posts: 8
|
Hello, I have written a strategy using 1-minute OHLC data (date,time,open,high,low,close,volume). However, I am unable to code the same strategy on a tick-by-tick data (date,time,tradedPrice,volume). I am trying to play with barPeriod values e.g. 1./60 but the program is asking for the t1 file instead of a t6 file. The document says that lesser than 1 minute is processed by t1 file however also mentions using barPeroid < 1 for lower intervals. afaik t1 is used for ask/bid spread analysis. Is there a place I can refer for this to understand fully how to work with tick data? Thanks
|
|
|
Re: Processing Tick data for zorro strategy
[Re: jcl]
#474768
11/05/18 09:40
11/05/18 09:40
|
Joined: Sep 2018
Posts: 8
adityam
OP
Newbie
|
OP
Newbie
Joined: Sep 2018
Posts: 8
|
Thanks for input. Is there a sample in zorro scripts that can help getting a t1 from a csv file (format: date-yyyymmdd, time-hh:mm:ss, price, vol) e.g. (20180917,15:29:59,11396.05,375)? There was an available script to help convert a csv to t6 however i couldn't find one for t1. Any help with this is appreciated.
Thanks
Last edited by adityam; 11/05/18 09:41.
|
|
|
Re: Processing Tick data for zorro strategy
[Re: adityam]
#474780
11/05/18 15:43
11/05/18 15:43
|
Joined: Jul 2000
Posts: 27,986 Frankfurt
jcl
Chief Engineer
|
Chief Engineer
Joined: Jul 2000
Posts: 27,986
Frankfurt
|
The script is different for any CSV, but here's a more complex example for bitcoin prices:
void main()
{
string Format = "+0,,,%t,f,f,s";
int Records = dataParse(1,Format,"History\BTCEUR.csv");
printf("n%d records read",Records);
// now convert it to t1 and change sign for sell quotes
for(i=0; i<Records; i++) {
T1* t1 = dataAppendRow(2,2);
t1->time = dataVar(1,i,0);
t1->fVal = dataVar(1,i,1);
string sell = dataStr(1,i,3);
if(sell[0] == 't') t1->fVal = -t1->fVal;
// display progress bar and check [Stop] button
if(!progress(100*i/Records,0)) break;
}
if(Records) dataSave(2,"History\BTCEUR.t1");
}
|
|
|
Re: Processing Tick data for zorro strategy
[Re: jcl]
#474897
11/12/18 06:40
11/12/18 06:40
|
Joined: Sep 2018
Posts: 8
adityam
OP
Newbie
|
OP
Newbie
Joined: Sep 2018
Posts: 8
|
Thanks for this information. I still cannot process the data that i have with the t6 file. The problem i have is as below. Input csv file is of format (date, time, tradedPrice, volume) e.g. 20180917,15:30:00,11395.1,300 however when i use csvToHistory.c script with following string format string Format = "%Y%m%d,%H:%M:%S,f4,f6"; I get error Error 062: No 7 records in C:UsersAdministratorZorroHistoryNIFTY_I_TICK_2018.t6 Can't open C:UsersAdministratorZorroHistoryNIFTY_I_TICK_2018.t6
T6 file needs all 7 entries date, time, open, high, low, close, volume etc. And if i use following format string: string Format = "+%Y%m%d,%H:%M:%S,f3,f1,f2,f4,f6,f5"; Assuming the open (f3) and high (f1) would contain price and volume respectively and trying to use priceOpen() and priceHigh() to print the price and vol values results zero for both. How do i then use csvToHistory script to process the csv file of above format and use it in my script?
Thanks
Last edited by adityam; 11/12/18 07:56.
|
|
|
|