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.

Example from the wiki not working
 Post subject: Example from the wiki not working Post rating: 0   New post Posted: Mon 09 Dec, 2013, 11:49 
User avatar

User rating: 1
Joined: Tue 26 Jun, 2012, 19:18
Posts: 29
Location: France, Saint Martin d Heres
Hello,

I am trying to get the standard deviation of the last three daily bars. According to the wiki:
(https://www.dukascopy.com/wiki/#Indicato ... _Deviation)


long lastBarTime = history.getBar(instrument, Period.ONE_MIN, OfferSide.BID,1).getTime();
long nextToLastBarTime = history.getBar(instrument, Period.ONE_MIN, OfferSide.BID, 2).getTime();
double[] stddev = indicators.stdDev(instrument, period, OfferSide.ASK, AppliedPrice.CLOSE, timePeriod, nbDev, nextToLastBarTime, lastBarTime);

This should return the two stddev values for 2 previous bars. However, the previous code does not compile.

Can you please take a look and tell me how to fix it, and if it does work for daily bars?
How can I get the three latest values insted of only two?

Thank you very much,
SmithJr


 
 Post subject: Re: Example from the wiki not working Post rating: 0   New post Posted: Mon 09 Dec, 2013, 11:57 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Could you please provide an example strategy that you use?


 

Jump to:  

cron
  © 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