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.

what does shift==0 in the Iindicators return.
 Post subject: what does shift==0 in the Iindicators return. Post rating: 0   New post Posted: Mon 19 Jan, 2009, 16:58 

User rating: 0
Joined: Wed 24 Dec, 2008, 18:49
Posts: 10
the docs say that shift =0 returns the current bar, as generated from the ticks.

when calling the sma function(for example), with shift=1 to get one value
and then calling it again, with a time offset, one can verify that the last bar's value (given by getPrevBarStart function) indeed matches the call.

however , calling with shift=0 i get a value that is not available by the array form of the call.

when i try to call the getBarStart time and replace the array call to get the current - tick generated bar
I get an error saying the bar isn't formed yet.

is there a way to use the function that returns an array to get the current bar values too ?

long prevBarTime = history.getPrevBarStart(Period.TEN_SECS, tick.getTime());
double temp[] = indicators.sma(instrument, Period.TEN_SECS,
            OfferSide.BID, IIndicators.AppliedPrice.HIGH, 5,
            prevBarTime - 1000L * 10L * 9L, prevBarTime);
double temp0 = indicators.sma(instrument, Period.TEN_SECS,
            OfferSide.BID, IIndicators.AppliedPrice.HIGH, 5, 0);


 
 Post subject: Re: what does shift==0 in the Iindicators return. Post rating: 0   New post Posted: Tue 20 Jan, 2009, 09:37 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
no, functions that get time range as parameters returns only already formed bars


 

Jump to:  

  © 1998-2024 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