Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

tick.getTime() analog in IIndicator
 Post subject: tick.getTime() analog in IIndicator Post rating: 0   New post Posted: Wed 18 Nov, 2015, 17:08 
User avatar

User rating: 0
Joined: Sun 08 Mar, 2015, 23:36
Posts: 7
Location: Russian FederationRussian Federation
Does indicator have
public IndicatorResult calculate(int startIndex, int endIndex) {
    int today = startIndex - getLookback() + 1;
    long time = input[TIME][today];
    return new IndicatorResult(0, 0);
}

like for strategy:
public void onTick(Instrument instrument, ITick tick) throws JFException {
    long time = tick.getTime();
}


Any help?


 
 Post subject: Re: tick.getTime() analog in IIndicator Post rating: 0   New post Posted: Thu 19 Nov, 2015, 14:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
calculate() is called at the same time as onTick().
Unless IndicatorInfo.setRecalculateOnNewCandleOnly(true) is set.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com