Dukascopy
 
 
Wiki JStore Search Login

JFOREX-3169 history.getStartTimeOfCurrentBar wrong time
 Post subject: JFOREX-3169 history.getStartTimeOfCurrentBar wrong time Post rating: 0   New post Posted: Mon 29 Aug, 2011, 17:48 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
history.getStartTimeOfCurrentBar returns the wrong time, if the the time of the current tick (ITick.getTime() ) is exactly on the first millisecond of the new bar.

Example:
Instrument USD/JPY, ITick.getTime()= 'Mon 2011.06.06 08:00:00.000' [1307347200000]
history.getStartTimeOfCurrentBar(Instrument.USDJPY, Period.FOUR_HOURS) returns 'Mon 2011.06.06 04:00:00.000' [1307332800000]
instead of 'Mon 2011.06.06 08:00:00.000'

Best, RR.


 
 Post subject: Re: JFOREX-3169 history.getStartTimeOfCurrentBar wrong time Post rating: 0   New post Posted: Wed 31 Aug, 2011, 11:02 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Was the tick being taken by a strategy.onTick(Instrument instrument, ITick tick) method?
When the history.getStartTimeOfCurrentBar(Instrument.USDJPY, Period.FOUR_HOURS) was invoked? Was it called directly from "strategy.onTick()" method?


 
 Post subject: Re: JFOREX-3169 history.getStartTimeOfCurrentBar wrong time Post rating: 0   New post Posted: Thu 01 Sep, 2011, 14:22 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
yes, it was called from within the strategy.onTick(Instrument instrument, ITick tick) method.


 

Jump to:  

  © 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