realdope wrote:
(1) IStrategy.onBar. When does this get called? Does it get called whenever a bar closes or does it get continuously called on every tick? If I'm in onBar() and I check the period to be Period.THIRTY_MINS, then does it mean that this is the close of the 30minute bar?
It gets executed when a candle stick of a subscribed instrument gets finished, if you want to work only with bars of particular periods, consider bar filtering:
https://www.dukascopy.com/wiki/#Filter_Ticks_Barsrealdope wrote:
(2) IIndicators. When I do a calculation like indicators.rsi(instrument, Period.THIRTY_MINS, OfferSide.BID, AppliedPrice.CLOSE, 14, 0) in onTick, does it automatically calculate the 30min RSI for the currently incomplete 30min bar? For example, let's say it's 10:15, and I want to calculate 30min RSI in onTick, does it calculate the current RSI value based on the incomplete 30 min bar from 10:00 to 10:15?
Yes.
realdope wrote:
Or does it calculate it from 9:45 to 10:15?
No.