public interface IDataService
Provide with system state:
| Method Summary | |
|---|---|
void |
addDailyHighLowListener(Instrument instrument,
IDailyHighLowListener listener)
The method adds daily high/low listener After addition listener will be notified with the current best daily high/low (If in progress daily candle exists in the system) If in progress candle doesn't exist in the system listener will be notified as soon as candle arrives |
void |
addHighLowListener(Period period,
Instrument instrument,
IHighLowListener listener)
The method adds high/low listener. |
java.util.Map<Instrument,java.util.Collection<IDailyHighLowListener>> |
getDailyHighLowListeners()
Returns all daily high/low listeners |
java.util.Collection<IDailyHighLowListener> |
getDailyHighLowListeners(Instrument instrument)
Returns all daily high/low listeners subscribed on the passed instrument |
IFXSentimentIndex |
getFXSentimentIndex(java.util.Currency currency)
Returns last updated Forex Sentiment Index for specified Currency. |
IFXSentimentIndex |
getFXSentimentIndex(java.util.Currency currency,
long time)
Returns Forex Sentiment Index which was most up-to-date at a point of specified time |
java.util.List<IFXSentimentIndexBar> |
getFXSentimentIndex(java.util.Currency currency,
Period period,
long from,
long to)
Returns the list of sentiment indices which were most up-to-date at the specified time frame. |
IFXSentimentIndex |
getFXSentimentIndex(Instrument instrument)
Returns last updated Forex Sentiment Index for specified Instrument. |
IFXSentimentIndex |
getFXSentimentIndex(Instrument instrument,
long time)
Returns Forex Sentiment Index which was most up-to-date at a point of specified time |
java.util.List<IFXSentimentIndexBar> |
getFXSentimentIndex(Instrument instrument,
Period period,
long from,
long to)
Returns the list of sentiment indices which were most up-to-date at the specified time frame. |
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 |
ITimeDomain |
getOfflineTimeDomain()
Returns either present, current offline (weekend) time interval or the next approximate upcoming one. |
ITimeDomain |
getOfflineTimeDomain(int shift)
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)
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 |
long |
getTimeOfFirstCandle(IFeedDescriptor feedDescriptor)
Returns the time of first feed data specified in IFeedDescriptor. |
long |
getTimeOfFirstCandle(Instrument instrument,
Period period)
Returns the time of first candles for specified Instrument and Period |
long |
getTimeOfFirstPointAndFigure(Instrument instrument,
PriceRange priceRange,
ReversalAmount reversalAmount)
Returns the time of first point & figures for specified Instrument, PriceRange and ReversalAmount |
long |
getTimeOfFirstRangeBar(Instrument instrument,
PriceRange priceRange)
Returns the time of first price range bars for specified Instrument and PriceRange |
long |
getTimeOfFirstRenko(Instrument instrument,
PriceRange priceRange)
Returns the time of first renko for specified Instrument and PriceRange |
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)
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. |
| Method Detail |
|---|
void addDailyHighLowListener(Instrument instrument,
IDailyHighLowListener listener)
instrument - listener - #addHighLowListener(Period.DAILY, Instrument, IHighLowListener)void removeDailyHighLowListener(IDailyHighLowListener listener)
listener - removeHighLowListener(IHighLowListener)java.util.Collection<IDailyHighLowListener> getDailyHighLowListeners(Instrument instrument)
instrument -
#getHighLowListeners(Period.DAILY, Instrument)java.util.Map<Instrument,java.util.Collection<IDailyHighLowListener>> getDailyHighLowListeners()
#getHighLowListeners(Period.DAILY)void removeAllDailyHighLowListeners()
removeAllHighLowListeners()
void addHighLowListener(Period period,
Instrument instrument,
IHighLowListener listener)
period - Candles' Period to listen to. Period.TICK isn't supported.instrument - Candles Instrument to listen to.listener - instance of IHighLowListenervoid removeHighLowListener(IHighLowListener listener)
listener - instance of IHighLowListener
java.util.Collection<IHighLowListener> getHighLowListeners(Period period,
Instrument instrument)
period - listener's Periodinstrument - listener's Instrument
java.util.Map<Instrument,java.util.Collection<IHighLowListener>> getHighLowListeners(Period period)
instrument - listener's Instrument
java.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)
IFeedDescriptor or Long.MAX_VALUE if there is no one.long getTimeOfFirstTick(Instrument instrument)
ticks for specified Instrument
instrument - 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 Instrument
instrument - 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_BAR
long getTimeOfFirstCandle(Instrument instrument,
Period period)
candles for specified Instrument and 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
long getTimeOfFirstRangeBar(Instrument instrument,
PriceRange priceRange)
price range bars for specified Instrument and PriceRange
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_AGGREGATION
long getTimeOfFirstPointAndFigure(Instrument instrument,
PriceRange priceRange,
ReversalAmount reversalAmount)
point & figures for specified Instrument, PriceRange and ReversalAmount
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_FIGURE
long getTimeOfFirstRenko(Instrument instrument,
PriceRange priceRange)
renko for specified Instrument and PriceRange
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.RENKOIFXSentimentIndex getFXSentimentIndex(Instrument instrument)
Instrument.#getFXSentimentIndex(instrument, System.currentTimeMillis) for live data and
#getFXSentimentIndex(instrument, pseudo_current_historical_tester_time) for historical data.
instrument - Instrument of sentiment index
null if there is no such
IFXSentimentIndex getFXSentimentIndex(Instrument instrument,
long time)
time
instrument - 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)
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 #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
null 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.WEEKLYIFXSentimentIndex getFXSentimentIndex(java.util.Currency currency)
Currency.#getFXSentimentIndex(currency, System.currentTimeMillis) for live data and
#getFXSentimentIndex(currency, pseudo_current_historical_tester_time) for historical data.
currency - Currency of sentiment index.
null if there is no such
IFXSentimentIndex getFXSentimentIndex(java.util.Currency currency,
long time)
time
currency - Currency 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)
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 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
null 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)
time - time in milliseconds
ITimeDomain getOfflineTimeDomain()
throws JFException
time interval or the next approximate upcoming one.#getOfflineTimeDomain(shift) with shift == 0
time interval or the next approximate upcoming one.
JFException - when some error occursgetOfflineTimeDomain(int)
ITimeDomain getOfflineTimeDomain(int shift)
throws JFException
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 parameter
JFException - when some error occurs
java.util.Set<ITimeDomain> getOfflineTimeDomains(long from,
long to)
throws JFException
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.Map<java.lang.String,java.lang.Object> getServerProperties()
IWLabelData getWhiteLabelData()
IWLabelData information