public interface IDataService
| Modifier and Type | Method and Description |
|---|---|
void |
addDailyHighLowListener(Instrument instrument,
IDailyHighLowListener listener)
The method adds daily high/low listener.
|
void |
addHighLowListener(Period period,
Instrument instrument,
IHighLowListener listener)
Deprecated.
|
void |
addHighLowListener(Period period,
Instrument instrument,
OfferSide offerSide,
IHighLowListener listener)
The method adds high/low listener.
After addition, listener will be notified with the current best period's high/low (If in progress candle exists in the system) If in progress candle doesn't exist in the system listener will be notified as soon as candle arrives |
java.util.Map<Instrument,java.util.Collection<IDailyHighLowListener>> |
getDailyHighLowListeners()
Returns all daily high/low listeners
This method equals to getHighLowListeners(Period.DAILY)
|
java.util.Collection<IDailyHighLowListener> |
getDailyHighLowListeners(Instrument instrument)
Returns all daily high/low listeners subscribed on the passed instrument.
|
IFXSentimentIndex |
getFXSentimentIndex(java.util.Currency currency)
Deprecated.
Returns null
|
IFXSentimentIndex |
getFXSentimentIndex(java.util.Currency currency,
long time)
Deprecated.
Returns null
|
java.util.List<IFXSentimentIndexBar> |
getFXSentimentIndex(java.util.Currency currency,
Period period,
long from,
long to)
Deprecated.
Returns null
|
IFXSentimentIndex |
getFXSentimentIndex(ICurrency currency)
Deprecated.
Returns null
|
IFXSentimentIndex |
getFXSentimentIndex(ICurrency currency,
long time)
Deprecated.
Returns null
|
java.util.List<IFXSentimentIndexBar> |
getFXSentimentIndex(ICurrency currency,
Period period,
long from,
long to)
Deprecated.
Returns null
|
IFXSentimentIndex |
getFXSentimentIndex(Instrument instrument)
Returns last updated Forex Sentiment Index for specified subscribed
Instrument. |
IFXSentimentIndex |
getFXSentimentIndex(Instrument instrument,
long time)
Deprecated.
Returns null
|
java.util.List<IFXSentimentIndexBar> |
getFXSentimentIndex(Instrument instrument,
Period period,
long from,
long to)
Deprecated.
Returns null
|
java.util.Map<Period,java.util.Map<Instrument,java.util.Collection<IHighLowListener>>> |
getHighLowListeners()
Returns all high/low listeners
|
java.util.Map<Instrument,java.util.Collection<IHighLowListener>> |
getHighLowListeners(Period period)
Returns all high/low listeners subscribed to the passed period and grouped by instrument
|
java.util.Collection<IHighLowListener> |
getHighLowListeners(Period period,
Instrument instrument)
Returns all high/low listeners subscribed to the passed period and instrument
|
double |
getLongSwapInAccountCurrency(Instrument instrument,
double amount)
Returns a Long Overnight Swap in account currency for specified amount.
|
double |
getLongSwapInPips(Instrument instrument)
Returns a Long Overnight Swap in pips.
|
double |
getLongSwapRateCoefficient(Instrument instrument)
Returns the coefficient for calculating a Long Overnight Swap.
|
ITimeDomain |
getOfflineTimeDomain()
Deprecated.
Use
getOfflineTimeDomain(Instrument) instead. |
ITimeDomain |
getOfflineTimeDomain(Instrument instrument)
Returns either present, current offline (weekend)
time interval or the next approximate upcoming one.The same as #getOfflineTimeDomain(shift) with shift == 0 |
ITimeDomain |
getOfflineTimeDomain(int shift)
Deprecated.
Use
getOfflineTimeDomain(int, Instrument) instead. |
ITimeDomain |
getOfflineTimeDomain(int shift,
Instrument instrument)
Returns offline (weekend)
time interval that is shifted back or forward for number of offline intervals specified in shift parameter. |
java.util.Set<ITimeDomain> |
getOfflineTimeDomains(long from,
long to)
Deprecated.
Use
getOfflineTimeDomains(long, long, Instrument) instead. |
java.util.Set<ITimeDomain> |
getOfflineTimeDomains(long from,
long to,
Instrument instrument)
Returns the set of offline (weekend)
time intervals ascending ordered by time which are within the limits of from and to parameters. |
java.util.Map<java.lang.String,java.lang.Object> |
getServerProperties()
Return unmodifiable map of server properties
|
double |
getShortSwapInAccountCurrency(Instrument instrument,
double amount)
Returns a Short Overnight Swap in account currency for specified amount.
|
double |
getShortSwapInPips(Instrument instrument)
Returns a Short Overnight Swap in pips.
|
double |
getShortSwapRateCoefficient(Instrument instrument)
Returns the coefficient for calculating a Short Overnight Swap.
|
long |
getTimeOfFirstCandle(IFeedDescriptor feedDescriptor)
Returns the time of first feed data specified in
IFeedDescriptor. |
long |
getTimeOfFirstCandle(Instrument instrument,
Period period)
|
long |
getTimeOfFirstKagi(Instrument instrument,
Period timeSession)
|
long |
getTimeOfFirstLineBreak(Instrument instrument,
Period timeSession)
|
long |
getTimeOfFirstPointAndFigure(Instrument instrument,
PriceRange priceRange,
ReversalAmount reversalAmount)
|
long |
getTimeOfFirstPointAndFigure(Instrument instrument,
PriceRange priceRange,
ReversalAmount reversalAmount,
DataInterpolationDescriptor dataInterpolationDescriptor)
Returns the time of first
point & figures for specified Instrument, PriceRange, ReversalAmount and DataInterpolationDescriptor |
long |
getTimeOfFirstRangeBar(Instrument instrument,
PriceRange priceRange)
|
long |
getTimeOfFirstRangeBar(Instrument instrument,
PriceRange priceRange,
DataInterpolationDescriptor dataInterpolationDescriptor)
Returns the time of first
price range bars for specified Instrument, PriceRange and DataInterpolationDescriptor |
long |
getTimeOfFirstRenko(Instrument instrument,
Period timeSession)
|
long |
getTimeOfFirstRenko(Instrument instrument,
PriceRange priceRange)
Deprecated.
|
long |
getTimeOfFirstTick(Instrument instrument)
Returns the time of first
ticks for specified Instrument |
long |
getTimeOfFirstTickBar(Instrument instrument)
Returns the time of first
tick bars for specified Instrument |
IWLabelData |
getWhiteLabelData() |
boolean |
isOfflineTime(long time)
Deprecated.
Use
isOfflineTime(long, Instrument) instead. |
boolean |
isOfflineTime(long time,
Instrument instrument)
Returns
true if specified time is within the limits of offline (weekend) period. |
void |
removeAllDailyHighLowListeners()
Removes all high/low listeners
|
void |
removeAllHighLowListeners()
Removes all high/low listeners
NOTE: shared instance of listeners will be unsubscribed from every period and/or instrument.
|
void |
removeDailyHighLowListener(IDailyHighLowListener listener)
Removes daily high/low listener
|
void |
removeHighLowListener(IHighLowListener listener)
Removes high/low listener.
NOTE: shared instance of listener will be unsubscribed from every period and/or instrument. |
void addDailyHighLowListener(Instrument instrument, IDailyHighLowListener listener)
instrument - Instrument to listen for high/lowlistener - listener to addaddHighLowListener(Period, Instrument, IHighLowListener)void removeDailyHighLowListener(IDailyHighLowListener listener)
listener - listener to removeremoveHighLowListener(IHighLowListener)java.util.Collection<IDailyHighLowListener> getDailyHighLowListeners(Instrument instrument)
instrument - Instrument to get listeners forgetHighLowListeners(Period, Instrument)java.util.Map<Instrument,java.util.Collection<IDailyHighLowListener>> getDailyHighLowListeners()
getHighLowListeners(Period)void removeAllDailyHighLowListeners()
removeAllHighLowListeners()void addHighLowListener(Period period, Instrument instrument, OfferSide offerSide, IHighLowListener listener)
period - Candles' Period to listen to. Period.TICK isn't supported.instrument - Candles Instrument to listen to.offerSide - Candles OfferSide to listen to.listener - instance of IHighLowListener@Deprecated void addHighLowListener(Period period, Instrument instrument, IHighLowListener listener)
void removeHighLowListener(IHighLowListener listener)
listener - instance of IHighLowListenerjava.util.Collection<IHighLowListener> getHighLowListeners(Period period, Instrument instrument)
period - listener's Periodinstrument - listener's Instrumentjava.util.Map<Instrument,java.util.Collection<IHighLowListener>> getHighLowListeners(Period period)
period - listener's Periodjava.util.Map<Period,java.util.Map<Instrument,java.util.Collection<IHighLowListener>>> getHighLowListeners()
void removeAllHighLowListeners()
long getTimeOfFirstCandle(IFeedDescriptor feedDescriptor)
IFeedDescriptor.feedDescriptor - the IFeedDescriptor specifies the feed data the first time must be returned.IFeedDescriptor.getDataType() determines the required properties of IFeedDescriptor must be set andInstrument, equals to getTimeOfFirstTick(Instrument)
Instrument, equals to getTimeOfFirstTickBar(Instrument)
Instrument and Period, equals to getTimeOfFirstCandle(Instrument, Period)
Instrument and PriceRange, equals to getTimeOfFirstRangeBar(Instrument, PriceRange)
Instrument, PriceRange and and ReversalAmount, equals to getTimeOfFirstPointAndFigure(Instrument, PriceRange, ReversalAmount)
Instrument and PriceRange, equals to getTimeOfFirstRenko(Instrument, PriceRange)
Instrument and Period, equals to getTimeOfFirstLineBreak(Instrument, Period)
IFeedDescriptor or Long.MAX_VALUE if there is no one.long getTimeOfFirstTick(Instrument instrument)
ticks for specified Instrumentinstrument - the Instrument the first tick's time must be returned.ticks for specified Instrument or Long.MAX_VALUE if there is no one.DataType.TICKSlong getTimeOfFirstTickBar(Instrument instrument)
tick bars for specified Instrumentinstrument - the Instrument the first Tick Bars' time must be returned.tick bars for specified Instrument or Long.MAX_VALUE if there is no one.DataType.TICK_BARlong getTimeOfFirstCandle(Instrument instrument, Period period)
instrument - the Instrument the first candles' time must be returned.period - the Period the first candles' time must be returned.candles for specified Instrument and Period
or Long.MAX_VALUE if there is no one.DataType.TIME_PERIOD_AGGREGATION@Deprecated long getTimeOfFirstRangeBar(Instrument instrument, PriceRange priceRange)
getTimeOfFirstRangeBar(Instrument, PriceRange, com.dukascopy.api.feed.DataInterpolationDescriptor)instrument - the Instrument the first price range bars' time must be returned.priceRange - the PriceRange the first price range bars' time must be returned.price range bars for specified Instrument and PriceRange
or Long.MAX_VALUE if there is no one.DataType.PRICE_RANGE_AGGREGATIONlong getTimeOfFirstRangeBar(Instrument instrument, PriceRange priceRange, DataInterpolationDescriptor dataInterpolationDescriptor)
price range bars for specified Instrument, PriceRange and DataInterpolationDescriptorinstrument - the Instrument the first price range bars' time must be returned.priceRange - the PriceRange the first price range bars' time must be returned.dataInterpolationDescriptor - the DataInterpolationDescriptor the first price range bars' time must be returned.price range bars for specified Instrument and PriceRange
or Long.MAX_VALUE if there is no one.DataType.PRICE_RANGE_AGGREGATION@Deprecated long getTimeOfFirstPointAndFigure(Instrument instrument, PriceRange priceRange, ReversalAmount reversalAmount)
getTimeOfFirstPointAndFigure(Instrument, PriceRange, ReversalAmount, com.dukascopy.api.feed.DataInterpolationDescriptor)instrument - the Instrument the first point & figures' time must be returned.priceRange - the PriceRange the first point & figures' time must be returned.reversalAmount - the ReversalAmount the first point & figures' time must be returned.point & figures for specified Instrument, PriceRange and ReversalAmount
or Long.MAX_VALUE if there is no one.DataType.POINT_AND_FIGURElong getTimeOfFirstPointAndFigure(Instrument instrument, PriceRange priceRange, ReversalAmount reversalAmount, DataInterpolationDescriptor dataInterpolationDescriptor)
point & figures for specified Instrument, PriceRange, ReversalAmount and DataInterpolationDescriptorinstrument - the Instrument the first point & figures' time must be returned.priceRange - the PriceRange the first point & figures' time must be returned.reversalAmount - the ReversalAmount the first point & figures' time must be returned.dataInterpolationDescriptor - the DataInterpolationDescriptor the first point & figures' time must be returned.point & figures for specified Instrument, PriceRange and ReversalAmount
or Long.MAX_VALUE if there is no one.DataType.POINT_AND_FIGURE@Deprecated long getTimeOfFirstRenko(Instrument instrument, PriceRange priceRange)
getTimeOfFirstRenko(Instrument, Period)instrument - the Instrument the first renko' time must be returned.priceRange - the PriceRange the first renko' time must be returned.renko for specified Instrument and PriceRange or Long.MAX_VALUE if there is no one.DataType.RENKOlong getTimeOfFirstRenko(Instrument instrument, Period timeSession)
instrument - the Instrument the first renko' time must be returned.timeSession - the Period (renko session) the first renko' time must be returned.renko for specified Instrument and time session or Long.MAX_VALUE if there is no one.DataType.RENKOlong getTimeOfFirstLineBreak(Instrument instrument, Period timeSession)
instrument - the Instrument the first N-Line Break' time must be returned.timeSession - the Period (time session) the first N-Line Break' time must be returned.N-Line Break for specified Instrument and time session or Long.MAX_VALUE if there is no one.DataType.LINE_BREAKlong getTimeOfFirstKagi(Instrument instrument, Period timeSession)
instrument - the Instrument the first kagi's time must be returned.timeSession - the Period (time session) the first kagi' time must be returned.kagi for specified Instrument and time session or Long.MAX_VALUE if there is no one.DataType.KAGIIFXSentimentIndex getFXSentimentIndex(Instrument instrument)
Instrument.instrument - Instrument of sentiment indexnull if there is no such@Deprecated IFXSentimentIndex getFXSentimentIndex(Instrument instrument, long time)
timeinstrument - Instrument of sentiment indextime - the point of time in the past in milliseconds.Calendar/Date/TimeUnit/DateFormat or
JFUtils.getTimeForNPeriodsBack(Period, long, int) / JFUtils.getTimeForNPeriodsForward(Period, long, int) or
time or null if there is no such.JFUtils.getTimeForNPeriodsBack(Period, long, int),
JFUtils.getTimeForNPeriodsForward(Period, long, int)@Deprecated java.util.List<IFXSentimentIndexBar> getFXSentimentIndex(Instrument instrument, Period period, long from, long to) throws JFException
instrument - Instrument of sentiment indexperiod - period between the sentiment indicesfrom - start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
See IHistory.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 loadednull if there is no such.JFException - if time is not divisible by the interval of period or the period is not among
Period.THIRTY_MINS, Period.ONE_HOUR, Period.FOUR_HOURS, Period.DAILY, Period.WEEKLY@Deprecated IFXSentimentIndex getFXSentimentIndex(java.util.Currency currency)
currency - currency of sentiment indexnull if there is no such@Deprecated IFXSentimentIndex getFXSentimentIndex(ICurrency currency)
ICurrency.currency - ICurrency of sentiment index.null if there is no suchgetFXSentimentIndex(ICurrency, long)@Deprecated IFXSentimentIndex getFXSentimentIndex(java.util.Currency currency, long time)
time.currency - currency of sentiment indextime - the point of time in the past in millisecondstime or null if there is no suchIFXSentimentIndex getFXSentimentIndex(ICurrency currency, long time)
timecurrency - ICurrency of sentiment index.time - the point of time in the past in milliseconds.Calendar/Date/TimeUnit/DateFormat or
JFUtils.getTimeForNPeriodsBack(Period, long, int) / JFUtils.getTimeForNPeriodsForward(Period, long, int) or
time or null if there is no such.JFUtils.getTimeForNPeriodsBack(Period, long, int),
JFUtils.getTimeForNPeriodsForward(Period, long, int)@Deprecated java.util.List<IFXSentimentIndexBar> getFXSentimentIndex(java.util.Currency currency, Period period, long from, long to) throws JFException
currency - currency of sentiment indexperiod - period between the sentiment indicesfrom - start of the time interval for which bars should be loadedto - end time of the time interval for which bars should be loadednull if there is no suchJFException - if time is not divisible by the interval of period or the period is not among
Period.THIRTY_MINS, Period.ONE_HOUR, Period.FOUR_HOURS, Period.DAILY, Period.WEEKLY@Deprecated java.util.List<IFXSentimentIndexBar> getFXSentimentIndex(ICurrency currency, Period period, long from, long to) throws JFException
currency - ICurrency of sentiment indexperiod - period between the sentiment indicesfrom - start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
See IHistory.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 loadednull if there is no such.JFException - if time is not divisible by the interval of period or the period is not among
Period.THIRTY_MINS, Period.ONE_HOUR, Period.FOUR_HOURS, Period.DAILY, Period.WEEKLYboolean isOfflineTime(long time)
isOfflineTime(long, Instrument) instead.true if specified time is within the limits of offline (weekend) period.time - time in millisecondstrue if specified time is within the limits of offline (weekend) period, false - otherwiseboolean isOfflineTime(long time,
Instrument instrument)
true if specified time is within the limits of offline (weekend) period.time - time in millisecondsinstrument - checked instrumenttrue if specified time is within the limits of offline (weekend) period, false - otherwiseITimeDomain getOfflineTimeDomain() throws JFException
getOfflineTimeDomain(Instrument) instead.time interval or the next approximate upcoming one.time interval or the next approximate upcoming one.JFException - when some error occursgetOfflineTimeDomain(int)ITimeDomain getOfflineTimeDomain(Instrument instrument)
time interval or the next approximate upcoming one.instrument - checked instrumenttime interval or the next approximate upcoming one.getOfflineTimeDomain(int)ITimeDomain getOfflineTimeDomain(int shift) throws JFException
getOfflineTimeDomain(int, Instrument) instead.time interval that is shifted back or forward for number of offline intervals specified in shift parameter.shift - number of offline intervals back or forward in time staring from current one. E.g.:
time interval that is shifted back or forward for number of offline intervals specified in shift parameterJFException - when some error occursITimeDomain getOfflineTimeDomain(int shift, Instrument instrument)
time interval that is shifted back or forward for number of offline intervals specified in shift parameter.shift - number of offline intervals back or forward in time staring from current one. E.g.:
instrument - checked instrumenttime interval that is shifted back or forward for number of offline intervals specified in shift parameterjava.util.Set<ITimeDomain> getOfflineTimeDomains(long from, long to) throws JFException
getOfflineTimeDomains(long, long, Instrument) instead.time intervals ascending ordered by time which are within the limits of from and to parameters.from - start of the time interval for which offline periods should be loaded. If start time is within the limits of offline period - this period will be returned as first element of resulting set.to - end of the time interval for which offline periods should be loaded. If end time is within the limits of offline period - this period will be returned as last element of resulting set.time intervals ascending ordered by time which are within the limits of from and to parameters.JFException - when some error occursjava.util.Set<ITimeDomain> getOfflineTimeDomains(long from, long to, Instrument instrument)
time intervals ascending ordered by time which are within the limits of from and to parameters.from - start of the time interval for which offline periods should be loaded. If start time is within the limits of offline period - this period will be returned as first element of resulting set.to - end of the time interval for which offline periods should be loaded. If end time is within the limits of offline period - this period will be returned as last element of resulting set.instrument - checked instrumenttime intervals ascending ordered by time which are within the limits of from and to parameters.java.util.Map<java.lang.String,java.lang.Object> getServerProperties()
IWLabelData getWhiteLabelData()
IWLabelData informationdouble getLongSwapRateCoefficient(Instrument instrument)
instrument - instrument for which the coefficient is requestedjava.lang.NullPointerException - if instrument is nulljava.lang.IllegalArgumentException - if instrument is not subscribed or swap rates are unavailable for another reasondouble getShortSwapRateCoefficient(Instrument instrument)
instrument - instrument for which the coefficient is requestedjava.lang.NullPointerException - if instrument is nulljava.lang.IllegalArgumentException - if instrument is not subscribed or swap rates are unavailable for another reasondouble getLongSwapInPips(Instrument instrument)
The value is calculated as:
-Long_Swap_Rate * Current_Price / Pip_Value
instrument - instrument for which value is requestedjava.lang.NullPointerException - if instrument is nulljava.lang.IllegalArgumentException - if instrument is not subscribed or swap rates are unavailable for another reason
or current price for the instrument is unknowndouble getShortSwapInPips(Instrument instrument)
The value is calculated as:
Short_Swap_Rate * Current_Price / Pip_Value
instrument - instrument for which value is requestedjava.lang.NullPointerException - if instrument is nulljava.lang.IllegalArgumentException - if instrument is not subscribed or swap rates are unavailable for another reason
or current price for the instrument is unknowndouble getLongSwapInAccountCurrency(Instrument instrument, double amount)
The value is calculated as:
-Long_Swap_Rate * Amount * Current_Price
instrument - instrument for which value is requestedamount - amount in millionsjava.lang.NullPointerException - if instrument is nulljava.lang.IllegalArgumentException - if instrument is not subscribed or swap rates are unavailable for another reason
or current price for the instrument is unknowndouble getShortSwapInAccountCurrency(Instrument instrument, double amount)
The value is calculated as:
Short_Swap_Rate * Amount * Current_Price
instrument - instrument for which value is requestedamount - amount in millionsjava.lang.NullPointerException - if instrument is nulljava.lang.IllegalArgumentException - if instrument is not subscribed or swap rates are unavailable for another reason
or current price for the instrument is unknownCopyright © 2025. All rights reserved.