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.

Javadoc for methods of interface IIndicators
 Post subject: Javadoc for methods of interface IIndicators Post rating: 0   New post Posted: Mon 02 May, 2011, 18:16 

User rating: 0
Joined: Wed 27 Apr, 2011, 13:56
Posts: 18
Hi support,

Are javadocs for methods of interface IIndicators planned?


 
 Post subject: Re: Javadoc for methods of interface IIndicators Post rating: 0   New post Posted: Tue 03 May, 2011, 07:11 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Please have a look at the following JForex Wiki article: https://www.dukascopy.com/wiki/index.php ... _interface


 
 Post subject: Re: Javadoc for methods of interface IIndicators Post rating: 0   New post Posted: Tue 03 May, 2011, 11:12 

User rating: 0
Joined: Wed 27 Apr, 2011, 13:56
Posts: 18
I meant the interface IIndicators which defines all the methods for getting the values of standard indicators such as ema(...), ma(...) and so on.


 
 Post subject: Re: Javadoc for methods of interface IIndicators Post rating: 0   New post Posted: Wed 04 May, 2011, 07:14 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Have a look at the following:
https://www.dukascopy.com/client/javadoc ... ators.html
Also, have a look at the overview section of the following article: https://www.dukascopy.com/wiki/index.php ... Indicators


 
 Post subject: Re: Javadoc for methods of interface IIndicators Post rating: 0   New post Posted: Wed 04 May, 2011, 07:48 

User rating: 0
Joined: Wed 27 Apr, 2011, 13:56
Posts: 18
Thank you. Especially the second link was helpful.


 
 Post subject: Re: Javadoc for methods of interface IIndicators Post rating: 0   New post Posted: Wed 04 May, 2011, 11:50 

User rating: 0
Joined: Wed 27 Apr, 2011, 13:56
Posts: 18
But however the parameter timePeriod in method

double[] sma(Instrument instrument, Period period, OfferSide side, IIndicators.AppliedPrice appliedPrice, int timePeriod, long from, long to)

isn't clear for me :?

I constantly get
com.dukascopy.api.JFException: Interval from [2011.04.29 00:05:17 500] to [2011.04.29 00:05:37 500] GMT is not valid
at com.dukascopy.api.impl.ab.b(Unknown Source)
at com.dukascopy.api.impl.ab.calculateIndicator(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.ai.calculateIndicator(Unknown Source)
at com.dukascopy.api.impl.ab.a(Unknown Source)
at com.dukascopy.api.impl.ab.sma(Unknown Source)
at jforex.FirstStrategy.onTick(FirstStrategy.java:56)
at com.dukascopy.dds2.greed.agent.strategy.tester.a.a(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.l.run(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.a.wI(Unknown Source)
at com.dukascopy.dds2.greed.actions.StrategyTesterAction.vc(Unknown Source)
at com.dukascopy.dds2.greed.actions.StrategyTesterAction.uB(Unknown Source)
at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


And here is the method call
double[] result = indicators.sma(instrument, period, OfferSide.BID, IIndicators.AppliedPrice.MEDIAN_PRICE, 2,tick.getTime() - 20000, tick.getTime());


 
 Post subject: Re: Javadoc for methods of interface IIndicators Post rating: 0   New post Posted: Mon 09 May, 2011, 08:58 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
long from is the start time of the first candle in the calculated period and long to is start time of the last candle in the calculated period
Try using the following code:
long from = history.getBar(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, 2).getTime();
long to = history.getBar(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, 1).getTime();
       
double[] result = indicators.sma(instrument, Period.ONE_HOUR, OfferSide.BID, IIndicators.AppliedPrice.MEDIAN_PRICE, 2, from, to);


 
 Post subject: Re: Javadoc for methods of interface IIndicators Post rating: 0   New post Posted: Thu 12 May, 2011, 10:20 

User rating: 0
Joined: Wed 27 Apr, 2011, 13:56
Posts: 18
At the moment I don't need this method but thanks for answer. I will try it out.


 

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