Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

我能在onBar{}那里获得不同周期的k线吗?
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=183&t=53711
Page 1 of 1

Author:  beinong [ Fri 26 Feb, 2016, 04:44 ]
Post subject:  我能在onBar{}那里获得不同周期的k线吗?

你好。我能在onBar{}那里获得不同周期的k线吗?就是想同时获得5分钟k线和1分钟k线。如下这么写有没问题?
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
prevBar5 = history.getBar(selectedInstrument, Period.FIVE_MINS, OfferSide.BID,1);
prevBar1 = history.getBar(selectedInstrument, Period.ONE_MIN, OfferSide.BID,1);
}

Author:  MarkLi [ Tue 15 Mar, 2016, 14:57 ]
Post subject:  Re: 我能在onBar{}那里获得不同周期的k线吗?

您好,

请参照网页上的说明:https://www.dukascopy.com/wiki/#History_bars。

  Page 1 of 1