com.dukascopy.api
Interface IHistory


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.
 java.util.List<IBar> getBars(Instrument instrument, Period period, OfferSide side, Filter filter, int numberOfCandlesBefore, long time, int numberOfCandlesAfter)
          Returns bars for specified instrument, period and side.
 java.util.List<IBar> getBars(Instrument instrument, Period period, OfferSide side, Filter filter, long from, long to)
          Returns bars for specified instrument, period, side and filter.
 java.util.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
 double getEquity()
          Returns current equity calculated for every tick
 ITimedData getFeedData(IFeedDescriptor feedDescriptor, int shift)
          Returns bar for specified feed descriptor, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar (currently generated), 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.
 java.util.List<ITimedData> getFeedData(IFeedDescriptor feedDescriptor, int numberOfFeedBarsBefore, long time, int numberOfFeedBarsAfter)
          Returns bars for specified feedDescriptor.
 java.util.List<ITimedData> getFeedData(IFeedDescriptor feedDescriptor, long from, long to)
          Returns bars for specified feed descriptor.
 IOrder getHistoricalOrderById(java.lang.String id)
          Returns historical (closed) order by position id for the given user account.
 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
 java.util.List<IOrder> getOrdersHistory(Instrument instrument, long from, long to)
          Returns orders for specified instrument and time interval.
 IPointAndFigure getPointAndFigure(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, int shift)
          Returns Point and Figure for specified instrument, offer side, box size and reversal amount, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.
 java.util.List<IPointAndFigure> getPointAndFigures(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, int numberOfBarsBefore, long time, int numberOfBarsAfter)
          Returns Point and Figures for specified instrument, offer side, box size and reversal amount.
 java.util.List<IPointAndFigure> getPointAndFigures(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, long from, long to)
          Returns Point and Figures for specified instrument, offer side, box size and reversal amount.
 long getPreviousBarStart(Period period, long barTime)
          Returns starting time of the bar previous to the bar that includes time specified in barTime parameter
 IRangeBar getRangeBar(Instrument instrument, OfferSide offerSide, PriceRange priceRange, int shift)
          Returns range bar for specified instrument, offer side and price range, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.
 java.util.List<IRangeBar> getRangeBars(Instrument instrument, OfferSide offerSide, PriceRange priceRange, int numberOfBarsBefore, long time, int numberOfBarsAfter)
          Returns Range Bars for specified instrument, offer side and price range.
 java.util.List<IRangeBar> getRangeBars(Instrument instrument, OfferSide offerSide, PriceRange priceRange, long from, long to)
          Returns Range Bars for specified instrument, offer side and price range.
 IRenkoBar getRenkoBar(Instrument instrument, OfferSide offerSide, PriceRange brickSize, int shift)
          Returns renko bar for specified instrument, offer side and brick size, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.
 java.util.List<IRenkoBar> getRenkoBars(Instrument instrument, OfferSide offerSide, PriceRange brickSize, int numberOfBarsBefore, long time, int numberOfBarsAfter)
          Returns Renko Bars for specified instrument, offer side and brick size.
 java.util.List<IRenkoBar> getRenkoBars(Instrument instrument, OfferSide offerSide, PriceRange brickSize, long from, long to)
          Returns Renko Bars for specified instrument, offer side and brick size.
 long getStartTimeOfCurrentBar(Instrument instrument, Period period)
          Returns starting time of the current bar (bar currently generated from ticks) for specified instrument and period.
 ITick getTick(Instrument instrument, int shift)
          Returns tick for specified instrument, that is shifted back in time for number in ticks specified in shift parameter, 0 - current tick, 1 - previous tick.
 ITickBar getTickBar(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, int shift)
          Returns tick bar for specified instrument, offer side and tick bar size, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.
 java.util.List<ITickBar> getTickBars(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, int numberOfBarsBefore, long time, int numberOfBarsAfter)
          Returns Tick Bars for specified instrument, offer side and tick bar size.
 java.util.List<ITickBar> getTickBars(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, long from, long to)
          Returns Tick Bars for specified instrument, offer side and tick bar size.
 java.util.List<ITick> getTicks(Instrument instrument, int numberOfOneSecondIntervalsBefore, long time, int numberOfOneSecondIntervalsAfter)
          Returns ticks for specified instrument, time and count.
 java.util.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, Filter filter, int numberOfCandlesBefore, long time, int numberOfCandlesAfter, LoadingDataListener barListener, LoadingProgressListener loadingProgress)
          Reads bars from the local cache in the background.
 void readBars(Instrument instrument, Period period, OfferSide side, Filter filter, long from, long to, LoadingDataListener barListener, LoadingProgressListener loadingProgress)
          Reads bars from the local cache in the background.
 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 readFeedData(IFeedDescriptor feedDescriptor, int numberOfFeedDataBefore, long time, int numberOfFeedDataAfter, IFeedListener feedListener, LoadingProgressListener loadingProgress)
          Reads feed data from the local cache in the background.
 void readFeedData(IFeedDescriptor feedDescriptor, long from, long to, IFeedListener feedListener, LoadingProgressListener loadingProgress)
          Reads feed data from the local cache in the background.
 void readOrdersHistory(Instrument instrument, long from, long to, LoadingOrdersListener ordersListener, LoadingProgressListener loadingProgress)
          Loads orders from the server in the background.
 void readPointAndFigures(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, int numberOfBarsBefore, long time, int numberOfBarsAfter, IPointAndFigureFeedListener listener, LoadingProgressListener loadingProgress)
          Reads Point and Figures from the local cache in the background.
 void readPointAndFigures(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, long from, long to, IPointAndFigureFeedListener listener, LoadingProgressListener loadingProgress)
          Reads Point and Figures from the local cache in the background.
 void readRangeBars(Instrument instrument, OfferSide offerSide, PriceRange priceRange, int numberOfBarsBefore, long time, int numberOfBarsAfter, IRangeBarFeedListener listener, LoadingProgressListener loadingProgress)
          Reads Range Bars from the local cache in the background.
 void readRangeBars(Instrument instrument, OfferSide offerSide, PriceRange priceRange, long from, long to, IRangeBarFeedListener listener, LoadingProgressListener loadingProgress)
          Reads Range Bars from the local cache in the background.
 void readRenkoBars(Instrument instrument, OfferSide offerSide, PriceRange brickSize, int numberOfBarsBefore, long time, int numberOfBarsAfter, IRenkoBarFeedListener listener, LoadingProgressListener loadingProgress)
          Reads Renko Bars from the local cache in the background.
 void readRenkoBars(Instrument instrument, OfferSide offerSide, PriceRange brickSize, long from, long to, IRenkoBarFeedListener listener, LoadingProgressListener loadingProgress)
          Reads Renko Bars from the local cache in the background.
 void readTickBars(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, int numberOfBarsBefore, long time, int numberOfBarsAfter, ITickBarFeedListener listener, LoadingProgressListener loadingProgress)
          Reads Tick Bars from the local cache in the background.
 void readTickBars(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, long from, long to, ITickBarFeedListener listener, LoadingProgressListener loadingProgress)
          Reads Tick Bars from the local cache in the background.
 void readTicks(Instrument instrument, int numberOfOneSecondIntervalsBefore, long time, int numberOfOneSecondIntervalsAfter, LoadingDataListener tickListener, LoadingProgressListener loadingProgress)
          Reads ticks 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

getTimeOfLastTick

long getTimeOfLastTick(Instrument instrument)
                       throws JFException
Returns time of last tick received for specified instrument. Returns -1 if no tick was received yet.

Parameters:
instrument - instrument of the tick
Returns:
time of last tick or -1 if no tick was received
Throws:
JFException - when instrument is not active (not opened in platform)

getLastTick

ITick getLastTick(Instrument instrument)
                  throws JFException
Returns last tick for specified instrument

Parameters:
instrument - instrument of the tick
Returns:
tick
Throws:
JFException - when instrument is not active (not opened in platform)

getStartTimeOfCurrentBar

long getStartTimeOfCurrentBar(Instrument instrument,
                              Period period)
                              throws JFException
Returns starting time of the current bar (bar currently generated from ticks) for specified instrument and period. If no tick was received for this instrument, then returns -1.

Parameters:
instrument - instrument of the bar
period - period of the bar
Returns:
starting time of the current bar or -1 if no tick was received
Throws:
JFException - when period is not supported or instrument is not active (not opened in platform)

getBar

IBar getBar(Instrument instrument,
            Period period,
            OfferSide side,
            int shift)
            throws JFException
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.

Parameters:
instrument - instrument of the bar
period - period of the bar
side - bid or ask side of the bar
shift - number of candle back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so on
Returns:
bar or null if no bar is loaded
Throws:
JFException - when period is not supported or instrument is not active (not opened in platform)

readTicks

void readTicks(Instrument instrument,
               long from,
               long to,
               LoadingDataListener tickListener,
               LoadingProgressListener loadingProgress)
               throws JFException
Reads ticks from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, ticks will be returned by calling methods in 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

Parameters:
instrument - instrument of the ticks
from - start of the time interval for which ticks should be loaded
to - 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
tickListener - receives data about requested ticks
loadingProgress - used to control loading process
Throws:
JFException - when some error occurs while creating internal request for data

readTicks

void readTicks(Instrument instrument,
               int numberOfOneSecondIntervalsBefore,
               long time,
               int numberOfOneSecondIntervalsAfter,
               LoadingDataListener tickListener,
               LoadingProgressListener loadingProgress)
               throws JFException
Reads ticks from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, ticks will be returned by calling method in 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

Parameters:
instrument - instrument of the ticks
numberOfOneSecondIntervalsBefore - how much one second interval of ticks to load before and including one second interval of ticks with time specified in time parameter
time - time of the last one second tick interval in period specified in numberOfOneSecondIntervalsBefore parameter or/and time of the one second tick interval prior first one second tick interval in period specified with numberOfOneSecondIntervalsAfter parameter
numberOfOneSecondIntervalsAfter - how much one second tick intervals to load after (not including) one second tick interval with time specified in time parameter
barListener - receives data about requested ticks
loadingProgress - used to control loading progress
Throws:
JFException - when some errors occurs

readBars

void readBars(Instrument instrument,
              Period period,
              OfferSide side,
              long from,
              long to,
              LoadingDataListener barListener,
              LoadingProgressListener loadingProgress)
              throws JFException
Reads bars from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in 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

Parameters:
instrument - instrument of the bars
period - period of the bars
side - side of the bars
from - 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 time
to - end time of the time interval for which bars should be loaded. This is the starting time of the last bar to be loaded
barListener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when period is not supported or time interval is not valid for specified period
See Also:
getBarStart(Period, long)

readBars

void readBars(Instrument instrument,
              Period period,
              OfferSide side,
              Filter filter,
              long from,
              long to,
              LoadingDataListener barListener,
              LoadingProgressListener loadingProgress)
              throws JFException
Reads bars from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in 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

Parameters:
instrument - instrument of the bars
period - period of the bars
side - side of the bars
filter - bars filtering method see Filter
from - 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 time
to - end time of the time interval for which bars should be loaded. This is the starting time of the last bar to be loaded
barListener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when period is not supported or time interval is not valid for specified period
See Also:
getBarStart(Period, long)

readBars

void readBars(Instrument instrument,
              Period period,
              OfferSide side,
              Filter filter,
              int numberOfCandlesBefore,
              long time,
              int numberOfCandlesAfter,
              LoadingDataListener barListener,
              LoadingProgressListener loadingProgress)
              throws JFException
Reads bars from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in 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

Parameters:
instrument - instrument of the bars
period - period of the bars
side - side of the bars
filter - allows to filter candles
numberOfCandlesBefore - how much candles to load before and including candle with time specified in time parameter
time - time of the last candles in period specified in numberOfCandlesBefore parameter or/and time of the candle prior first candle in period specified with numberOfCandlesAfter parameter
numberOfCandlesAfter - how much candles to load after (not including) candle with time specified in time parameter
barListener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when period is not supported or time interval is not valid for specified period
See Also:
getBarStart(Period, long)

getTicks

java.util.List<ITick> getTicks(Instrument instrument,
                               long from,
                               long to)
                               throws JFException
Returns ticks for specified instrument and time interval. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException

Parameters:
instrument - instrument of the ticks
from - start of the time interval for which ticks should be loaded
to - 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
Returns:
loaded ticks
Throws:
JFException - when some error occurs when loading data

getTicks

java.util.List<ITick> getTicks(Instrument instrument,
                               int numberOfOneSecondIntervalsBefore,
                               long time,
                               int numberOfOneSecondIntervalsAfter)
                               throws JFException
Returns ticks for specified instrument, time and count. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException

Parameters:
instrument - instrument of the ticks
numberOfOneSecondIntervalsBefore - how much one second interval of ticks to load before and including one second interval of ticks with time specified in time parameter
time - time of the last one second tick interval in period specified in numberOfOneSecondIntervalsBefore parameter or/and time of the one second tick interval prior first one second tick interval in period specified with numberOfOneSecondIntervalsAfter parameter
numberOfOneSecondIntervalsAfter - how much one second tick intervals to load after (not including) one second tick interval with time specified in time parameter
Returns:
loaded ticks
Throws:
JFException - when some error occurs when loading data

getBars

java.util.List<IBar> getBars(Instrument instrument,
                             Period period,
                             OfferSide side,
                             long from,
                             long to)
                             throws JFException
Returns bars for specified instrument, period and side. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException

Parameters:
instrument - instrument of the bars
period - period of the bars
side - side of the bars
from - 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 time
to - end time of the time interval for which bars should be loaded. This is the starting time of the last candle to be loaded
Returns:
loaded bars
Throws:
JFException - when period is not supported or some error occurs when loading data

getBars

java.util.List<IBar> getBars(Instrument instrument,
                             Period period,
                             OfferSide side,
                             Filter filter,
                             long from,
                             long to)
                             throws JFException
Returns bars for specified instrument, period, side and filter. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException

Parameters:
instrument - instrument of the bars
period - period of the bars
side - side of the bars
filter - bars filtering method see Filter
from - 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 time
to - end time of the time interval for which bars should be loaded. This is the starting time of the last candle to be loaded
Returns:
loaded bars
Throws:
JFException - when period is not supported or some error occurs when loading data

getBars

java.util.List<IBar> getBars(Instrument instrument,
                             Period period,
                             OfferSide side,
                             Filter filter,
                             int numberOfCandlesBefore,
                             long time,
                             int numberOfCandlesAfter)
                             throws JFException
Returns bars for specified instrument, period and side. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException. If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included even if it's flat

Parameters:
instrument - instrument of the bars
period - period of the bars
side - side of the bars
filter - allows to filter candles
numberOfCandlesBefore - how much candles to load before and including candle with time specified in time parameter
time - time of the last candle in period specified in numberOfCandlesBefore parameter, or time of the first candle in period specified with numberOfCandlesAfter parameter if numberOfCandlesBefore is 0, or time of the candle prior to first candle in period specified with numberOfCandlesAfter if numberOfCandlesBefore is > 0
numberOfCandlesAfter - how much candles to load after (not including) candle with time specified in time parameter
Returns:
loaded bars
Throws:
JFException - when period is not supported or some error occurs when loading data

getBarStart

long getBarStart(Period period,
                 long time)
                 throws JFException
Returns starting time of the bar that includes time specified in time parameter

Parameters:
period - period of the bar
time - time that is included by the bar
Returns:
starting time of the bar
Throws:
JFException - when period is not supported

getNextBarStart

long getNextBarStart(Period period,
                     long barTime)
                     throws JFException
Returns starting time of the bar next to the bar that includes time specified in barTime parameter

Parameters:
period - period of the bar
barTime - time that is included by the bar previous to the returned
Returns:
starting time of the bar
Throws:
JFException - when period is not supported

getPreviousBarStart

long getPreviousBarStart(Period period,
                         long barTime)
                         throws JFException
Returns starting time of the bar previous to the bar that includes time specified in barTime parameter

Parameters:
period - period to the bar
barTime - time that is included by the bar next to the returned
Returns:
staring time of the bar
Throws:
JFException - when period is not supported

getTimeForNBarsBack

long getTimeForNBarsBack(Period period,
                         long to,
                         int numberOfBars)
                         throws JFException
Returns starting time of the bar that is 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

Parameters:
period - period of the bars
to - time of the last bar
numberOfBars - 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
Returns:
starting time of the bar
Throws:
JFException - when period is not supported

getTimeForNBarsForward

long getTimeForNBarsForward(Period period,
                            long from,
                            int numberOfBars)
                            throws JFException
Returns starting time of the bar that is + 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

Parameters:
period - period of the bars
from - time of the first bar
numberOfBars - 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
Returns:
starting time of the last bar
Throws:
JFException - when period is not supported

readOrdersHistory

void readOrdersHistory(Instrument instrument,
                       long from,
                       long to,
                       LoadingOrdersListener ordersListener,
                       LoadingProgressListener loadingProgress)
                       throws JFException
Loads orders from the server in the background. Method returns fast after creating request for data not waiting for any data to be loaded After internal request is sent, orders will be returned by calling method in ordersListener. 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 can be used for orders loading without blocking strategy execution NB! Only one order history request can be sent at a time. If there is another request sent method will throw JFException

Parameters:
instrument - instrument of the orders
from - start of the time interval for which orders should be loaded
to - end time of the time interval for which orders should be loaded
ordersListener - receives data about requested orders
loadingProgress - used to control loading progress
Throws:
JFException - in case of any system error
See Also:
getOrdersHistory(Instrument instrument, long from, long to)

getOrdersHistory

java.util.List<IOrder> getOrdersHistory(Instrument instrument,
                                        long from,
                                        long to)
                                        throws JFException
Returns orders for specified instrument and time interval. Method blocks until all data will be loaded from the server. NB! Only one order history request can be sent at a time. If there is another request sent method will throw JFException

Parameters:
instrument - instrument of the orders
from - start of the time interval for which orders should be loaded
to - end time of the time interval for which orders should be loaded
Returns:
loaded orders
Throws:
JFException - in case of any system error

getHistoricalOrderById

IOrder getHistoricalOrderById(java.lang.String id)
                              throws JFException
Returns historical (closed) order by position id for the given user account.

Parameters:
id - closed order's position id
Returns:
historical (closed) order with specified position id for the given user account or null if there is no one.
Throws:
JFException - in case of any system error

getEquity

double getEquity()
Returns current equity calculated for every tick

Returns:
actual equity

getPointAndFigures

java.util.List<IPointAndFigure> getPointAndFigures(Instrument instrument,
                                                   OfferSide offerSide,
                                                   PriceRange boxSize,
                                                   ReversalAmount reversalAmount,
                                                   long from,
                                                   long to)
                                                   throws JFException
Returns Point and Figures for specified instrument, offer side, box size and reversal amount. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too Subscribe to Point and Figure live notification first, before call this method.

Parameters:
instrument - of P&Fs
offerSide - offer side of P&Fs
boxSize - box size of P&Fs
reversalAmount - reversal amount of P&Fs
from - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded bar
to - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded bar
Returns:
loaded Point And Figures
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

getPointAndFigures

java.util.List<IPointAndFigure> getPointAndFigures(Instrument instrument,
                                                   OfferSide offerSide,
                                                   PriceRange boxSize,
                                                   ReversalAmount reversalAmount,
                                                   int numberOfBarsBefore,
                                                   long time,
                                                   int numberOfBarsAfter)
                                                   throws JFException
Returns Point and Figures for specified instrument, offer side, box size and reversal amount. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException. If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too Subscribe to Point and Figure live notification first, before call this method.

Parameters:
instrument - instrument of the P&Fs
offerSide - offer side of the P&Fs
priceRange - price range of the P&Fs
numberOfBarsBefore - how much bars to load before and including bar with time specified in time parameter
time - time of the last bar in period specified in numberOfBarsBefore parameter, or time of the first bar in period specified with numberOfBarsAfter parameter if numberOfBarsBefore is 0, or time of the candle prior to first candle in period specified with numberOfBarsAfter if numberOfBarsBefore is > 0
numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameter
Returns:
loaded bars
Throws:
JFException - when desired data amount is negative, etc; or some error occurs when loading data

readPointAndFigures

void readPointAndFigures(Instrument instrument,
                         OfferSide offerSide,
                         PriceRange boxSize,
                         ReversalAmount reversalAmount,
                         long from,
                         long to,
                         IPointAndFigureFeedListener listener,
                         LoadingProgressListener loadingProgress)
                         throws JFException
Reads Point and Figures from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in listener. 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 Subscribe to Point and Figure live notification first, before call this method.

Parameters:
instrument - of P&Fs
offerSide - offer side of P&Fs
boxSize - box size of P&Fs
reversalAmount - reversal amount of P&Fs
from - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded bar
to - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded bar
listener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

readPointAndFigures

void readPointAndFigures(Instrument instrument,
                         OfferSide offerSide,
                         PriceRange boxSize,
                         ReversalAmount reversalAmount,
                         int numberOfBarsBefore,
                         long time,
                         int numberOfBarsAfter,
                         IPointAndFigureFeedListener listener,
                         LoadingProgressListener loadingProgress)
                         throws JFException
Reads Point and Figures from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in listener. 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 Subscribe to Point and Figure live notification first, before call this method.

Parameters:
instrument - of P&Fs
offerSide - offer side of P&Fs
boxSize - box size of P&Fs
reversalAmount - reversal amount of P&Fs
numberOfBarsBefore - how much bars to load before and including bar with time specified in time parameter
time - time of the last bar in period specified in numberOfBarsBefore parameter, or time of the first bar in period specified with numberOfBarsAfter parameter if numberOfBarsBefore is 0, or time of the candle prior to first candle in period specified with numberOfBarsAfter if numberOfBarsBefore is > 0
numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameter
listener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

getPointAndFigure

IPointAndFigure getPointAndFigure(Instrument instrument,
                                  OfferSide offerSide,
                                  PriceRange boxSize,
                                  ReversalAmount reversalAmount,
                                  int shift)
                                  throws JFException
Returns Point and Figure for specified instrument, offer side, box size and reversal amount, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.

Parameters:
instrument - instrument of P&F
offerSide - bid or ask side of P&F
boxSize - box size of the P&F
reversalAmount - reversal amount of the P&F
shift - number of P&F back in time staring from current P&F. 1 - previous P&F, 2 - current P&F minus 2 bars and so on
Returns:
P&F or null if no P&F is loaded
Throws:
JFException - when shift value is negative or instrument is not active (not opened in platform)

getTickBars

java.util.List<ITickBar> getTickBars(Instrument instrument,
                                     OfferSide offerSide,
                                     TickBarSize tickBarSize,
                                     long from,
                                     long to)
                                     throws JFException
Returns Tick Bars for specified instrument, offer side and tick bar size. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too Subscribe to Tick Bar live notification first, before call this method.

Parameters:
instrument - of Tick Bars
offerSide - offer side of Tick Bars
tickBarSize - tick bar size of Tick Bars
from - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded bar
to - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded bar
Returns:
loaded Tick Bars
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

getTickBars

java.util.List<ITickBar> getTickBars(Instrument instrument,
                                     OfferSide offerSide,
                                     TickBarSize tickBarSize,
                                     int numberOfBarsBefore,
                                     long time,
                                     int numberOfBarsAfter)
                                     throws JFException
Returns Tick Bars for specified instrument, offer side and tick bar size. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException. If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too Subscribe to Tick Bar live notification first, before call this method.

Parameters:
instrument - instrument of the tick bars
offerSide - offer side of the tick bars
tickBarSize - tick bar size of the tick bars
numberOfBarsBefore - how much bars to load before and including bar with time specified in time parameter
time - time of the last bar in period specified in numberOfBarsBefore parameter, or time of the first bar in period specified with numberOfBarsAfter parameter if numberOfBarsBefore is 0, or time of the candle prior to first candle in period specified with numberOfBarsAfter if numberOfBarsBefore is > 0
numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameter
Returns:
loaded bars
Throws:
JFException - when desired data amount is negative, etc; or some error occurs when loading data

readTickBars

void readTickBars(Instrument instrument,
                  OfferSide offerSide,
                  TickBarSize tickBarSize,
                  long from,
                  long to,
                  ITickBarFeedListener listener,
                  LoadingProgressListener loadingProgress)
                  throws JFException
Reads Tick Bars from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in listener. 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 Subscribe to Tick Bar live notification first, before call this method.

Parameters:
instrument - of Tick Bars
offerSide - offer side of Tick Bars
tickBarSize - tick bar size of Tick Bars
from - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded bar
to - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded bar
listener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

readTickBars

void readTickBars(Instrument instrument,
                  OfferSide offerSide,
                  TickBarSize tickBarSize,
                  int numberOfBarsBefore,
                  long time,
                  int numberOfBarsAfter,
                  ITickBarFeedListener listener,
                  LoadingProgressListener loadingProgress)
                  throws JFException
Reads Tick Bars from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in listener. 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 Subscribe to Tick Bar live notification first, before call this method.

Parameters:
instrument - of Tick Bars
offerSide - offer side of Tick Bars
tickBarSize - tick bar size of Tick Bars
numberOfBarsBefore - how much bars to load before and including bar with time specified in time parameter
time - time of the last bar in period specified in numberOfBarsBefore parameter, or time of the first bar in period specified with numberOfBarsAfter parameter if numberOfBarsBefore is 0, or time of the candle prior to first candle in period specified with numberOfBarsAfter if numberOfBarsBefore is > 0
numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameter
listener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

getTickBar

ITickBar getTickBar(Instrument instrument,
                    OfferSide offerSide,
                    TickBarSize tickBarSize,
                    int shift)
                    throws JFException
Returns tick bar for specified instrument, offer side and tick bar size, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.

Parameters:
instrument - instrument of the tick bar
offerSide - bid or ask side of the tick bar
tickBarSize - tick bar size of the tick bar
shift - number of tick bar back in time staring from current tick bar. 1 - previous tick bar, 2 - current tick bar minus 2 bars and so on
Returns:
range bar or null if no bar is loaded
Throws:
JFException - when shift value is negative or instrument is not active (not opened in platform)

getRangeBars

java.util.List<IRangeBar> getRangeBars(Instrument instrument,
                                       OfferSide offerSide,
                                       PriceRange priceRange,
                                       long from,
                                       long to)
                                       throws JFException
Returns Range Bars for specified instrument, offer side and price range. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too Subscribe to Range Bar live notification first, before call this method.

Parameters:
instrument - of Range Bars
offerSide - offer side of Range Bars
priceRange - price range of Range Bars
from - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded bar
to - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded bar
Returns:
loaded Range Bars
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

getRangeBars

java.util.List<IRangeBar> getRangeBars(Instrument instrument,
                                       OfferSide offerSide,
                                       PriceRange priceRange,
                                       int numberOfBarsBefore,
                                       long time,
                                       int numberOfBarsAfter)
                                       throws JFException
Returns Range Bars for specified instrument, offer side and price range. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException. If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too Subscribe to Range Bar live notification first, before call this method.

Parameters:
instrument - instrument of the Range bars
offerSide - offer side of the Range bars
priceRange - price range of the Range bars
numberOfBarsBefore - how much bars to load before and including bar with time specified in time parameter
time - time of the last bar in period specified in numberOfBarsBefore parameter, or time of the first bar in period specified with numberOfBarsAfter parameter if numberOfBarsBefore is 0, or time of the candle prior to first candle in period specified with numberOfBarsAfter if numberOfBarsBefore is > 0
numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameter
Returns:
loaded bars
Throws:
JFException - when desired data amount is negative, etc; or some error occurs when loading data

readRangeBars

void readRangeBars(Instrument instrument,
                   OfferSide offerSide,
                   PriceRange priceRange,
                   long from,
                   long to,
                   IRangeBarFeedListener listener,
                   LoadingProgressListener loadingProgress)
                   throws JFException
Reads Range Bars from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in listener. 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 Subscribe to Range Bar live notification first, before call this method.

Parameters:
instrument - of Range Bars
offerSide - offer side of Range Bars
priceRange - price range of Range Bars
from - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded bar
to - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded bar
listener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

readRangeBars

void readRangeBars(Instrument instrument,
                   OfferSide offerSide,
                   PriceRange priceRange,
                   int numberOfBarsBefore,
                   long time,
                   int numberOfBarsAfter,
                   IRangeBarFeedListener listener,
                   LoadingProgressListener loadingProgress)
                   throws JFException
Reads Range Bars from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in listener. 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 Subscribe to Range Bar live notification first, before call this method.

Parameters:
instrument - of Range Bars
offerSide - offer side of Range Bars
priceRange - price range of Range Bars
numberOfBarsBefore - how much bars to load before and including bar with time specified in time parameter
time - time of the last bar in period specified in numberOfBarsBefore parameter, or time of the first bar in period specified with numberOfBarsAfter parameter if numberOfBarsBefore is 0, or time of the candle prior to first candle in period specified with numberOfBarsAfter if numberOfBarsBefore is > 0
numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameter
listener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

getRangeBar

IRangeBar getRangeBar(Instrument instrument,
                      OfferSide offerSide,
                      PriceRange priceRange,
                      int shift)
                      throws JFException
Returns range bar for specified instrument, offer side and price range, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.

Parameters:
instrument - instrument of the range bar
offerSide - bid or ask side of the range bar
priceRange - price range of the range bar
shift - number of range bar back in time staring from current range bar. 1 - previous range bar, 2 - current range bar minus 2 bars and so on
Returns:
range bar or null if no bar is loaded
Throws:
JFException - when shift value is negative or instrument is not active (not opened in platform)

getTick

ITick getTick(Instrument instrument,
              int shift)
              throws JFException
Returns tick for specified instrument, that is shifted back in time for number in ticks specified in shift parameter, 0 - current tick, 1 - previous tick.

Parameters:
instrument - instrument of the tick
shift - number of tick back in time staring from current tick. 1 - previous tick, 2 - current tick minus 2 ticks and so on
Returns:
tick
Throws:
JFException - when instrument is not active (not opened in platform) or other errors

getRenkoBar

IRenkoBar getRenkoBar(Instrument instrument,
                      OfferSide offerSide,
                      PriceRange brickSize,
                      int shift)
                      throws JFException
Returns renko bar for specified instrument, offer side and brick size, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.

Parameters:
instrument - instrument of the Renko bar
offerSide - bid or ask side of the Renko bar
brickSize - price range of the Renko bar
shift - number of bar back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so on
Returns:
Renko bar or null if no bar is loaded
Throws:
JFException - when shift value is negative or instrument is not active (not opened in platform)

getRenkoBars

java.util.List<IRenkoBar> getRenkoBars(Instrument instrument,
                                       OfferSide offerSide,
                                       PriceRange brickSize,
                                       long from,
                                       long to)
                                       throws JFException
Returns Renko Bars for specified instrument, offer side and brick size. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too Subscribe to Renko Bar live notification first, before call this method.

Parameters:
instrument - of Renko Bars
offerSide - offer side of Renko Bars
brickSize - price range of Renko Bars
from - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded bar
to - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded bar
Returns:
loaded Renko Bars
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

getRenkoBars

java.util.List<IRenkoBar> getRenkoBars(Instrument instrument,
                                       OfferSide offerSide,
                                       PriceRange brickSize,
                                       int numberOfBarsBefore,
                                       long time,
                                       int numberOfBarsAfter)
                                       throws JFException
Returns Renko Bars for specified instrument, offer side and brick size. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException. If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too Subscribe to Renko Bar live notification first, before call this method.

Parameters:
instrument - instrument of the Renko bars
offerSide - offer side of the Renko bars
brickSize - price range of the Renko bars
numberOfBarsBefore - how much bars to load before and including bar with time specified in time parameter
time - time of the last bar in period specified in numberOfBarsBefore parameter, or time of the first bar in period specified with numberOfBarsAfter parameter if numberOfBarsBefore is 0, or time of the candle prior to first candle in period specified with numberOfBarsAfter if numberOfBarsBefore is > 0
numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameter
Returns:
loaded bars
Throws:
JFException - when desired data amount is negative, etc; or some error occurs when loading data

readRenkoBars

void readRenkoBars(Instrument instrument,
                   OfferSide offerSide,
                   PriceRange brickSize,
                   long from,
                   long to,
                   IRenkoBarFeedListener listener,
                   LoadingProgressListener loadingProgress)
                   throws JFException
Reads Renko Bars from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in listener. 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 Subscribe to Renko Bar live notification first, before call this method.

Parameters:
instrument - of Renko Bars
offerSide - offer side of Renko Bars
brickSize - price range of Renko Bars
from - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded bar
to - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded bar
listener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

readRenkoBars

void readRenkoBars(Instrument instrument,
                   OfferSide offerSide,
                   PriceRange brickSize,
                   int numberOfBarsBefore,
                   long time,
                   int numberOfBarsAfter,
                   IRenkoBarFeedListener listener,
                   LoadingProgressListener loadingProgress)
                   throws JFException
Reads Renko Bars from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, bars will be returned by calling method in listener. 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 Subscribe to Renko Bar live notification first, before call this method.

Parameters:
instrument - of Renko Bars
offerSide - offer side of Renko Bars
brickSize - price range of Renko Bars
numberOfBarsBefore - how much bars to load before and including bar with time specified in time parameter
time - time of the last bar in period specified in numberOfBarsBefore parameter, or time of the first bar in period specified with numberOfBarsAfter parameter if numberOfBarsBefore is 0, or time of the candle prior to first candle in period specified with numberOfBarsAfter if numberOfBarsBefore is > 0
numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameter
listener - receives data about requested bars
loadingProgress - used to control loading progress
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

getFeedData

ITimedData getFeedData(IFeedDescriptor feedDescriptor,
                       int shift)
                       throws JFException
Returns bar for specified feed descriptor, that is shifted back in time for number in bars specified in shift parameter, 0 - current bar (currently generated), 1 - previous bar (last formed bar) If there is no bar loaded at that position, then function returns null.

Parameters:
feedDescriptor - holds parameters: data type, instrument, offer side, etc (depends on bar type), and describes what kind of bars must be loaded
shift - number of bars back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so on
Returns:
bar or null if no bar is loaded, the type of returning bar depends on FeedDescriptor.getDataType()
Throws:
JFException - when some error occurs when loading data

getFeedData

java.util.List<ITimedData> getFeedData(IFeedDescriptor feedDescriptor,
                                       long from,
                                       long to)
                                       throws JFException
Returns bars for specified feed descriptor. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException

Parameters:
feedDescriptor - holds parameters: data type, instrument, offer side, etc (depends on bar type), and describes what kind of bars must be loaded
from - start of the time interval for which bars should be loaded
to - end time of the time interval for which bars should be loaded. If there is bar with time equals to the time in to parameter then it will be loaded as well
Returns:
loaded bars
Throws:
JFException - when incorrect time interval is passed or some error occurs when loading data

getFeedData

java.util.List<ITimedData> getFeedData(IFeedDescriptor feedDescriptor,
                                       int numberOfFeedBarsBefore,
                                       long time,
                                       int numberOfFeedBarsAfter)
                                       throws JFException
Returns bars for specified feedDescriptor. Method blocks until all data will be loaded from the server into local cache and then read and stored in collection. Because all the data is loaded into the memory, this method should be used with caution to not load too much data which can lead to OutOfMemoryException.

Parameters:
feedDescriptor - holds parameters: data type, instrument, offer side, etc (depends on bar type), and describes what kind of bars must be loaded
numberOfFeedBarsBefore - how much bars to load before and including bar with time specified in time parameter
time - the time of the last bar in period specified in numberOfFeedBarsBefore parameter, or the time of the first bar in period specified with numberOfFeedBarsAfter parameter if numberOfFeedBarsBefore is 0, or the time of the bar prior to the first bar in period specified with numberOfFeedBarsAfter if numberOfFeedBarsBefore is > 0
numberOfFeedBarsAfter - how much bars to load after (not including) bar with time specified in time parameter
Returns:
loaded bars
Throws:
JFException - when some error occurs when loading data

readFeedData

void readFeedData(IFeedDescriptor feedDescriptor,
                  long from,
                  long to,
                  IFeedListener feedListener,
                  LoadingProgressListener loadingProgress)
                  throws JFException
Reads feed data from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, feed data items will be returned by calling method in feedListener. 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

Parameters:
feedDescriptor - feed descriptor of the feed data
from - start of the time interval for which feed data items should be loaded.
to - end time of the time interval for which feed data items should be loaded.
feedListener - receives data about requested feed data items
loadingProgress - used to control loading progress
Throws:
JFException - when some errors occurs

readFeedData

void readFeedData(IFeedDescriptor feedDescriptor,
                  int numberOfFeedDataBefore,
                  long time,
                  int numberOfFeedDataAfter,
                  IFeedListener feedListener,
                  LoadingProgressListener loadingProgress)
                  throws JFException
Reads feed data from the local cache in the background. Method returns fast after creating request for data not waiting for any data to be read from local cache. After internal request is sent, feed data will be returned by calling method in feedListener. 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 feed data without keeping them all in memory, and second is asynchronous processing

Parameters:
feedDescriptor - feed descriptor of the feed data
numberOfOneSecondIntervalsBefore - how much feed data items to load before and including feed data item with time specified in time parameter
time - time of the last feed data item in period specified in numberOfFeedDataBefore parameter or/and time of the feed data item prior first feed data item in period specified with numberOfFeedDataAfter parameter
numberOfFeedDataAfter - how much feed data items to load after (not including) feed data item with time specified in time parameter
feedListener - receives feed data
loadingProgress - used to control loading progress
Throws:
JFException - when some errors occurs