public interface IHistory
IHistory interface represents API for historical data access.| Modifier and Type | Method and Description | 
|---|---|
| IBar | getBar(IFinancialInstrument financialInstrument,
      Period period,
      OfferSide side,
      int shift)Deprecated.  | 
| 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  shiftparameter, 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(IFinancialInstrument financialInstrument,
       Period period,
       OfferSide side,
       Filter filter,
       int numberOfCandlesBefore,
       long time,
       int numberOfCandlesAfter)Deprecated.  | 
| java.util.List<IBar> | getBars(IFinancialInstrument financialInstrument,
       Period period,
       OfferSide side,
       Filter filter,
       long from,
       long to)Deprecated.  | 
| java.util.List<IBar> | getBars(IFinancialInstrument financialInstrument,
       Period period,
       OfferSide side,
       long from,
       long to)Deprecated.  | 
| 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  timeparameter | 
| 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  shiftparameter, 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. | 
| ITimedData | getFeedData(IFeedInfo feedInfo,
           int shift)Deprecated.  | 
| java.util.List<ITimedData> | getFeedData(IFeedInfo feedInfo,
           int numberOfFeedBarsBefore,
           long time,
           int numberOfFeedBarsAfter)Deprecated.  | 
| java.util.List<ITimedData> | getFeedData(IFeedInfo feedInfo,
           long from,
           long to)Deprecated.  | 
| <T extends ITimedData> | getFeedData(ITailoredFeedDescriptor<T> feedDescriptor,
           int shift)A type-safe feed data retrieval for the specified feed | 
| <T extends ITimedData> | getFeedData(ITailoredFeedDescriptor<T> feedDescriptor,
           int numberOfFeedBarsBefore,
           long time,
           int numberOfFeedBarsAfter)A type-safe feed data retrieval for the specified feed | 
| <T extends ITimedData> | getFeedData(ITailoredFeedDescriptor<T> feedDescriptor,
           long from,
           long to)A type-safe feed data retrieval for the specified feed | 
| <T extends ITimedData> | getFeedData(ITailoredFeedInfo<T> feedInfo,
           int shift)A type-safe feed data retrieval for the specified feed | 
| <T extends ITimedData> | getFeedData(ITailoredFeedInfo<T> feedInfo,
           int numberOfFeedBarsBefore,
           long time,
           int numberOfFeedBarsAfter)Deprecated.  | 
| <T extends ITimedData> | getFeedData(ITailoredFeedInfo<T> feedInfo,
           long from,
           long to)Deprecated.  | 
| IOrder | getHistoricalOrderById(java.lang.String id)Returns historical (closed) order by position id for the given user account. | 
| ITick | getLastTick(IFinancialInstrument financialInstrument)Deprecated.  | 
| 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  barTimeparameter | 
| java.util.List<IOrder> | getOpenOrders(IFinancialInstrument financialInstrument,
             long from,
             long to)Deprecated.  | 
| java.util.List<IOrder> | getOpenOrders(Instrument instrument,
             long from,
             long to)Returns open orders for specified instrument and time interval. | 
| java.util.List<IOrder> | getOrdersHistory(IFinancialInstrument financialInstrument,
                long from,
                long to)Deprecated.  | 
| 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)Deprecated. 
 | 
| java.util.List<IPointAndFigure> | getPointAndFigures(Instrument instrument,
                  OfferSide offerSide,
                  PriceRange boxSize,
                  ReversalAmount reversalAmount,
                  int numberOfBarsBefore,
                  long time,
                  int numberOfBarsAfter)Deprecated. 
 | 
| java.util.List<IPointAndFigure> | getPointAndFigures(Instrument instrument,
                  OfferSide offerSide,
                  PriceRange boxSize,
                  ReversalAmount reversalAmount,
                  long from,
                  long to)Deprecated. 
 | 
| long | getPreviousBarStart(Period period,
                   long barTime)Returns starting time of the bar previous to the bar that includes time specified in  barTimeparameter | 
| IRangeBar | getRangeBar(Instrument instrument,
           OfferSide offerSide,
           PriceRange priceRange,
           int shift)Deprecated. 
 | 
| java.util.List<IRangeBar> | getRangeBars(Instrument instrument,
            OfferSide offerSide,
            PriceRange priceRange,
            int numberOfBarsBefore,
            long time,
            int numberOfBarsAfter)Deprecated. 
 | 
| java.util.List<IRangeBar> | getRangeBars(Instrument instrument,
            OfferSide offerSide,
            PriceRange priceRange,
            long from,
            long to)Deprecated. 
 | 
| IRenkoBar | getRenkoBar(Instrument instrument,
           OfferSide offerSide,
           PriceRange brickSize,
           int shift)Deprecated. 
 | 
| java.util.List<IRenkoBar> | getRenkoBars(Instrument instrument,
            OfferSide offerSide,
            PriceRange brickSize,
            int numberOfBarsBefore,
            long time,
            int numberOfBarsAfter)Deprecated. 
 | 
| java.util.List<IRenkoBar> | getRenkoBars(Instrument instrument,
            OfferSide offerSide,
            PriceRange brickSize,
            long from,
            long to)Deprecated. 
 | 
| long | getStartTimeOfCurrentBar(IFinancialInstrument financialInstrument,
                        Period period)Deprecated.  | 
| 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(IFinancialInstrument financialInstrument,
       int shift)Deprecated.  | 
| ITick | getTick(Instrument instrument,
       int shift)Returns tick for specified instrument, that is shifted back in time for number in ticks specified in  shiftparameter, 0 - current tick, 1 - previous tick. | 
| ITickBar | getTickBar(Instrument instrument,
          OfferSide offerSide,
          TickBarSize tickBarSize,
          int shift)Deprecated. 
 | 
| java.util.List<ITickBar> | getTickBars(Instrument instrument,
           OfferSide offerSide,
           TickBarSize tickBarSize,
           int numberOfBarsBefore,
           long time,
           int numberOfBarsAfter)Deprecated. 
 | 
| java.util.List<ITickBar> | getTickBars(Instrument instrument,
           OfferSide offerSide,
           TickBarSize tickBarSize,
           long from,
           long to)Deprecated. 
 | 
| java.util.List<ITick> | getTicks(IFinancialInstrument financialInstrument,
        int numberOfOneSecondIntervalsBefore,
        long time,
        int numberOfOneSecondIntervalsAfter)Deprecated.  | 
| java.util.List<ITick> | getTicks(IFinancialInstrument financialInstrument,
        long from,
        long to)Deprecated.  | 
| 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 - 1back in time to the bar that includes time specified intoparameter. | 
| long | getTimeForNBarsForward(Period period,
                      long from,
                      int numberOfBars)Returns starting time of the bar that is +  numberOfBars - 1in the future to the bar that includes time specified infromparameter. | 
| long | getTimeOfLastTick(IFinancialInstrument financialInstrument)Deprecated.  | 
| long | getTimeOfLastTick(Instrument instrument)Returns time of last tick received for specified instrument. | 
| void | readBars(IFinancialInstrument financialInstrument,
        Period period,
        OfferSide side,
        Filter filter,
        int numberOfCandlesBefore,
        long time,
        int numberOfCandlesAfter,
        DataLoadingListener barListener,
        LoadingProgressListener loadingProgress)Deprecated.  | 
| void | readBars(IFinancialInstrument financialInstrument,
        Period period,
        OfferSide side,
        Filter filter,
        long from,
        long to,
        DataLoadingListener barListener,
        LoadingProgressListener loadingProgress)Deprecated.  | 
| void | readBars(IFinancialInstrument financialInstrument,
        Period period,
        OfferSide side,
        long from,
        long to,
        DataLoadingListener barListener,
        LoadingProgressListener loadingProgress)Deprecated.  | 
| 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. | 
| <T extends ITimedData> | readFeedData(IFeedInfo feedInfo,
            int numberOfFeedDataBefore,
            long time,
            int numberOfFeedDataAfter,
            IFinancialFeedListener financialFeedListener,
            LoadingProgressListener loadingProgress)Deprecated.  | 
| void | readFeedData(IFeedInfo feedInfo,
            long from,
            long to,
            IFinancialFeedListener feedListener,
            LoadingProgressListener loadingProgress)Deprecated.  | 
| <T extends ITimedData> | readFeedData(ITailoredFeedDescriptor<T> feedDescriptor,
            int numberOfFeedDataBefore,
            long time,
            int numberOfFeedDataAfter,
            ITailoredFeedListener<T> feedListener,
            LoadingProgressListener loadingProgress)A type-safe feed data retrieval for the specified feed | 
| <T extends ITimedData> | readFeedData(ITailoredFeedDescriptor<T> feedDescriptor,
            int numberOfFeedDataBefore,
            long time,
            int numberOfFeedDataAfter,
            LoadingProgressListener loadingProgressListener)A type-safe feed data retrieval for the specified feed. | 
| <T extends ITimedData> | readFeedData(ITailoredFeedDescriptor<T> feedDescriptor,
            long from,
            long to,
            ITailoredFeedListener<T> feedListener,
            LoadingProgressListener loadingProgress)A type-safe feed data retrieval for the specified feed | 
| <T extends ITimedData> | readFeedData(ITailoredFeedDescriptor<T> feedDescriptor,
            long from,
            long to,
            LoadingProgressListener loadingProgressListener)A type-safe feed data retrieval for the specified feed. | 
| <T extends ITimedData> | readFeedData(ITailoredFeedInfo<T> feedInfo,
            int numberOfFeedDataBefore,
            long time,
            int numberOfFeedDataAfter,
            ITailoredFinancialFeedListener<T> tailoredFinancialFeedListener,
            LoadingProgressListener loadingProgress)Deprecated.  | 
| <T extends ITimedData> | readFeedData(ITailoredFeedInfo<T> feedInfo,
            long from,
            long to,
            ITailoredFinancialFeedListener<T> tailoredFinancialFeedListener,
            LoadingProgressListener loadingProgress)Deprecated.  | 
| void | readOrdersHistory(IFinancialInstrument financialInstrument,
                 long from,
                 long to,
                 OrdersLoadingListener ordersListener,
                 LoadingProgressListener loadingProgress)Deprecated.  | 
| 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) | 
| void | readPointAndFigures(Instrument instrument,
                   OfferSide offerSide,
                   PriceRange boxSize,
                   ReversalAmount reversalAmount,
                   long from,
                   long to,
                   IPointAndFigureFeedListener listener,
                   LoadingProgressListener loadingProgress) | 
| void | readRangeBars(Instrument instrument,
             OfferSide offerSide,
             PriceRange priceRange,
             int numberOfBarsBefore,
             long time,
             int numberOfBarsAfter,
             IRangeBarFeedListener listener,
             LoadingProgressListener loadingProgress) | 
| void | readRangeBars(Instrument instrument,
             OfferSide offerSide,
             PriceRange priceRange,
             long from,
             long to,
             IRangeBarFeedListener listener,
             LoadingProgressListener loadingProgress) | 
| void | readRenkoBars(Instrument instrument,
             OfferSide offerSide,
             PriceRange brickSize,
             int numberOfBarsBefore,
             long time,
             int numberOfBarsAfter,
             IRenkoBarFeedListener listener,
             LoadingProgressListener loadingProgress) | 
| void | readRenkoBars(Instrument instrument,
             OfferSide offerSide,
             PriceRange brickSize,
             long from,
             long to,
             IRenkoBarFeedListener listener,
             LoadingProgressListener loadingProgress) | 
| void | readTickBars(Instrument instrument,
            OfferSide offerSide,
            TickBarSize tickBarSize,
            int numberOfBarsBefore,
            long time,
            int numberOfBarsAfter,
            ITickBarFeedListener listener,
            LoadingProgressListener loadingProgress) | 
| void | readTickBars(Instrument instrument,
            OfferSide offerSide,
            TickBarSize tickBarSize,
            long from,
            long to,
            ITickBarFeedListener listener,
            LoadingProgressListener loadingProgress) | 
| void | readTicks(IFinancialInstrument financialInstrument,
         int numberOfOneSecondIntervalsBefore,
         long time,
         int numberOfOneSecondIntervalsAfter,
         LoadingDataListener tickListener,
         LoadingProgressListener loadingProgress)Deprecated.  | 
| void | readTicks(IFinancialInstrument financialInstrument,
         long from,
         long to,
         DataLoadingListener tickListener,
         LoadingProgressListener loadingProgress)Deprecated.  | 
| 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. | 
long getTimeOfLastTick(Instrument instrument) throws JFException
instrument - instrument of the tickJFException - when instrument is not active (not opened in platform)ITick getLastTick(Instrument instrument) throws JFException
instrument - instrument of the tickJFException - when instrument is not active (not opened in platform)long getStartTimeOfCurrentBar(Instrument instrument, Period period) throws JFException
instrument - instrument of the barperiod - period of the barJFException - when period is not supported or instrument is not active (not opened in platform)IBar getBar(Instrument instrument, Period period, OfferSide side, int shift) throws JFException
shift
 parameter, 0 - current bar (currently generated from ticks), 1 - previous bar (last formed bar) If there is no bar loaded at that
 position, then function returns null.
 
 consider getting the previous one hour bar
IBar prevBar = history.getBar(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, 1); console.getOut().println(prevBar);
instrument - instrument of the barperiod - period of the barside - bid or ask side of the barshift - number of candle back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so onJFException - when period is not supported or instrument is not active (not opened in platform)void readTicks(Instrument instrument, long from, long to, LoadingDataListener tickListener, LoadingProgressListener loadingProgress) throws JFException
tickListener. LoadingProgressListener is
 used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error.
 This method has two main purposes: one is to load a lot of ticks without keeping them all in memory, and second is asynchronous processing
 
 Consider analyzing the last days ticks - namely calculating the average ask price and the maximum bid
 private IHistory history;
 private IConsole console;
 double maxBid = Double.MIN_VALUE, avgAsk = 0;
 int tickCount =0;
 private Instrument instrument = Instrument.EURUSD;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     final long from = history.getLastTick(instrument).getTime() - Period.DAILY.getInterval();
     final long to = history.getLastTick(instrument).getTime();
     history.readTicks(instrument, from, to,
     new LoadingDataListener() {
          @Override
         public void newTick(Instrument instrument, long time, double ask, double bid, double askVol, double bidVol) {
             tickCount++;
             maxBid = Math.max(bid, maxBid);
             avgAsk = tickCount == 1 ? ask : round(avgAsk + ((avgAsk - ask) / (double)tickCount));
         }
         
         private double round(double amount) { 
             return (new BigDecimal(amount)).setScale(instrument.getPipScale(), BigDecimal.ROUND_HALF_UP).doubleValue();
         }
          @Override
         public void newBar(Instrument instrument, Period period, OfferSide side, long time, double open, double close, double low, double high, double vol) {
             // no bars expected
         }
     },
     new LoadingProgressListener() {
          @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
          @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
             console.getOut().format("Loaded %s ticks %s - %s max Bid=%.5f average ask=%.5f", 
                     tickCount, DateUtils.format(from), DateUtils.format(to), maxBid, avgAsk).println();
             context.stop();
         }
          @Override
         public boolean stopJob() {
             return false;
         }
     });
 }
 instrument - instrument of the ticksfrom - start of the time interval for which ticks should be loadedto - end time of the time interval for which ticks should be loaded. If there is tick with time equals to the time in to
        parameter then it will be loaded as welltickListener - receives data about requested ticksloadingProgress - used to control loading processJFException - when some error occurs while creating internal request for datavoid readTicks(Instrument instrument, int numberOfOneSecondIntervalsBefore, long time, int numberOfOneSecondIntervalsAfter, LoadingDataListener tickListener, LoadingProgressListener loadingProgress) throws JFException
tickListener. LoadingProgressListener is
 used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error
 This method has two main purposes: one is to load a lot of ticks without keeping them all in memory, and second is asynchronous processinginstrument - instrument of the ticksnumberOfOneSecondIntervalsBefore - how much one second interval of ticks to load before and including one second interval of ticks with time specified in time parametertime - 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 parameternumberOfOneSecondIntervalsAfter - how much one second tick intervals to load after (not including) one second tick interval with time specified in time parametertickListener - receives data about requested ticksloadingProgress - used to control loading progressJFException - when some errors occursvoid readBars(Instrument instrument, Period period, OfferSide side, long from, long to, LoadingDataListener barListener, LoadingProgressListener loadingProgress) throws JFException
barListener. LoadingProgressListener is
 used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error
 This method has two main purposes: one is to load a lot of bars without keeping them all in memory, and second is asynchronous processing
 Consider analyzing the last weeks 1 minute bars - namely calculating the average close price and the maximum bar size
 private IHistory history;
 private IConsole console;
 double maxHeight = Double.MIN_VALUE, avgClose = 0;
 int barCount, greenCount;
 private Instrument instrument = Instrument.EURUSD;
 private Period period = Period.ONE_MIN;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     long lastTickTime = history.getLastTick(instrument).getTime();
     final long from = history.getBarStart(period, lastTickTime - Period.DAILY.getInterval() * 7);
     final long to = history.getTimeForNBarsBack(period, lastTickTime, 2);
     history.readBars(instrument, period, OfferSide.BID, from, to,
     new LoadingDataListener() {
          @Override
         public void newTick(Instrument instrument, long time, double ask, double bid, double askVol, double bidVol) {}
          @Override
         public void newBar(Instrument instrument, Period period, OfferSide side, long time, double open, double close, double low, double high, double vol) {
             barCount++;
             maxHeight = Math.max(Math.abs(open - close), maxHeight);
             avgClose = barCount == 1 ? close : round(avgClose + ((close - avgClose) / (double)barCount));
             if(close - open > 0){
                 greenCount++;
             }
         }
         private double round(double amount) {
             return (new BigDecimal(amount)).setScale(instrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
         }
     },
     new LoadingProgressListener() {
          @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
          @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
             console.getOut().format("Loaded %s %s candles (%s green, %s red) %s  - %s max bar height=%.1fpips average close=%.5f"
                     barCount, period, greenCount, barCount - greenCount, DateUtils.format(from), DateUtils.format(to), maxHeight/instrument.getPipValue(), avgClose).println();
             context.stop();
         }
          @Override
         public boolean stopJob() {
             return false;
         }
     });
 }
 instrument - instrument of the barsperiod - period of the barsside - side of the barsfrom - start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
        See getBarStart(Period, long) description if you want to get bar starting time for bar that includes specific timeto - end time of the time interval for which bars should be loaded. This is the starting time of the last bar to be loadedbarListener - receives data about requested barsloadingProgress - used to control loading progressJFException - when period is not supported or time interval is not valid for specified periodgetBarStart(Period, long)void readBars(Instrument instrument, Period period, OfferSide side, Filter filter, long from, long to, LoadingDataListener barListener, LoadingProgressListener loadingProgress) throws JFException
barListener.
 LoadingProgressListener is used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error
 This method has two main purposes: one is to load a lot of bars without keeping them all in memory, and second is asynchronous processing
 Consider analyzing the last weeks 1 minute bars - namely calculating the average close price and the maximum bar size
 private IHistory history;
 private IConsole console;
 double maxHeight = Double.MIN_VALUE, avgClose = 0;
 int barCount, greenCount;
 private Instrument instrument = Instrument.EURUSD;
 private Period period = Period.ONE_MIN;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     long lastTickTime = history.getLastTick(instrument).getTime();
     final long from = history.getBarStart(period, lastTickTime - Period.DAILY.getInterval() * 7);
     final long to = history.getTimeForNBarsBack(period, lastTickTime, 2);
     history.readBars(instrument, period, OfferSide.BID, Filter.WEEKENDS, from, to,
     new LoadingDataListener() {
          @Override
         public void newTick(Instrument instrument, long time, double ask, double bid, double askVol, double bidVol) {}
          @Override
         public void newBar(Instrument instrument, Period period, OfferSide side, long time, double open, double close, double low, double high, double vol) {
             barCount++;
             maxHeight = Math.max(Math.abs(open - close), maxHeight);
             avgClose = barCount == 1 ? close : round(avgClose + ((close - avgClose) / (double)barCount));
             if(close - open > 0){
                 greenCount++;
             }
         }
         private double round(double amount) {
             return (new BigDecimal(amount)).setScale(instrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
         }
     },
     new LoadingProgressListener() {
          @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
          @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
             console.getOut().format("Loaded %s %s candles (%s green, %s red) %s  - %s max bar height=%.1fpips average close=%.5f"
                     barCount, period, greenCount, barCount - greenCount, DateUtils.format(from), DateUtils.format(to), maxHeight/instrument.getPipValue(), avgClose).println();
             context.stop();
         }
          @Override
         public boolean stopJob() {
             return false;
         }
     });
 }
 instrument - instrument of the barsperiod - period of the barsside - side of the barsfilter - bars filtering method see Filterfrom - start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
        See getBarStart(Period, long) description if you want to get bar starting time for bar that includes specific timeto - end time of the time interval for which bars should be loaded. This is the starting time of the last bar to be loadedbarListener - receives data about requested barsloadingProgress - used to control loading progressJFException - when period is not supported or time interval is not valid for specified periodgetBarStart(Period, long)void readBars(Instrument instrument, Period period, OfferSide side, Filter filter, int numberOfCandlesBefore, long time, int numberOfCandlesAfter, LoadingDataListener barListener, LoadingProgressListener loadingProgress) throws JFException
barListener. LoadingProgressListener is
 used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error
 This method has two main purposes: one is to load a lot of bars without keeping them all in memory, and second is asynchronous processing
 Consider analyzing the 100000 1 minute bars - namely calculating the average close price and the maximum bar size
 private IHistory history;
 private IConsole console;
 double maxHeight = Double.MIN_VALUE, avgClose = 0;
 int barCount, greenCount;
 private Instrument instrument = Instrument.EURUSD;
 private Period period = Period.ONE_MIN;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     long lastTickTime = history.getLastTick(instrument).getTime();
     final long to = history.getTimeForNBarsBack(period, lastTickTime, 2);
     history.readBars(instrument, period, OfferSide.BID, Filter.WEEKENDS, 100000, to, 0,
     new LoadingDataListener() {
          @Override
         public void newTick(Instrument instrument, long time, double ask, double bid, double askVol, double bidVol) {}
          @Override
         public void newBar(Instrument instrument, Period period, OfferSide side, long time, double open, double close, double low, double high, double vol) {
             barCount++;
             maxHeight = Math.max(Math.abs(open - close), maxHeight);
             avgClose = barCount == 1 ? close : round(avgClose + ((close - avgClose) / (double)barCount));
             if(close - open > 0){
                 greenCount++;
             }
         }
         private double round(double amount) {
             return (new BigDecimal(amount)).setScale(instrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
         }
     },
     new LoadingProgressListener() {
          @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
          @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
             console.getOut().format("Loaded %s %s candles (%s green, %s red) till %s max bar height=%.1fpips average close=%.5f",
                     barCount, period, greenCount, barCount - greenCount, DateUtils.format(to), maxHeight/instrument.getPipValue(), avgClose).println();
             context.stop();
         }
          @Override
         public boolean stopJob() {
             return false;
         }
     });
 }
 instrument - instrument of the barsperiod - period of the barsside - side of the barsfilter - allows to filter candlesnumberOfCandlesBefore - how much candles to load before and including candle with time specified in time parametertime - 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 parameternumberOfCandlesAfter - how much candles to load after (not including) candle with time specified in time parameterbarListener - receives data about requested barsloadingProgress - used to control loading progressJFException - when period is not supported or time interval is not valid for specified periodgetBarStart(Period, long)java.util.List<ITick> getTicks(Instrument instrument, long from, long to) throws JFException
OutOfMemoryException
 
 
 ITick lastTick = history.getLastTick(Instrument.EURUSD);
 List <ITick> ticks = history.getTicks(Instrument.EURUSD, lastTick.getTime() - 10 * 1000, lastTick.getTime());
 int last = ticks.size() - 1;
 console.getOut().format(
     "Tick count=%s; Latest bid price=%.5f, time=%s; Oldest bid price=%.5f, time=%s", 
     ticks.size(), ticks.get(last).getBid(), DateUtils.format(ticks.get(last).getTime()), ticks.get(0).getBid(), DateUtils.format(ticks.get(last).getTime())
 ).println();
 instrument - instrument of the ticksfrom - start of the time interval for which ticks should be loadedto - end time of the time interval for which ticks should be loaded. If there is tick with time equals to the time in to
        parameter then it will be loaded as wellJFException - when some error occurs when loading datajava.util.List<ITick> getTicks(Instrument instrument, int numberOfOneSecondIntervalsBefore, long time, int numberOfOneSecondIntervalsAfter) throws JFException
OutOfMemoryExceptioninstrument - instrument of the ticksnumberOfOneSecondIntervalsBefore - how much one second interval of ticks to load before and including one second interval of ticks with time specified in time parametertime - 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 parameternumberOfOneSecondIntervalsAfter - how much one second tick intervals to load after (not including) one second tick interval with time specified in time parameterJFException - when some error occurs when loading datajava.util.List<IBar> getBars(Instrument instrument, Period period, OfferSide side, long from, long to) throws JFException
OutOfMemoryException
 
 Consider getting 5 bars over a time interval:
 long prevBarTime = history.getPreviousBarStart(Period.ONE_HOUR, history.getLastTick(Instrument.EURUSD).getTime());
 long startTime =  history.getTimeForNBarsBack(Period.ONE_HOUR, prevBarTime, 5);  
 List <IBar> bars = history.getBars(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, startTime, prevBarTime);
 int last = bars.size() - 1;
 console.getOut().format(
          "Previous bar close price=%.5f; 4th to previous bar close price=%.5f", 
          bars.get(last).getClose(), bars.get(0).getClose()
 ).println();
 
 Consider getting daily bars over several months:
 
 SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyy HH:mm:ss"); 
 dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); 
 Date dateFrom, dateTo;
 try { 
     dateFrom = dateFormat.parse("04/06/2013 00:00:00"); 
     dateTo = dateFormat.parse("04/10/2013 00:00:00");
 } catch (ParseException e) {
     e.printStackTrace();
     return;
 }    
 List <IBar> bars = history.getBars(Instrument.EURUSD, Period.DAILY, OfferSide.ASK, dateFrom.getTime(), dateTo.getTime());
 console.getOut().format("bar FROM=%s; bar TO=%s", bars.get(0), bars.get(bars.size() - 1)).println();
 instrument - instrument of the barsperiod - period of the barsside - side of the barsfrom - start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
        See getBarStart(Period, long) description if you want to get bar starting time for candle that includes specific timeto - end time of the time interval for which bars should be loaded. This is the starting time of the last candle to be loadedJFException - when period is not supported or some error occurs when loading datajava.util.List<IBar> getBars(Instrument instrument, Period period, OfferSide side, Filter filter, long from, long to) throws JFException
OutOfMemoryExceptioninstrument - instrument of the barsperiod - period of the barsside - side of the barsfilter - bars filtering method see Filterfrom - 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 loadedJFException - when period is not supported or some error occurs when loading datajava.util.List<IBar> getBars(Instrument instrument, Period period, OfferSide side, Filter filter, int numberOfCandlesBefore, long time, int numberOfCandlesAfter) throws JFException
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
 Consider getting 5 bars over a candle interval:
 long prevBarTime = history.getPreviousBarStart(Period.ONE_HOUR, history.getLastTick(Instrument.EURUSD).getTime());
 List <IBar> bars = history.getBars(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, Filter.NO_FILTER, 5, prevBarTime, 0);
 int last = bars.size() - 1;
 console.getOut().format(
         "Previous bar close price=%.5f; 4th to previous bar close price=%.5f", 
         bars.get(last).getClose(), bars.get(0).getClose()).println();
 instrument - instrument of the barsperiod - period of the barsside - side of the barsfilter - allows to filter candlesnumberOfCandlesBefore - how much candles to load before and including candle with time specified in time parametertime - 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 > 0numberOfCandlesAfter - how much candles to load after (not including) candle with time specified in time parameterJFException - when period is not supported or some error occurs when loading datalong getBarStart(Period period, long time) throws JFException
time parameterperiod - period of the bartime - time that is included by the barJFException - when period is not supportedlong getNextBarStart(Period period, long barTime) throws JFException
barTime parameterperiod - period of the barbarTime - time that is included by the bar previous to the returnedJFException - when period is not supportedlong getPreviousBarStart(Period period, long barTime) throws JFException
barTime parameterperiod - period to the barbarTime - time that is included by the bar next to the returnedJFException - when period is not supportedlong getTimeForNBarsBack(Period period, long to, int numberOfBars) throws JFException
numberOfBars - 1 back in time to the bar that includes time specified in
 to parameter. Method can be used to get time for the from parameter for getBars(com.dukascopy.api.Instrument, com.dukascopy.api.Period, com.dukascopy.api.OfferSide, long, long)
 method when is known time of the last bar and number of candles that needs to be loadedperiod - period of the barsto - time of the last barnumberOfBars - number of bars that could be loaded when passing returned time and time specified in to parameter in
        getBars(com.dukascopy.api.Instrument, com.dukascopy.api.Period, com.dukascopy.api.OfferSide, long, long) methodJFException - when period is not supportedlong getTimeForNBarsForward(Period period, long from, int numberOfBars) throws JFException
numberOfBars - 1 in the future to the bar that includes time specified in
 from parameter. Method can be used to get time for the to parameter for getBars(com.dukascopy.api.Instrument, com.dukascopy.api.Period, com.dukascopy.api.OfferSide, long, long)
 method when is known time of the first bar and number of candles that needs to be loadedperiod - period of the barsfrom - time of the first barnumberOfBars - number of bars that could be loaded when passing returned time and time specified in from parameter in
        getBars(com.dukascopy.api.Instrument, com.dukascopy.api.Period, com.dukascopy.api.OfferSide, long, long) methodJFException - when period is not supportedvoid readOrdersHistory(Instrument instrument, long from, long to, LoadingOrdersListener ordersListener, LoadingProgressListener loadingProgress) throws JFException
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 JFExceptioninstrument - instrument of the ordersfrom - start of the time interval for which orders should be loadedto - end time of the time interval for which orders should be loadedordersListener - receives data about requested ordersloadingProgress - used to control loading progressJFException - in case of any system errorgetOrdersHistory(Instrument instrument, long from, long to)java.util.List<IOrder> getOrdersHistory(Instrument instrument, long from, long to) throws JFException
instrument - instrument of the ordersfrom - start of the time interval for which orders should be loadedto - end time of the time interval for which orders should be loadedJFException - in case of any system errorIOrder getHistoricalOrderById(java.lang.String id) throws JFException
id - closed order's position idnull if there is no one.JFException - in case of any system errorjava.util.List<IOrder> getOpenOrders(Instrument instrument, long from, long to)
instrument - instrument of the ordersfrom - start of the time interval for which orders should be loadedto - end time of the time interval for which orders should be loadeddouble getEquity()
ITick getTick(Instrument instrument, int shift) throws JFException
shift
 parameter, 0 - current tick, 1 - previous tick.
 
 
 ITick tick0 = history.getTick(Instrument.EURUSD, 0);
 ITick tick1 = history.getTick(Instrument.EURUSD, 1);
 console.getOut().format("last tick: %s; previous tick: %s", tick0, tick1).println();   
 instrument - instrument of the tickshift - number of tick back in time staring from current tick. 1 - previous tick, 2 - current tick minus 2 ticks and so onJFException - when instrument is not active (not opened in platform) or other errorsITimedData getFeedData(IFeedDescriptor feedDescriptor, int shift) throws JFException
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.feedDescriptor - holds parameters: data type, instrument, offer side, etc (depends on bar type), and describes what kind of bars must be loadedshift - number of bars back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so onFeedDescriptor.getDataType()JFException - when some error occurs when loading data<T extends ITimedData> T getFeedData(ITailoredFeedDescriptor<T> feedDescriptor, int shift) throws JFException
T - type of data feed elementfeedDescriptor - feed descriptor for corresponding data typeshift - number of bars back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so onJFException - when some error occurs when loading datagetFeedData(IFeedDescriptor, int)<T extends ITimedData> T getFeedData(ITailoredFeedInfo<T> feedInfo, int shift) throws JFException
T - type of data feed elementfeedInfo - feed info for corresponding data typeshift - number of bars back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so onJFException - when some error occurs when loading datagetFeedData(IFeedDescriptor, int)java.util.List<ITimedData> getFeedData(IFeedDescriptor feedDescriptor, long from, long to) throws JFException
OutOfMemoryExceptionfeedDescriptor - holds parameters: data type, instrument, offer side, etc (depends on bar type), and describes what kind of bars must be loadedfrom - start of the time interval for which bars should be loadedto - 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 wellJFException - when incorrect time interval is passed or some error occurs when loading data<T extends ITimedData> java.util.List<T> getFeedData(ITailoredFeedDescriptor<T> feedDescriptor, long from, long to) throws JFException
T - type of data feed elementfeedDescriptor - feed descriptor for corresponding data typefrom - start of the time interval for which bars should be loadedto - 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 wellJFException - when incorrect time interval is passed or some error occurs when loading datagetFeedData(IFeedDescriptor, long, long)java.util.List<ITimedData> getFeedData(IFeedDescriptor feedDescriptor, int numberOfFeedBarsBefore, long time, int numberOfFeedBarsAfter) throws JFException
OutOfMemoryException.feedDescriptor - holds parameters: data type, instrument, offer side, etc (depends on bar type), and describes what kind of bars must be loadednumberOfFeedBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfFeedBarsAfter - how much bars to load after (not including) bar with time specified in time parameterJFException - when some error occurs when loading data<T extends ITimedData> java.util.List<T> getFeedData(ITailoredFeedDescriptor<T> feedDescriptor, int numberOfFeedBarsBefore, long time, int numberOfFeedBarsAfter) throws JFException
T - type of data feed elementfeedDescriptor - feed descriptor for corresponding data typenumberOfFeedBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfFeedBarsAfter - how much bars to load after (not including) bar with time specified in time parameterJFException - when some error occurs when loading datagetFeedData(ITailoredFeedDescriptor, int, long, int)void readFeedData(IFeedDescriptor feedDescriptor, long from, long to, IFeedListener feedListener, LoadingProgressListener loadingProgress) throws JFException
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
 
 Consider analyzing the last weeks renko bricks - namely calculating the average close price
 private IHistory history;
 private IConsole console;
 private Instrument instrument = Instrument.EURUSD;
 private IFeedDescriptor feedDescriptor = new RenkoFeedDescriptor(instrument, PriceRange.TWO_PIPS, OfferSide.ASK);
 private double avgPrice = 0;
 private int itemCount = 0;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     final long to = history.getFeedData(feedDescriptor, 1).getTime();
     final long from = to - Period.DAILY.getInterval() * 7;
     history.readFeedData(
         feedDescriptor,
         from,
         to,
         new IFeedListener() {
              @Override
             public void onFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData) {
                 itemCount++;
                 double price = feedDescriptor.getDataType() == DataType.TICKS
                         ? ((ITick)feedData).getBid()
                         : ((IBar)feedData).getClose();
                 avgPrice = itemCount == 1 ? price : round(avgPrice + ((price - avgPrice) / (double)itemCount));
             }
             private double round(double amount) {
                 return (new BigDecimal(amount)).setScale(instrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
             }
         },
         new LoadingProgressListener() {
              @Override
             public void dataLoaded(long start, long end, long currentPosition, String information) {
             }
              @Override
             public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
                 console.getOut().format("Loaded %s %s %s  - %s average %s=%.5f    feed descriptor=%s",
                         itemCount,
                         feedDescriptor.getDataType(),
                         DateUtils.format(from),
                         DateUtils.format(to),
                         feedDescriptor.getDataType() == DataType.TICKS ? "bid" : "close",
                         avgPrice,
                         feedDescriptor
                 ).println();
                context.stop();
             }
              @Override
             public boolean stopJob() {
                 return false;
             }
         }
     );
 }
 feedDescriptor - feed descriptor of the feed datafrom - 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 itemsloadingProgress - used to control loading progressJFException - when some errors occurs<T extends ITimedData> void readFeedData(ITailoredFeedDescriptor<T> feedDescriptor, long from, long to, ITailoredFeedListener<T> feedListener, LoadingProgressListener loadingProgress) throws JFException
 private IHistory history;
 private IConsole console;
 Instrument instrument = Instrument.EURUSD;
 ITailoredFeedDescriptor <IRenkoBar> feedDescriptor = new RenkoFeedDescriptor(instrument, PriceRange.TWO_PIPS, OfferSide.ASK);
 double avgPrice = 0;
 int itemCount = 0;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     final long to = history.getFeedData(feedDescriptor, 1).getTime();
     final long from = to - Period.DAILY.getInterval() * 7;
     history.readFeedData(
         feedDescriptor,
         from,
         to,
         new ITailoredFeedListener <IRenkoBar>() {
              @Override
             public void onFeedData(ITailoredFeedDescriptor <IRenkoBar> feedDescriptor, IRenkoBar renko) {
                 itemCount++;
                 double price = renko.getClose();
                 avgPrice = itemCount == 1 ? price : round(avgPrice + ((price - avgPrice) / (double)itemCount));
             }
             private double round(double amount) {
                 return (new BigDecimal(amount)).setScale(instrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
             }
         },
         new LoadingProgressListener() {
              @Override
             public void dataLoaded(long start, long end, long currentPosition, String information) {
             }
              @Override
             public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
                 console.getOut().format("Loaded %s Renkos %s  - %s average close=%.5f    feed descriptor=%s",
                         itemCount,
                         DateUtils.format(from),
                         DateUtils.format(to),
                         avgPrice,
                         feedDescriptor
                 ).println();
                 context.stop();
             }
              @Override
             public boolean stopJob() {
                 return false;
             }
         }
     );
 }
 T - type of data feed elementfeedDescriptor - feed descriptor of the feed datafrom - start of the time interval for which feed data items should be loadedto - end time of the time interval for which feed data items should be loadedfeedListener - receives data about requested feed data itemsloadingProgress - used to control loading progressJFException - when some errors occursreadFeedData(IFeedDescriptor, long, long, IFeedListener, LoadingProgressListener)void readFeedData(IFeedDescriptor feedDescriptor, int numberOfFeedDataBefore, long time, int numberOfFeedDataAfter, IFeedListener feedListener, LoadingProgressListener loadingProgress) throws JFException
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
 
 Consider analyzing the last 1000 renko bricks - namely calculating the average close price
 private IHistory history;
 private IConsole console;
 private Instrument instrument = Instrument.EURUSD;
 private IFeedDescriptor feedDescriptor = new RenkoFeedDescriptor(Instrument.EURUSD, PriceRange.TWO_PIPS, OfferSide.ASK);
 private double avgPrice = 0;
 private int itemCount = 0;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     final long to = history.getFeedData(feedDescriptor, 1).getTime();
     history.readFeedData(
         feedDescriptor,
         1000,
         to,
         0,
         new IFeedListener() {
              @Override
             public void onFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData) {
                 itemCount++;
                 double price = feedDescriptor.getDataType() == DataType.TICKS
                       ? ((ITick)feedData).getBid()
                       : ((IBar)feedData).getClose();
                 avgPrice = itemCount == 1 ? price : round(avgPrice + ((price - avgPrice) / (double)itemCount));
             }
             private double round(double amount) {
                 return (new BigDecimal(amount)).setScale(instrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
             }
         },
         new LoadingProgressListener() {
              @Override
             public void dataLoaded(long start, long end, long currentPosition, String information) {
             }
              @Override
             public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
                 console.getOut().format("Loaded %s %s till %s average %s=%.5f    feed descriptor=%s",
                       itemCount,
                       feedDescriptor.getDataType(),
                       DateUtils.format(to),
                       feedDescriptor.getDataType() == DataType.TICKS ? "bid" : "close",
                       avgPrice,
                       feedDescriptor
                 ).println();
                 context.stop();
             }
              @Override
             public boolean stopJob() {
                 return false;
             }
         }
     );
 }
 feedDescriptor - feed descriptor of the feed datanumberOfFeedDataBefore - how much feed data items to load before and including feed data item with time specified in time parametertime - 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 parameternumberOfFeedDataAfter - how much feed data items to load after (not including) feed data item with time specified in time parameterfeedListener - receives feed dataloadingProgress - used to control loading progressJFException - when some errors occurs<T extends ITimedData> void readFeedData(ITailoredFeedDescriptor<T> feedDescriptor, int numberOfFeedDataBefore, long time, int numberOfFeedDataAfter, ITailoredFeedListener<T> feedListener, LoadingProgressListener loadingProgress) throws JFException
 private IHistory history;
 private IConsole console;
 private Instrument instrument = Instrument.EURUSD;
 private ITailoredFeedDescriptor <IRenkoBar> feedDescriptor = new RenkoFeedDescriptor(Instrument.EURUSD, PriceRange.TWO_PIPS, OfferSide.ASK);
 private double avgPrice = 0;
 private int itemCount = 0;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     final long to = history.getFeedData(feedDescriptor, 1).getTime();
     history.readFeedData(
         feedDescriptor,
         1000,
         to,
         0,
         new ITailoredFeedListener <IRenkoBar>() {
              @Override
             public void onFeedData(ITailoredFeedDescriptor <IRenkoBar> feedDescriptor, IRenkoBar renko) {
                 itemCount++;
                 double price = renko.getClose();
                 avgPrice = itemCount == 1 ? price : round(avgPrice + ((price - avgPrice) / (double)itemCount));
             }
             private double round(double amount) {
                  return (new BigDecimal(amount)).setScale(instrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
             }
         },
         new LoadingProgressListener() {
              @Override
             public void dataLoaded(long start, long end, long currentPosition, String information) {
             }
              @Override
             public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
                 console.getOut().format("Loaded %s Renkos till %s average close=%.5f feed descriptor=%s",
                         itemCount,
                         DateUtils.format(to),
                         avgPrice,
                         feedDescriptor
                 ).println();
                 context.stop();
             }
              @Override
             public boolean stopJob() {
                 return false;
             }
         }
     );
 }
 T - type of data feed elementfeedDescriptor - feed descriptor of the feed datanumberOfFeedDataBefore - how much feed data items to load before and including feed data item with time specified in time parametertime - 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 parameternumberOfFeedDataAfter - how much feed data items to load after (not including) feed data item with time specified in time parameterfeedListener - receives feed dataloadingProgress - used to control loading progressJFException - when some errors occursreadFeedData(IFeedDescriptor, int, long, int, IFeedListener, LoadingProgressListener)<T extends ITimedData> java.util.stream.Stream<T> readFeedData(ITailoredFeedDescriptor<T> feedDescriptor, int numberOfFeedDataBefore, long time, int numberOfFeedDataAfter, LoadingProgressListener loadingProgressListener) throws JFException
 private IHistory history;
 private IConsole console;
 private Instrument instrument = Instrument.EURUSD;
 public void onStart(IContext context) throws JFException {
     this.history = context.getHistory();
     this.console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     RenkoFeedDescriptor renkoFeedDescriptor = new RenkoFeedDescriptor(
             instrument,
             PriceRange.TWO_PIPS,
             OfferSide.ASK);
     ITimedData feedData = history.getFeedData(renkoFeedDescriptor, 1);
     double average = history.readFeedData(renkoFeedDescriptor, 10, feedData.getTime(), 0)
             .mapToDouble(renkoBar -> renkoBar.getClose())
             .average()
             .getAsDouble();
     console.getOut().format("Average renko close pirce is %s", average).println();
     context.stop();
 }
 T - type of data feed elementfeedDescriptor - feed descriptor of the feed datanumberOfFeedDataBefore - how much feed data items to load before and including feed data item with time specified in time parametertime - 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 parameternumberOfFeedDataAfter - how much feed data items to load after (not including) feed data item with time specified in time parameterloadingProgressListener - used to control loading progressJFException - when some errors occurs<T extends ITimedData> java.util.stream.Stream<T> readFeedData(ITailoredFeedDescriptor<T> feedDescriptor, long from, long to, LoadingProgressListener loadingProgressListener) throws JFException
 private IHistory history;
 private IConsole console;
 private Instrument instrument = Instrument.EURUSD;
 public void onStart(IContext context) throws JFException {
     this.history = context.getHistory();
     this.console = context.getConsole();
     context.setSubscribedInstruments(Collections.singleton(instrument), true);
     RenkoFeedDescriptor renkoFeedDescriptor = new RenkoFeedDescriptor(
             instrument,
             PriceRange.TWO_PIPS,
             OfferSide.ASK);
     ITimedData feedData10 = history.getFeedData(renkoFeedDescriptor, 10);
     ITimedData feedData1 = history.getFeedData(renkoFeedDescriptor, 1);
     LoadingProgressListener loadingProgressListener = new LoadingProgressListener() {
         @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
         @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
         }
         @Override
         public boolean stopJob() {
             return false;
         }
     };
     double average = history.readFeedData(
             renkoFeedDescriptor, feedData10.getTime(), feedData1.getTime(), loadingProgressListener)
             .mapToDouble(renkoBar -> renkoBar.getClose())
             .average()
             .getAsDouble();
     console.getOut().format("Average renko close pirce is %s", average).println();
     context.stop();
 }
 T - type of data feed elementfeedDescriptor - feed descriptor of the feed datafrom - start of the time interval for which feed data items should be loadedto - end time of the time interval for which feed data items should be loadedloadingProgressListener - used to control loading progressJFException - when some errors occurs@Deprecated void readTicks(IFinancialInstrument financialInstrument, int numberOfOneSecondIntervalsBefore, long time, int numberOfOneSecondIntervalsAfter, LoadingDataListener tickListener, LoadingProgressListener loadingProgress) throws JFException
tickListener. LoadingProgressListener is
 used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error
 This method has two main purposes: one is to load a lot of ticks without keeping them all in memory, and second is asynchronous processingfinancialInstrument - financial instrument of the ticksnumberOfOneSecondIntervalsBefore - how much one second interval of ticks to load before and including one second interval of ticks with time specified in time parametertime - 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 parameternumberOfOneSecondIntervalsAfter - how much one second tick intervals to load after (not including) one second tick interval with time specified in time parametertickListener - receives data about requested ticksloadingProgress - used to control loading progressJFException - when some errors occurs@Deprecated java.util.List<IBar> getBars(IFinancialInstrument financialInstrument, Period period, OfferSide side, Filter filter, long from, long to) throws JFException
OutOfMemoryExceptionfinancialInstrument - instrument of the barsperiod - period of the barsside - side of the barsfilter - bars filtering method see Filterfrom - 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 loadedJFException - when period is not supported or some error occurs when loading data@Deprecated java.util.List<ITimedData> getFeedData(IFeedInfo feedInfo, long from, long to) throws JFException
OutOfMemoryExceptionfeedInfo - holds parameters: data type, financial instrument, offer side, etc (depends on bar type), and describes what kind of bars must be loadedfrom - start of the time interval for which bars should be loadedto - 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 wellJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated <T extends ITimedData> java.util.List<T> getFeedData(ITailoredFeedInfo<T> feedInfo, long from, long to) throws JFException
T - type of data feed elementfeedInfo - feed info for corresponding data typefrom - start of the time interval for which bars should be loadedto - 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 wellJFException - when incorrect time interval is passed or some error occurs when loading datagetFeedData(IFeedInfo, long, long)@Deprecated long getTimeOfLastTick(IFinancialInstrument financialInstrument) throws JFException
financialInstrument - instrument of the tickJFException - when instrument is not active (not opened in platform)@Deprecated ITick getLastTick(IFinancialInstrument financialInstrument) throws JFException
financialInstrument - instrument of the tickJFException - when instrument is not active (not opened in platform)@Deprecated long getStartTimeOfCurrentBar(IFinancialInstrument financialInstrument, Period period) throws JFException
financialInstrument - instrument of the barperiod - period of the barJFException - when period is not supported or instrument is not active (not opened in platform)@Deprecated IBar getBar(IFinancialInstrument financialInstrument, Period period, OfferSide side, int shift) throws JFException
shift
 parameter, 0 - current bar (currently generated from ticks), 1 - previous bar (last formed bar) If there is no bar loaded at that
 position, then function returns null.
 consider getting the previous one hour bar
 private IHistory history;
 private IConsole console;
 Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     IFinancialInstrumentProvider instrumentProvider = context.getFinancialInstrumentProvider();
     IFinancialInstrument financialInstrument = instrumentProvider.getFinancialInstrument("EUR/USD");
     IBar prevBar = history.getBar(financialInstrument, Period.ONE_HOUR, OfferSide.BID, 1);
     console.getOut().println(prevBar);
 }
 financialInstrument - instrument of the barperiod - period of the barside - bid or ask side of the barshift - number of candle back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so onJFException - when period is not supported or instrument is not active (not opened in platform)@Deprecated void readTicks(IFinancialInstrument financialInstrument, long from, long to, DataLoadingListener tickListener, LoadingProgressListener loadingProgress) throws JFException
tickListener. LoadingProgressListener is
 used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error.
 This method has two main purposes: one is to load a lot of ticks without keeping them all in memory, and second is asynchronous processing
 Consider analyzing the last days ticks - namely calculating the average ask price and the maximum bid
     private IHistory history;
     private IConsole console;
     double maxBid = Double.MIN_VALUE;
     double avgAsk = 0;
     int tickCount = 0;
      @Override
     public void onStart(final IContext context) throws JFException {
         history = context.getHistory();
         console = context.getConsole();
         IFinancialInstrumentProvider instrumentProvider = context.getFinancialInstrumentProvider();
         final IFinancialInstrument financialInstrument = instrumentProvider.getFinancialInstrument("EUR/USD");
         context.setSubscribedFinancialInstruments(Collections.singleton(financialInstrument), true);
         final long from = history.getLastTick(financialInstrument).getTime() - Period.DAILY.getInterval();
         final long to = history.getLastTick(financialInstrument).getTime();
         history.readTicks(financialInstrument, from, to,
             new LoadingFinancialDataListener() {
                  @Override
                 public void newTick(IFinancialInstrument financialInstrument, long time, double ask, double bid, double askVol, double bidVol) {
                     tickCount++;
                     maxBid = Math.max(bid, maxBid);
                     avgAsk = tickCount == 1 ? ask : round(avgAsk + ((avgAsk - ask) / (double)tickCount));
                 }
                 private double round(double amount) {
                     return (new BigDecimal(amount)).setScale(financialInstrument.getPipScale(), BigDecimal.ROUND_HALF_UP).doubleValue();
                 }
                  @Override
                 public void newBar(IFinancialInstrument financialInstrument, Period period, OfferSide side, long time, double open, double close, double low, double high, double vol) {
                     // no bars expected
                 }
             },
             new LoadingProgressListener() {
                  @Override
                 public void dataLoaded(long start, long end, long currentPosition, String information) {
                 }
                  @Override
                 public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
                     console.getOut().format("Loaded %s ticks %s - %s max Bid=%.5f average ask=%.5f",
                     tickCount, DateUtils.format(from), DateUtils.format(to), maxBid, avgAsk).println();
                     context.stop();
                 }
                  @Override
                 public boolean stopJob() {
                     return false;
                 }
             });
         }
 financialInstrument - instrument of the ticksfrom - start of the time interval for which ticks should be loadedto - end time of the time interval for which ticks should be loaded. If there is tick with time equals to the time in to
        parameter then it will be loaded as welltickListener - receives data about requested ticksloadingProgress - used to control loading processJFException - when some error occurs while creating internal request for data@Deprecated void readBars(IFinancialInstrument financialInstrument, Period period, OfferSide side, long from, long to, DataLoadingListener barListener, LoadingProgressListener loadingProgress) throws JFException
barListener. LoadingProgressListener is
 used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error
 This method has two main purposes: one is to load a lot of bars without keeping them all in memory, and second is asynchronous processing
 Consider analyzing the last weeks 1 minute bars - namely calculating the average close price and the maximum bar size
 private IHistory history;
 private IConsole console;
 double maxHeight = Double.MIN_VALUE, avgClose = 0;
 int barCount, greenCount;
 private Period period = Period.ONE_MIN;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     IFinancialInstrumentProvider instrumentProvider = context.getFinancialInstrumentProvider();
     final IFinancialInstrument financialInstrument = instrumentProvider.getFinancialInstrument("EUR/USD");
     context.setSubscribedFinancialInstruments(Collections.singleton(financialInstrument), true);
     long lastTickTime = history.getLastTick(financialInstrument).getTime();
     final long from = history.getBarStart(period, lastTickTime - Period.DAILY.getInterval() * 7);
     final long to = history.getTimeForNBarsBack(period, lastTickTime, 2);
     history.readBars(financialInstrument, period, OfferSide.BID, from, to,
         new LoadingFinancialDataListener() {
              @Override
             public void newTick(IFinancialInstrument financialInstrument, long time, double ask, double bid, double askVol, double bidVol) {}
              @Override
             public void newBar(IFinancialInstrument financialInstrument, Period period, OfferSide side, long time, double open, double close, double low, double high, double vol) {
                 barCount++;
                 maxHeight = Math.max(Math.abs(open - close), maxHeight);
                 avgClose = barCount == 1 ? close : round(avgClose + ((close - avgClose) / (double)barCount));
                 if(close - open > 0){
                     greenCount++;
                 }
             }
             private double round(double amount) {
                 return (new BigDecimal(amount)).setScale(financialInstrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
             }
         },
         new LoadingProgressListener() {
              @Override
             public void dataLoaded(long start, long end, long currentPosition, String information) {
             }
              @Override
             public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
                 console.getOut().format("Loaded %s %s candles (%s green, %s red) %s  - %s max bar height=%.1fpips average close=%.5f",
                         barCount, period, greenCount, barCount - greenCount, DateUtils.format(from), DateUtils.format(to), maxHeight/financialInstrument.getPipValue(), avgClose).println();
                 context.stop();
             }
              @Override
             public boolean stopJob() {
                 return false;
             }
         });
 }
 financialInstrument - instrument of the barsperiod - period of the barsside - side of the barsfrom - start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
        See getBarStart(Period, long) description if you want to get bar starting time for bar that includes specific timeto - end time of the time interval for which bars should be loaded. This is the starting time of the last bar to be loadedbarListener - receives data about requested barsloadingProgress - used to control loading progressJFException - when period is not supported or time interval is not valid for specified periodgetBarStart(Period, long)@Deprecated void readBars(IFinancialInstrument financialInstrument, Period period, OfferSide side, Filter filter, long from, long to, DataLoadingListener barListener, LoadingProgressListener loadingProgress) throws JFException
barListener.
 LoadingProgressListener is used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error
 This method has two main purposes: one is to load a lot of bars without keeping them all in memory, and second is asynchronous processing
 Consider analyzing the last weeks 1 minute bars - namely calculating the average close price and the maximum bar size
 int barCount = 0;
 int greenCount = 0;
  @Override
 public void onStart(final IContext context) throws JFException {
         history = context.getHistory();
         console = context.getConsole();
         IFinancialInstrumentProvider instrumentProvider = context.getFinancialInstrumentProvider();
         final IFinancialInstrument financialInstrument = instrumentProvider.getFinancialInstrument("EUR/USD");
         context.setSubscribedFinancialInstruments(Collections.singleton(financialInstrument), true);
         long lastTickTime = history.getLastTick(financialInstrument).getTime();
         final long from = history.getBarStart(period, lastTickTime - Period.DAILY.getInterval() * 7);
         final long to = history.getTimeForNBarsBack(period, lastTickTime, 2);
         history.readBars(financialInstrument, period, OfferSide.BID, Filter.WEEKENDS, from, to,
                 new LoadingFinancialDataListener() {
                          @Override
                         public void newTick(IFinancialInstrument financialInstrument, long time, double ask, double bid, double askVol, double bidVol) {}
                          @Override
                         public void newBar(IFinancialInstrument financialInstrument, Period period, OfferSide side, long time, double open, double close, double low, double high, double vol) {
                                 barCount++;
                                 maxHeight = Math.max(Math.abs(open - close), maxHeight);
                                 avgClose = barCount == 1 ? close : round(avgClose + ((close - avgClose) / (double)barCount));
                                 if(close - open > 0){
                                        greenCount++;
                                }
                         }
                         private double round(double amount) {
                                return (new BigDecimal(amount)).setScale(financialInstrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
                         }
                 },
                 new LoadingProgressListener() {
                          @Override
                         public void dataLoaded(long start, long end, long currentPosition, String information) {
                         }
                          @Override
                         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
                                 console.getOut().format("Loaded %s %s candles (%s green, %s red) %s  - %s max bar height=%.1fpips average close=%.5f",
                                 barCount, period, greenCount, barCount - greenCount, DateUtils.format(from), DateUtils.format(to), maxHeight/financialInstrument.getPipValue(), avgClose).println();
                                 context.stop();
                         }
                          @Override
                         public boolean stopJob() {
                                 return false;
                         }
                 }
         );
 }
 financialInstrument - instrument of the barsperiod - period of the barsside - side of the barsfilter - bars filtering method see Filterfrom - start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
        See getBarStart(Period, long) description if you want to get bar starting time for bar that includes specific timeto - end time of the time interval for which bars should be loaded. This is the starting time of the last bar to be loadedbarListener - receives data about requested barsloadingProgress - used to control loading progressJFException - when period is not supported or time interval is not valid for specified periodgetBarStart(Period, long)@Deprecated void readBars(IFinancialInstrument financialInstrument, Period period, OfferSide side, Filter filter, int numberOfCandlesBefore, long time, int numberOfCandlesAfter, DataLoadingListener barListener, LoadingProgressListener loadingProgress) throws JFException
barListener. LoadingProgressListener is
 used to receive feedback about loading progress, to cancel loading and its method
 LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error
 This method has two main purposes: one is to load a lot of bars without keeping them all in memory, and second is asynchronous processing
 Consider analyzing the 100000 1 minute bars - namely calculating the average close price and the maximum bar size
 private IHistory history;
 private IConsole console;
 double maxHeight = Double.MIN_VALUE, avgClose = 0;
 int barCount, greenCount;
 private Period period = Period.ONE_MIN;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     IFinancialInstrumentProvider instrumentProvider = context.getFinancialInstrumentProvider();
     final IFinancialInstrument financialInstrument = instrumentProvider.getFinancialInstrument("EUR/USD");
     context.setSubscribedFinancialInstruments(Collections.singleton(financialInstrument), true);
     long lastTickTime = history.getLastTick(financialInstrument).getTime();
     final long to = history.getTimeForNBarsBack(period, lastTickTime, 2);
     history.readBars(financialInstrument, period, OfferSide.BID, Filter.WEEKENDS, 100000, to, 0,
     new LoadingFinancialDataListener() {
          @Override
         public void newTick(IFinancialInstrument financialInstrument, long time, double ask, double bid, double askVol, double bidVol) {}
          @Override
         public void newBar(IFinancialInstrument financialInstrument, Period period, OfferSide side, long time, double open, double close, double low, double high, double vol) {
             barCount++;
             maxHeight = Math.max(Math.abs(open - close), maxHeight);
             avgClose = barCount == 1 ? close : round(avgClose + ((close - avgClose) / (double)barCount));
             if(close - open > 0){
                 greenCount++;
             }
         }
         private double round(double amount) {
             return (new BigDecimal(amount)).setScale(financialInstrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
         }
     },
     new LoadingProgressListener() {
          @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
          @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
             console.getOut().format("Loaded %s %s candles (%s green, %s red) till %s max bar height=%.1fpips average close=%.5f",
                     barCount, period, greenCount, barCount - greenCount, DateUtils.format(to), maxHeight/financialInstrument.getPipValue(), avgClose).println();
             context.stop();
         }
          @Override
         public boolean stopJob() {
             return false;
         }
     });
 }
 financialInstrument - instrument of the barsperiod - period of the barsside - side of the barsfilter - allows to filter candlesnumberOfCandlesBefore - how much candles to load before and including candle with time specified in time parametertime - 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 parameternumberOfCandlesAfter - how much candles to load after (not including) candle with time specified in time parameterbarListener - receives data about requested barsloadingProgress - used to control loading progressJFException - when period is not supported or time interval is not valid for specified periodgetBarStart(Period, long)@Deprecated java.util.List<ITick> getTicks(IFinancialInstrument financialInstrument, long from, long to) throws JFException
OutOfMemoryException
 
  @Override
 public void onStart(final IContext context) throws JFException {
     this.history = context.getHistory();
     this.console = context.getConsole();
     IFinancialInstrumentProvider instrumentProvider = context.getFinancialInstrumentProvider();
     IFinancialInstrument financialInstrument = instrumentProvider.getFinancialInstrument("EUR/USD");
     ITick lastTick = history.getLastTick(financialInstrument);
     List <ITick> = history.getTicks(financialInstrument, lastTick.getTime() - 10 * 1000, lastTick.getTime());
     int last = ticks.size() - 1;
     console.getOut().format("Tick count=%s; Latest bid price=%.5f, time=%s; Oldest bid price=%.5f, time=%s",
         ticks.size(), ticks.get(last).getBid(), DateUtils.format(ticks.get(last).getTime()), ticks.get(0).getBid(), DateUtils.format(ticks.get(last).getTime()) ).println();
 }
 financialInstrument - instrument of the ticksfrom - start of the time interval for which ticks should be loadedto - end time of the time interval for which ticks should be loaded. If there is tick with time equals to the time in to
        parameter then it will be loaded as wellJFException - when some error occurs when loading data@Deprecated java.util.List<ITick> getTicks(IFinancialInstrument financialInstrument, int numberOfOneSecondIntervalsBefore, long time, int numberOfOneSecondIntervalsAfter) throws JFException
OutOfMemoryExceptionfinancialInstrument - instrument of the ticksnumberOfOneSecondIntervalsBefore - how much one second interval of ticks to load before and including one second interval of ticks with time specified in time parametertime - 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 parameternumberOfOneSecondIntervalsAfter - how much one second tick intervals to load after (not including) one second tick interval with time specified in time parameterJFException - when some error occurs when loading data@Deprecated java.util.List<IBar> getBars(IFinancialInstrument financialInstrument, Period period, OfferSide side, long from, long to) throws JFException
OutOfMemoryException
 Consider getting 5 bars over a time interval:
 private IHistory history;
 private IConsole console;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     IFinancialInstrumentProvider instrumentProvider = context.getFinancialInstrumentProvider();
     final IFinancialInstrument financialInstrument = instrumentProvider.getFinancialInstrument("EUR/USD");
     long prevBarTime = history.getPreviousBarStart(Period.ONE_HOUR, history.getLastTick(financialInstrument).getTime());
     long startTime =  history.getTimeForNBarsBack(Period.ONE_HOUR, prevBarTime, 5);
     List <IBar> bars = history.getBars(financialInstrument, Period.ONE_HOUR, OfferSide.BID, startTime, prevBarTime);
     int last = bars.size() - 1;
     console.getOut().format(
         "Previous bar close price=%.5f; 4th to previous bar close price=%.5f",
             bars.get(last).getClose(), bars.get(0).getClose()
     ).println();
 }
 financialInstrument - instrument of the barsperiod - period of the barsside - side of the barsfrom - start of the time interval for which bars should be loaded. Should be the exact starting time of the bar for specified period.
        See getBarStart(Period, long) description if you want to get bar starting time for candle that includes specific timeto - end time of the time interval for which bars should be loaded. This is the starting time of the last candle to be loadedJFException - when period is not supported or some error occurs when loading data@Deprecated java.util.List<IBar> getBars(IFinancialInstrument financialInstrument, Period period, OfferSide side, Filter filter, int numberOfCandlesBefore, long time, int numberOfCandlesAfter) throws JFException
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
 Consider getting 5 bars over a candle interval:
 private IHistory history;
 private IConsole console;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     IFinancialInstrumentProvider instrumentProvider = context.getFinancialInstrumentProvider();
     IFinancialInstrument financialInstrument = instrumentProvider.getFinancialInstrument("EUR/USD");
     context.setSubscribedFinancialInstruments(Collections.singleton(financialInstrument), true);
     long prevBarTime = history.getPreviousBarStart(Period.ONE_HOUR, history.getLastTick(financialInstrument).getTime());
     List <IBar> bars = history.getBars(financialInstrument, Period.ONE_HOUR, OfferSide.BID, Filter.NO_FILTER, 5, prevBarTime, 0);
     int last = bars.size() - 1;
     console.getOut().format(
         "Previous bar close price=%.5f; 4th to previous bar close price=%.5f",
         bars.get(last).getClose(), bars.get(0).getClose()).println();
 }
 financialInstrument - instrument of the barsperiod - period of the barsside - side of the barsfilter - allows to filter candlesnumberOfCandlesBefore - how much candles to load before and including candle with time specified in time parametertime - 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 > 0numberOfCandlesAfter - how much candles to load after (not including) candle with time specified in time parameterJFException - when period is not supported or some error occurs when loading data@Deprecated void readOrdersHistory(IFinancialInstrument financialInstrument, long from, long to, OrdersLoadingListener ordersListener, LoadingProgressListener loadingProgress) throws JFException
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 JFExceptionfinancialInstrument - instrument of the ordersfrom - start of the time interval for which orders should be loadedto - end time of the time interval for which orders should be loadedordersListener - receives data about requested ordersloadingProgress - used to control loading progressJFException - in case of any system errorgetOrdersHistory(IFinancialInstrument financialInstrument, long from, long to)@Deprecated java.util.List<IOrder> getOrdersHistory(IFinancialInstrument financialInstrument, long from, long to) throws JFException
financialInstrument - instrument of the ordersfrom - start of the time interval for which orders should be loadedto - end time of the time interval for which orders should be loadedJFException - in case of any system error@Deprecated java.util.List<IOrder> getOpenOrders(IFinancialInstrument financialInstrument, long from, long to)
financialInstrument - instrument of the ordersfrom - start of the time interval for which orders should be loadedto - end time of the time interval for which orders should be loaded@Deprecated ITick getTick(IFinancialInstrument financialInstrument, int shift) throws JFException
shift
 parameter, 0 - current tick, 1 - previous tick.
 
 IFinancialInstrumentProvider instrumentProvider = context.getFinancialInstrumentProvider();
 final IFinancialInstrument financialInstrument = instrumentProvider.getFinancialInstrument("EUR/USD");
 ITick tick0 = history.getTick(financialInstrument, 0);
 ITick tick1 = history.getTick(financialInstrument, 1);
 console.getOut().format("last tick: %s; previous tick: %s", tick0, tick1).println();
 financialInstrument - instrument of the tickshift - number of tick back in time staring from current tick. 1 - previous tick, 2 - current tick minus 2 ticks and so onJFException - when instrument is not active (not opened in platform) or other errors@Deprecated ITimedData getFeedData(IFeedInfo feedInfo, int shift) throws JFException
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.feedInfo - holds parameters: data type, financial instrument, offer side, etc (depends on bar type), and describes what kind of bars must be loadedshift - number of bars back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so onIFeedInfo.getDataType()JFException - when some error occurs when loading data@Deprecated java.util.List<ITimedData> getFeedData(IFeedInfo feedInfo, int numberOfFeedBarsBefore, long time, int numberOfFeedBarsAfter) throws JFException
OutOfMemoryException.feedInfo - holds parameters: data type, financial instrument, offer side, etc (depends on bar type), and describes what kind of bars must be loadednumberOfFeedBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfFeedBarsAfter - how much bars to load after (not including) bar with time specified in time parameterJFException - when some error occurs when loading data@Deprecated <T extends ITimedData> java.util.List<T> getFeedData(ITailoredFeedInfo<T> feedInfo, int numberOfFeedBarsBefore, long time, int numberOfFeedBarsAfter) throws JFException
T - type of data feed elementfeedInfo - feed info for corresponding data typenumberOfFeedBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfFeedBarsAfter - how much bars to load after (not including) bar with time specified in time parameterJFException - when some error occurs when loading datagetFeedData(IFeedInfo, int, long, int)@Deprecated void readFeedData(IFeedInfo feedInfo, long from, long to, IFinancialFeedListener feedListener, LoadingProgressListener loadingProgress) throws JFException
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
 Consider analyzing the last weeks renko bricks - namely calculating the average close price
 private IHistory history;
 private IConsole console;
 private double avgPrice = 0;
 private int itemCount = 0;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     IFinancialInstrumentProvider financialInstrumentProvider = context.getFinancialInstrumentProvider();
     final IFinancialInstrument financialInstrument = financialInstrumentProvider.getFinancialInstrument("EUR/USD");
     context.setSubscribedFinancialInstruments(Collections.singleton(financialInstrument), true);
     final IFeedInfo feedInfo = new RenkoFeedInfo(financialInstrument, PriceRange.TWO_PIPS, OfferSide.ASK, Period.ONE_HOUR, CreationPoint.OPEN);
     final long from = history.getFeedData(feedInfo, 10).getTime();
     final long to = history.getFeedData(feedInfo, 1).getTime();
     IFinancialFeedListener tailoredFinancialFeedListener = new IFinancialFeedListener() {
          @Override
         public void onFeedData(IFeedInfo feedInfo, ITimedData feedData) {
             itemCount++;
             double price = ((IRenkoBar) feedData).getClose();
             avgPrice = itemCount == 1 ? price : round(avgPrice + ((price - avgPrice) / (double) itemCount));
         }
         private double round(double amount) {
             return (new BigDecimal(amount)).setScale(financialInstrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
         }
     };
     LoadingProgressListener loadingProgressListener = new LoadingProgressListener() {
          @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
          @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
             console.getOut().format("Loaded %s Renkos till %s average close=%.5f feed descriptor=%s",
                     itemCount,
                     DateUtils.format(to),
                     avgPrice,
                     feedInfo
             ).println();
             context.stop();
         }
          @Override
         public boolean stopJob() {
             return false;
         }
     };
     history.readFeedData(
             feedInfo,
             from,
             to,
             tailoredFinancialFeedListener,
             loadingProgressListener
     );
 }
 feedInfo - feed info of the feed datafrom - 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 itemsloadingProgress - used to control loading progressJFException - when some errors occurs@Deprecated <T extends ITimedData> void readFeedData(ITailoredFeedInfo<T> feedInfo, long from, long to, ITailoredFinancialFeedListener<T> tailoredFinancialFeedListener, LoadingProgressListener loadingProgress) throws JFException
 private IHistory history;
 private IConsole console;
 private double avgPrice = 0;
 private int itemCount = 0;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     IFinancialInstrumentProvider financialInstrumentProvider = context.getFinancialInstrumentProvider();
     final IFinancialInstrument financialInstrument = financialInstrumentProvider.getFinancialInstrument("EUR/USD");
     context.setSubscribedFinancialInstruments(Collections.singleton(financialInstrument), true);
     final ITailoredFeedInfo <IRenkoBar> tailoredFeedInfo = new RenkoFeedInfo(financialInstrument, PriceRange.TWO_PIPS, OfferSide.ASK, Period.ONE_HOUR, CreationPoint.OPEN);
     final long from = history.getFeedData(tailoredFeedInfo, 10).getTime();
     final long to = history.getFeedData(tailoredFeedInfo, 1).getTime();
     ITailoredFinancialFeedListener <IRenkoBar> tailoredFinancialFeedListener = new ITailoredFinancialFeedListener <IRenkoBar>() {
          @Override
         public void onFeedData(ITailoredFeedInfo <IRenkoBar> tailoredFeedInfo, IRenkoBar renko) {
             itemCount++;
             double price = renko.getClose();
             avgPrice = itemCount == 1 ? price : round(avgPrice + ((price - avgPrice) / (double) itemCount));
         }
         private double round(double amount) {
             return (new BigDecimal(amount)).setScale(financialInstrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
         }
     };
     LoadingProgressListener loadingProgressListener = new LoadingProgressListener() {
          @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
          @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
             console.getOut().format("Loaded %s Renkos till %s average close=%.5f feed descriptor=%s",
                     itemCount,
                     DateUtils.format(to),
                     avgPrice,
                     tailoredFeedInfo
             ).println();
             context.stop();
         }
          @Override
         public boolean stopJob() {
             return false;
         }
     };
     history.readFeedData(
             tailoredFeedInfo,
             from,
             to,
             tailoredFinancialFeedListener,
             loadingProgressListener
     );
 }
 T - type of data feed elementfeedInfo - feed info for corresponding data typefrom - 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.tailoredFinancialFeedListener - receives data about requested feed data itemsloadingProgress - used to control loading progressJFException - when some errors occursreadFeedData(IFeedDescriptor, long, long, IFeedListener, LoadingProgressListener)@Deprecated <T extends ITimedData> void readFeedData(IFeedInfo feedInfo, int numberOfFeedDataBefore, long time, int numberOfFeedDataAfter, IFinancialFeedListener financialFeedListener, LoadingProgressListener loadingProgress) throws JFException
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
 Consider analyzing the last 1000 renko bricks - namely calculating the average close price
 private IHistory history;
 private IConsole console;
 private double avgPrice = 0;
 private int itemCount = 0;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     IFinancialInstrumentProvider financialInstrumentProvider = context.getFinancialInstrumentProvider();
     final IFinancialInstrument financialInstrument = financialInstrumentProvider.getFinancialInstrument("EUR/USD");
     final IFeedInfo feedInfo = new RenkoFeedInfo(financialInstrument, PriceRange.TWO_PIPS, OfferSide.ASK);
     context.setSubscribedFinancialInstruments(Collections.singleton(financialInstrument), true);
     final long time = history.getFeedData(feedInfo, 1).getTime();
     IFinancialFeedListener financialFeedListener = new IFinancialFeedListener() {
          @Override
         public void onFeedData(IFeedInfo feedInfo, ITimedData feedData) {
             itemCount++;
             double price = ((IRenkoBar) feedData).getClose();
             avgPrice = itemCount == 1 ? price : round(avgPrice + ((price - avgPrice) / (double) itemCount));
         }
         private double round(double amount) {
             return (new BigDecimal(amount)).setScale(financialInstrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
         }
     };
     LoadingProgressListener loadingProgressListener = new LoadingProgressListener() {
          @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
          @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
             console.getOut().format("Loaded %s Renkos till %s average close=%.5f feed descriptor=%s",
                     itemCount,
                     DateUtils.format(time),
                     avgPrice,
                     feedInfo
             ).println();
             context.stop();
         }
          @Override
         public boolean stopJob() {
             return false;
         }
     };
     history.readFeedData(
             feedInfo,
             1000,
             time,
             0,
             financialFeedListener,
             loadingProgressListener
     );
 }
 T - type of data feed elementfeedInfo - feed info of the feed datanumberOfFeedDataBefore - how much feed data items to load before and including feed data item with time specified in time parametertime - 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 parameternumberOfFeedDataAfter - how much feed data items to load after (not including) feed data item with time specified in time parameterfinancialFeedListener - receives feed dataloadingProgress - used to control loading progressJFException - when some errors occurs@Deprecated <T extends ITimedData> void readFeedData(ITailoredFeedInfo<T> feedInfo, int numberOfFeedDataBefore, long time, int numberOfFeedDataAfter, ITailoredFinancialFeedListener<T> tailoredFinancialFeedListener, LoadingProgressListener loadingProgress) throws JFException
 private IHistory history;
 private IConsole console;
 private double avgPrice = 0;
 private int itemCount = 0;
  @Override
 public void onStart(final IContext context) throws JFException {
     history = context.getHistory();
     console = context.getConsole();
     IFinancialInstrumentProvider financialInstrumentProvider = context.getFinancialInstrumentProvider();
     final IFinancialInstrument financialInstrument = financialInstrumentProvider.getFinancialInstrument("EUR/USD");
     final ITailoredFeedInfo <IRenkoBar> tailoredFeedInfo = new RenkoFeedInfo(financialInstrument, PriceRange.TWO_PIPS, OfferSide.ASK);
     context.setSubscribedFinancialInstruments(Collections.singleton(financialInstrument), true);
     final long time = history.getFeedData(tailoredFeedInfo, 1).getTime();
     ITailoredFinancialFeedListener <IRenkoBar> tailoredFinancialFeedListener = new ITailoredFinancialFeedListener <IRenkoBar>() {
          @Override
         public void onFeedData(ITailoredFeedInfo <IRenkoBar> tailoredFeedInfo, IRenkoBar renko) {
             itemCount++;
             double price = renko.getClose();
             avgPrice = itemCount == 1 ? price : round(avgPrice + ((price - avgPrice) / (double) itemCount));
         }
         private double round(double amount) {
             return (new BigDecimal(amount)).setScale(financialInstrument.getPipScale() + 1, BigDecimal.ROUND_HALF_UP).doubleValue();
         }
     };
     LoadingProgressListener loadingProgressListener = new LoadingProgressListener() {
          @Override
         public void dataLoaded(long start, long end, long currentPosition, String information) {
         }
          @Override
         public void loadingFinished(boolean allDataLoaded, long start, long end, long currentPosition) {
             console.getOut().format("Loaded %s Renkos till %s average close=%.5f feed descriptor=%s",
                     itemCount,
                     DateUtils.format(time),
                     avgPrice,
                     tailoredFeedInfo
             ).println();
             context.stop();
         }
          @Override
         public boolean stopJob() {
             return false;
         }
     };
     history.readFeedData(
             tailoredFeedInfo,
             1000,
             time,
             0,
             tailoredFinancialFeedListener,
             loadingProgressListener
     );
 }
 T - type of data feed elementfeedInfo - feed info for corresponding data typenumberOfFeedDataBefore - how much feed data items to load before and including feed data item with time specified in time parametertime - 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 parameternumberOfFeedDataAfter - how much feed data items to load after (not including) feed data item with time specified in time parametertailoredFinancialFeedListener - receives feed dataloadingProgress - used to control loading progressJFException - when some errors occursreadFeedData(IFeedInfo, int, long, int, IFinancialFeedListener, LoadingProgressListener)@Deprecated IPointAndFigure getPointAndFigure(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, int shift) throws JFException
getFeedData(ITailoredFeedDescriptor, int).shift
 parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that
 position, then function returns null. This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT). 
 To indicate specific base period and/or data interpolation descriptor, use getFeedData(ITailoredFeedDescriptor, int).instrument - instrument of P&FofferSide - bid or ask side of P&FboxSize - box size of the P&FreversalAmount - reversal amount of the P&Fshift - 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 onJFException - when shift value is negative or instrument is not active (not opened in platform)@Deprecated java.util.List<IPointAndFigure> getPointAndFigures(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, long from, long to) throws JFException
getFeedData(ITailoredFeedDescriptor, long, long).IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT).
 To indicate specific base period and/or data interpolation descriptor, use getFeedData(ITailoredFeedDescriptor, long, long).
 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.instrument - of P&FsofferSide - offer side of P&FsboxSize - box size of P&FsreversalAmount - reversal amount of P&Fsfrom - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded barto - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded barJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated java.util.List<IPointAndFigure> getPointAndFigures(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, int numberOfBarsBefore, long time, int numberOfBarsAfter) throws JFException
getFeedData(ITailoredFeedDescriptor, int, long, int).IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT). 
 To indicate specific base period and/or data interpolation descriptor, use getFeedData(ITailoredFeedDescriptor, int, long, int).
 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.instrument - instrument of the P&FsofferSide - offer side of the P&FsboxSize - price range of the P&FsreversalAmount - reversal amount of P&FsnumberOfBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameterJFException - when desired data amount is negative, etc; or some error occurs when loading data@Deprecated void readPointAndFigures(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, long from, long to, IPointAndFigureFeedListener listener, LoadingProgressListener loadingProgress) throws JFException
readFeedData(ITailoredFeedDescriptor, long, long, ITailoredFeedListener, LoadingProgressListener).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.
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT).
 instrument - of P&FsofferSide - offer side of P&FsboxSize - box size of P&FsreversalAmount - reversal amount of P&Fsfrom - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded barto - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded barlistener - receives data about requested barsloadingProgress - used to control loading progressJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated void readPointAndFigures(Instrument instrument, OfferSide offerSide, PriceRange boxSize, ReversalAmount reversalAmount, int numberOfBarsBefore, long time, int numberOfBarsAfter, IPointAndFigureFeedListener listener, LoadingProgressListener loadingProgress) throws JFException
readFeedData(ITailoredFeedDescriptor, int, long, int, ITailoredFeedListener, LoadingProgressListener).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
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT).
 instrument - of P&FsofferSide - offer side of P&FsboxSize - box size of P&FsreversalAmount - reversal amount of P&FsnumberOfBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameterlistener - receives data about requested barsloadingProgress - used to control loading progressJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated ITickBar getTickBar(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, int shift) throws JFException
getFeedData(ITailoredFeedDescriptor, int).shift
 parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that
 position, then function returns null. This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone. 
 To indicate specific base period, use getFeedData(ITailoredFeedDescriptor, int).instrument - instrument of the tick barofferSide - bid or ask side of the tick bartickBarSize - tick bar size of the tick barshift - 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 onJFException - when shift value is negative or instrument is not active (not opened in platform)@Deprecated java.util.List<ITickBar> getTickBars(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, long from, long to) throws JFException
getFeedData(ITailoredFeedDescriptor, long, long).IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone.
 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.instrument - of Tick BarsofferSide - offer side of Tick BarstickBarSize - tick bar size of Tick Barsfrom - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded barto - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded barJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated java.util.List<ITickBar> getTickBars(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, int numberOfBarsBefore, long time, int numberOfBarsAfter) throws JFException
getFeedData(ITailoredFeedDescriptor, int, long, int).IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone.
 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.instrument - instrument of the tick barsofferSide - offer side of the tick barstickBarSize - tick bar size of the tick barsnumberOfBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameterJFException - when desired data amount is negative, etc; or some error occurs when loading data@Deprecated void readTickBars(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, long from, long to, ITickBarFeedListener listener, LoadingProgressListener loadingProgress) throws JFException
readFeedData(ITailoredFeedDescriptor, long, long, ITailoredFeedListener, LoadingProgressListener).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
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone.
 instrument - of Tick BarsofferSide - offer side of Tick BarstickBarSize - tick bar size of Tick Barsfrom - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded barto - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded barlistener - receives data about requested barsloadingProgress - used to control loading progressJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated void readTickBars(Instrument instrument, OfferSide offerSide, TickBarSize tickBarSize, int numberOfBarsBefore, long time, int numberOfBarsAfter, ITickBarFeedListener listener, LoadingProgressListener loadingProgress) throws JFException
readFeedData(ITailoredFeedDescriptor, int, long, int, ITailoredFeedListener, LoadingProgressListener).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
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone.
 instrument - of Tick BarsofferSide - offer side of Tick BarstickBarSize - tick bar size of Tick BarsnumberOfBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameterlistener - receives data about requested barsloadingProgress - used to control loading progressJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated java.util.List<IRangeBar> getRangeBars(Instrument instrument, OfferSide offerSide, PriceRange priceRange, long from, long to) throws JFException
getFeedData(ITailoredFeedDescriptor, long, long).IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT).
 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.instrument - of Range BarsofferSide - offer side of Range BarspriceRange - price range of Range Barsfrom - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded barto - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded barJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated java.util.List<IRangeBar> getRangeBars(Instrument instrument, OfferSide offerSide, PriceRange priceRange, int numberOfBarsBefore, long time, int numberOfBarsAfter) throws JFException
getFeedData(ITailoredFeedDescriptor, int, long, int).IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT).
 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.instrument - instrument of the Range barsofferSide - offer side of the Range barspriceRange - price range of the Range barsnumberOfBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameterJFException - when desired data amount is negative, etc; or some error occurs when loading data@Deprecated void readRangeBars(Instrument instrument, OfferSide offerSide, PriceRange priceRange, long from, long to, IRangeBarFeedListener listener, LoadingProgressListener loadingProgress) throws JFException
readFeedData(ITailoredFeedDescriptor, long, long, ITailoredFeedListener, LoadingProgressListener).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
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT).
 instrument - of Range BarsofferSide - offer side of Range BarspriceRange - price range of Range Barsfrom - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded barto - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded barlistener - receives data about requested barsloadingProgress - used to control loading progressJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated void readRangeBars(Instrument instrument, OfferSide offerSide, PriceRange priceRange, int numberOfBarsBefore, long time, int numberOfBarsAfter, IRangeBarFeedListener listener, LoadingProgressListener loadingProgress) throws JFException
readFeedData(ITailoredFeedDescriptor, int, long, int, ITailoredFeedListener, LoadingProgressListener).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
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT).
 instrument - of Range BarsofferSide - offer side of Range BarspriceRange - price range of Range BarsnumberOfBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameterlistener - receives data about requested barsloadingProgress - used to control loading progressJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated IRangeBar getRangeBar(Instrument instrument, OfferSide offerSide, PriceRange priceRange, int shift) throws JFException
getFeedData(ITailoredFeedDescriptor, int).shift
 parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that
 position, then function returns null. This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone and default
 data interpolation descriptor (DataInterpolationDescriptor.DEFAULT).instrument - instrument of the range barofferSide - bid or ask side of the range barpriceRange - price range of the range barshift - 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 onJFException - when shift value is negative or instrument is not active (not opened in platform)@Deprecated IRenkoBar getRenkoBar(Instrument instrument, OfferSide offerSide, PriceRange brickSize, int shift) throws JFException
getFeedData(ITailoredFeedDescriptor, int).shift
 parameter, 0 - current bar, 1 - previous bar (last formed bar) If there is no bar loaded at that
 position, then function returns null.
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone, default renko session (Period.ONE_MIN) and 
 default price point (RenkoCreationPoint.CLOSE).
 instrument - instrument of the Renko barofferSide - bid or ask side of the Renko barbrickSize - price range of the Renko barshift - number of bar back in time staring from current bar. 1 - previous bar, 2 - current bar minus 2 bars and so onJFException - when shift value is negative or instrument is not active (not opened in platform)@Deprecated java.util.List<IRenkoBar> getRenkoBars(Instrument instrument, OfferSide offerSide, PriceRange brickSize, long from, long to) throws JFException
getFeedData(ITailoredFeedDescriptor, long, long).OutOfMemoryException
 If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone, default renko session (Period.ONE_MIN) and 
 default price point (RenkoCreationPoint.CLOSE).
 instrument - of Renko BarsofferSide - offer side of Renko BarsbrickSize - price range of Renko Barsfrom - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded barto - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded barJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated java.util.List<IRenkoBar> getRenkoBars(Instrument instrument, OfferSide offerSide, PriceRange brickSize, int numberOfBarsBefore, long time, int numberOfBarsAfter) throws JFException
getFeedData(ITailoredFeedDescriptor, int, long, int).OutOfMemoryException.
 If the requested period includes the bar that is not fully formed yet (in-progress bar), then it is included in result too
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone, default renko session (Period.ONE_MIN) and 
 default price point (RenkoCreationPoint.CLOSE).
 instrument - instrument of the Renko barsofferSide - offer side of the Renko barsbrickSize - price range of the Renko barsnumberOfBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameterJFException - when desired data amount is negative, etc; or some error occurs when loading data@Deprecated void readRenkoBars(Instrument instrument, OfferSide offerSide, PriceRange brickSize, long from, long to, IRenkoBarFeedListener listener, LoadingProgressListener loadingProgress) throws JFException
readFeedData(ITailoredFeedDescriptor, long, long, ITailoredFeedListener, LoadingProgressListener).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
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone, default renko session (Period.ONE_MIN) and 
 default price point (RenkoCreationPoint.CLOSE).
 instrument - of Renko BarsofferSide - offer side of Renko BarsbrickSize - price range of Renko Barsfrom - start time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the first loaded barto - end time of the time interval for which bars should be loaded. This time is included in interval [start; end] of the last loaded barlistener - receives data about requested barsloadingProgress - used to control loading progressJFException - when incorrect time interval is passed or some error occurs when loading data@Deprecated void readRenkoBars(Instrument instrument, OfferSide offerSide, PriceRange brickSize, int numberOfBarsBefore, long time, int numberOfBarsAfter, IRenkoBarFeedListener listener, LoadingProgressListener loadingProgress) throws JFException
readFeedData(ITailoredFeedDescriptor, int, long, int, ITailoredFeedListener, LoadingProgressListener).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
 This method uses default base period IFeedDescriptor.DEFAULT_BASE_PERIOD, which has EET time zone, default renko session (Period.ONE_MIN) and 
 default price point (RenkoCreationPoint.CLOSE).
 instrument - of Renko BarsofferSide - offer side of Renko BarsbrickSize - price range of Renko BarsnumberOfBarsBefore - how much bars to load before and including bar with time specified in time parametertime - 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 > 0numberOfBarsAfter - how much bars to load after (not including) bar with time specified in time parameterlistener - receives data about requested barsloadingProgress - used to control loading progressJFException - when incorrect time interval is passed or some error occurs when loading dataCopyright © 2025. All rights reserved.