Gamestudio Links
Zorro Links
Newest Posts
How is this possible ? winning percentage 100%
by chsmac85
Today at 14:15
Asset capacity
by tuuPaul
Today at 13:48
New Zorro version 1.96
by jcl
Today at 13:13
Next contest?
by Michael_Schwarz
Today at 10:33
Help! 1.88.6 Crashes <5 minutes after clicking Trade!
by jcl
Today at 10:28
WFO
by jcl
Today at 10:27
TA-Lib not updated
by jcl
Today at 10:24
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
16 registered (Ayumi, MatPed, alibaba, kvm, chsmac85, KadigunFx, CocaCola, HellThunder, 3 invisible), 462 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
fandi, Deedee, avgtrader, aventador, gokhanuck
18103 Registered Users
Page 1 of 2 1 2 >
Topic Options
Rate This Topic
#474708 - 10/31/18 12:30 Processing Tick data for zorro strategy
adityam Offline
Newbie

Registered: 09/27/18
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

Top
#474725 - 11/01/18 14:02 Re: Processing Tick data for zorro strategy [Re: adityam]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26597
Loc: Frankfurt
Yes, for a 1-second bar periods you'll need history in .t1 format. .t6 files contain candles and are not suited for small bar periods.

Top
#474768 - 11/05/18 10:40 Re: Processing Tick data for zorro strategy [Re: jcl]
adityam Offline
Newbie

Registered: 09/27/18
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


Edited by adityam (11/05/18 10:41)

Top
#474780 - 11/05/18 16:43 Re: Processing Tick data for zorro strategy [Re: adityam]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26597
Loc: Frankfurt
The script is different for any CSV, but here's a more complex example for bitcoin prices:

Code:
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");
}


Top
#474803 - 11/06/18 09:11 Re: Processing Tick data for zorro strategy [Re: jcl]
adityam Offline
Newbie

Registered: 09/27/18
Posts: 8
Just to be sure if T1 format is the right format for this usecase.
typedef struct T1
{
DATE time; // time stamp, GMT
float fVal; // positive for ask, negative for bid
} T1; // single-stream tick, .t1 file content

T1 format has these 2 values i.e time and fVal where fVal is ask or bid price, however the format that i have in csv has (date, time, tradedPrice, volume) and T1 format doesn't seem to handle it. How would T1 handle this format then?

Top
#474804 - 11/06/18 10:08 Re: Processing Tick data for zorro strategy [Re: adityam]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26597
Loc: Frankfurt
T1 does not contain volume. If you want volume, you must indeed use a .t6 file. You can then ignore the warning message that .t1 is recommended.

Top
#474897 - 11/12/18 07:40 Re: Processing Tick data for zorro strategy [Re: jcl]
adityam Offline
Newbie

Registered: 09/27/18
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


Edited by adityam (11/12/18 08:56)

Top
#474942 - 11/14/18 13:56 Re: Processing Tick data for zorro strategy [Re: adityam]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26597
Loc: Frankfurt
Look into the resulting t6 file with the History script or the ZHistoryEditor. Then you see which fields are wrong, and can fix the format string accordingly.

Top
#474958 - 11/15/18 04:40 Re: Processing Tick data for zorro strategy [Re: jcl]
adityam Offline
Newbie

Registered: 09/27/18
Posts: 8
Thanks Jcl,
As mentioned in previous comment, the t6 file look ok to me. It has proper time and open, high fields populated and rest are zero. However when i try to get these values from script using priceOpen() it doesnt return the values displayed in t6 files but zero.

Output of t6 file from history script is as below:

Date Open High Low Close Val Vol
18-09-17 09:15 11481 3450.0 0.0 0.0 0.0 0

In my script i use:
var Open = priceOpen();
var High = priceHigh();
to get these values but it returns zero instead of 11481 and 3450.0

Anything else that i can try to figure out the issue?

Top
#474964 - 11/15/18 10:57 Re: Processing Tick data for zorro strategy [Re: adityam]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26597
Loc: Frankfurt
That's not a valid OHLC file. The Open can not be higher than the High, nor can Low and Close be zero.

Top
Page 1 of 2 1 2 >



Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de