|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IHistory
The IHistory
interface represents API for historical data access.
Method Summary | |
---|---|
IBar |
getBar(Instrument instrument,
Period period,
OfferSide side,
int shift)
Returns bar for specified instrument, period and side, that is shifted back in time for number in bars specified in shift
parameter, 0 - current bar (currently generated from ticks), 1 - previous bar (last formed bar) If there is no bar loaded at that
position, then function returns null. |
List<IBar> |
getBars(Instrument instrument,
Period period,
OfferSide side,
long from,
long to)
Returns bars for specified instrument, period and side. |
long |
getBarStart(Period period,
long time)
Returns starting time of the bar that includes time specified in time parameter |
ITick |
getLastTick(Instrument instrument)
Returns last tick for specified instrument |
long |
getNextBarStart(Period period,
long barTime)
Returns starting time of the bar next to the bar that includes time specified in barTime parameter |
long |
getPreviousBarStart(Period period,
long barTime)
Returns starting time of the bar previous to the bar that includes time specified in barTime parameter |
long |
getStartTimeOfCurrentBar(Instrument instrument,
Period period)
Returns starting time of the current bar (bar currently generated from ticks) for specified instrument and period. |
List<ITick> |
getTicks(Instrument instrument,
long from,
long to)
Returns ticks for specified instrument and time interval. |
long |
getTimeForNBarsBack(Period period,
long to,
int numberOfBars)
Returns starting time of the bar that is numberOfBars - 1 back in time to the bar that includes time specified in
to parameter. |
long |
getTimeForNBarsForward(Period period,
long from,
int numberOfBars)
Returns starting time of the bar that is + numberOfBars - 1 in the future to the bar that includes time specified in
from parameter. |
long |
getTimeOfLastTick(Instrument instrument)
Returns time of last tick received for specified instrument. |
void |
readBars(Instrument instrument,
Period period,
OfferSide side,
long from,
long to,
LoadingDataListener barListener,
LoadingProgressListener loadingProgress)
Reads bars from the local cache in the background. |
void |
readTicks(Instrument instrument,
long from,
long to,
LoadingDataListener tickListener,
LoadingProgressListener loadingProgress)
Reads ticks from the local cache in the background. |
Method Detail |
---|
long getTimeOfLastTick(Instrument instrument) throws JFException
instrument
- instrument of the tick
JFException
- when instrument is not active (not opened in platform)ITick getLastTick(Instrument instrument) throws JFException
instrument
- instrument of the tick
JFException
- when instrument is not active (not opened in platform)long getStartTimeOfCurrentBar(Instrument instrument, Period period) throws JFException
instrument
- instrument of the barperiod
- period of the bar
JFException
- when period is not supported or instrument is not active (not opened in platform)IBar getBar(Instrument instrument, Period period, OfferSide side, int shift) throws JFException
shift
parameter, 0 - current bar (currently generated from ticks), 1 - previous bar (last formed bar) If there is no bar loaded at that
position, then function returns null.
instrument
- instrument of the barperiod
- period of the barside
- bid or ask side of the barshift
- number of candle back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so on
JFException
- when period is not supported or instrument is not active (not opened in platform)void readTicks(Instrument instrument, long from, long to, LoadingDataListener tickListener, LoadingProgressListener loadingProgress) throws JFException
tickListener
. LoadingProgressListener is
used to receive feedback about loading progress, to cancel loading and its method
LoadingProgressListener.loadingFinished(boolean, long, long, long)
is called when loading is finished or as a result of error.
This method has two main purposes: one is to load a lot of ticks without keeping them all in memory, and second is asynchronous processing
instrument
- instrument of the ticksfrom
- start of the time interval for which ticks should be loadedto
- end time of the time interval for which ticks should be loaded. If there is tick with time equals to the time in to
parameter then it will be loaded as welltickListener
- receives data about requested ticksloadingProgress
- used to control loading process
JFException
- when some error occurs while creating internal request for datavoid readBars(Instrument instrument, Period period, OfferSide side, long from, long to, LoadingDataListener barListener, LoadingProgressListener loadingProgress) throws JFException
barListener
. LoadingProgressListener is
used to receive feedback about loading progress, to cancel loading and its method
LoadingProgressListener.loadingFinished(boolean, long, long, long)
is called when loading is finished or as a result of error
This method has two main purposes: one is to load a lot of bars without keeping them all in memory, and second is asynchronous processing
instrument
- instrument of the barsperiod
- period of the barsside
- side of the barsfrom
- start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
See getBarStart(Period, long)
description if you want to get bar starting time for bar that includes specific timeto
- end time of the time interval for which bars should be loaded. This is the starting time of the last bar to be loadedbarListener
- receives data about requested barsloadingProgress
- used to control loading progress
JFException
- when period is not supported or time interval is not valid for specified periodgetBarStart(Period, long)
List<ITick> getTicks(Instrument instrument, long from, long to) throws JFException
OutOfMemoryException
instrument
- instrument of the ticksfrom
- start of the time interval for which ticks should be loadedto
- end time of the time interval for which ticks should be loaded. If there is tick with time equals to the time in to
parameter then it will be loaded as well
JFException
- when some error occurs when loading dataList<IBar> getBars(Instrument instrument, Period period, OfferSide side, long from, long to) throws JFException
OutOfMemoryException
instrument
- instrument of the barsperiod
- period of the barsside
- side of the barsfrom
- start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
See getBarStart(Period, long)
description if you want to get bar starting time for candle that includes specific timeto
- end time of the time interval for which bars should be loaded. This is the starting time of the last candle to be loaded
JFException
- when period is not supported or some error occurs when loading datalong getBarStart(Period period, long time) throws JFException
time
parameter
period
- period of the bartime
- time that is included by the bar
JFException
- when period is not supportedlong getNextBarStart(Period period, long barTime) throws JFException
barTime
parameter
period
- period of the barbarTime
- time that is included by the bar previous to the returned
JFException
- when period is not supportedlong getPreviousBarStart(Period period, long barTime) throws JFException
barTime
parameter
period
- period to the barbarTime
- time that is included by the bar next to the returned
JFException
- when period is not supportedlong getTimeForNBarsBack(Period period, long to, int numberOfBars) throws JFException
numberOfBars - 1
back in time to the bar that includes time specified in
to
parameter. Method can be used to get time for the from
parameter for getBars(com.dukascopy.api.Instrument, com.dukascopy.api.Period, com.dukascopy.api.OfferSide, long, long)
method when is known time of the last bar and number of candles that needs to be loaded
period
- period of the barsto
- time of the last barnumberOfBars
- number of bars that could be loaded when passing returned time and time specified in to
parameter in
getBars(com.dukascopy.api.Instrument, com.dukascopy.api.Period, com.dukascopy.api.OfferSide, long, long)
method
JFException
- when period is not supportedlong getTimeForNBarsForward(Period period, long from, int numberOfBars) throws JFException
numberOfBars - 1
in the future to the bar that includes time specified in
from
parameter. Method can be used to get time for the to
parameter for getBars(com.dukascopy.api.Instrument, com.dukascopy.api.Period, com.dukascopy.api.OfferSide, long, long)
method when is known time of the first bar and number of candles that needs to be loaded
period
- period of the barsfrom
- time of the first barnumberOfBars
- number of bars that could be loaded when passing returned time and time specified in from
parameter in
getBars(com.dukascopy.api.Instrument, com.dukascopy.api.Period, com.dukascopy.api.OfferSide, long, long)
method
JFException
- when period is not supported
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |