Dukascopy
 
 
Wiki JStore Search Login

indicators error?
 Post subject: indicators error? Post rating: 0   New post Posted: Mon 02 Feb, 2015, 10:14 

User rating: 1
Joined: Tue 24 Apr, 2012, 13:41
Posts: 39
Hello,

I write simple test strategy as follows:
    @Override
    public void onStart(final IContext context) throws JFException {
        this.context = context;
        engine = context.getEngine();
        console = context.getConsole();
        history = context.getHistory();
        indicators = context.getIndicators();
       
        for( double d: indicators.sma(
                        Instrument.EURUSD,
                        Period.FIFTEEN_MINS,
                        OfferSide.BID,
                        IIndicators.AppliedPrice.CLOSE,
                        200,
                        Filter.WEEKENDS,
                        3,
                        history.getLastTick( Instrument.EURUSD ).getTime(),
                        0) ) {
            console.getOut().println(String.format("%7.5f", d));
        }
    } // public void onStart( IContext context )

and the result is (it looks like SMA of 3000 periods at 1 min):
Quote:
09:06:33 1.13147
09:06:33 1.13146
09:06:33 1.13144

instead of SMA of 200 periods at 15 min:
Quote:
09:06:33 1.13196
09:06:33 1.13192
09:06:33 1.13188


Is it JForex error? Would you fix it?

Regards,
FXer


Attachments:
File comment: Full test strategy
STest.java [2.36 KiB]
Downloaded 58 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: indicators error? Post rating: 0   New post Posted: Mon 02 Feb, 2015, 12:42 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Hi,

Firstly, I think I am not the only who is just guessing what is actually wrong with those outputs. So could you be a bit more specific, what is exactly not working in the way you think it should?

Secondly, ff you try to get the same values in a strategy and on the chart (still guessing!), consider the following wiki page:
https://www.dukascopy.com/wiki/#Indicato ... _checklist

And thirdly, for API related questions please post in the corresponding forum section, which is this.


 
 Post subject: Re: indicators error? Post rating: 0   New post Posted: Mon 02 Feb, 2015, 15:34 

User rating: 1
Joined: Tue 24 Apr, 2012, 13:41
Posts: 39
Hi,

After I've completely purge application data it seems to be solved.

Regards,
FXer


 

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