Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Write candles to CSV file
 Post subject: Write candles to CSV file Post rating: 0   Post Posted: Thu 01 Sep, 2011, 16:55 

User rating: 0
Joined: Wed 15 Jun, 2011, 00:55
Posts: 21
Location: AustraliaAustralia
Thankyou. This is very useful! Is it possible to customize the timeframe for the data export?

https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=31&t=28225


 
 Post subject: Re: Write candles to CSV file Post rating: 0   Post Posted: Fri 02 Sep, 2011, 09:25 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Consider adding a new parameter:
   @Configurable("Period")
   public Period selectedPeriod = Period.TEN_SECS;
And changing the onBar method content to the following:
      if (instrument.equals(selectedInstrument) && period.equals(selectedPeriod)) {
          try {
              out.append( sdf2.format(askBar.getTime()) + ";" + ((askBar.getClose() + bidBar.getClose() )/2) + "\n");
           } catch (IOException e) {
              writeMessage("File write error " );
              e.printStackTrace();
           }
      }


 

Jump to:  

cron
  © 1998-2025 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