Dukascopy
 
 
Wiki JStore Search Login

Write ticks in csv
 Post subject: Write ticks in csv Post rating: 0   New post Posted: Mon 08 Jul, 2013, 23:47 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
Hello Support:-

can you show me the modifications required to:-

1) have the date and time stamp showing GMT rather than local PC time
2) add in volume data

Many thanks

Bob M


 
 Post subject: Re: Write ticks in csv Post rating: 0   New post Posted: Tue 09 Jul, 2013, 11:56 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
1)
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HHmmss");  // or whatever format you prefer
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));

sdf.format(new Date()) will now generate the date string in GMT timezone.

2)
ticks don't have volume, only bars. So you have to extend the onBar() function, and call the corresponding bidBar.getVolume() or askBar.getVolume().


I suggest to post Automated Trading related posts in the proper section (Automated Trading->Knowledgebase). This topic has nothing to do with Strategy Contest (or not directly). There you have better chances of getting replies in such manners...


 
 Post subject: Re: Write ticks in csv Post rating: 0   New post Posted: Tue 09 Jul, 2013, 22:13 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
It seems I was wrong about tick volume information. As there are indeed volume data for ticks.

Take a look on tick.getAskVolume() and tick.getBidVolume() functions in the onTick() function. Just modify the given wiki example for tick to .csv, and add these 2 extra functions.


 
 Post subject: Re: Write ticks in csv Post rating: 0   New post Posted: Tue 09 Jul, 2013, 23:27 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
Hi tcsabina

All is well now!

I have the .csv file with the output I am seeking

Thanks for your patience

Bob M


 

Jump to:  

  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com