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.

Historical Tester and Indicators problem
 Post subject: Historical Tester and Indicators problem Post rating: 0   New post Posted: Mon 06 Feb, 2012, 12:48 
User avatar

User rating: 0
Joined: Tue 17 Jan, 2012, 15:15
Posts: 20
Location: Russian FederationRussian Federation
Hello,

I'm working on my own strategy and I've found out that indicators showed on graphs and indicators from strategy code have different values. Lets take MACD as example. I'm running my strategy that does nothing except printing MACD values (EUR/USD chart. "Last month" is a good sample time frame on Historical Tester):

    void printMsg(String text)
    {
        console.getOut().println(text);
    }

    int getMacdDir(Instrument instrument, Period period) throws JFException
    {
        double macdCur[] = indicators.macd(instrument, period, OfferSide.BID,AppliedPrice.CLOSE,12,26,9,0);
        printMsg(String.format("%.6g", macdCur[0])+" "+String.format("%.6g",macdCur[1]));
        return 0;
    }

    public void onBar(Instrument instrument, Period period, IBar askbar,
            IBar bidbar) throws JFException {
    if (period != Period.ONE_HOUR) return;
    getMacdDir(instrument,period);
}


I see different MACD values in log and on chart. I have the same problem with Ichimoku.
I have feeling that maybe MACD parameters are incorrect. Can you help me with it please?


 
 Post subject: Re: Historical Tester and Indicators problem Post rating: 0   New post Posted: Mon 06 Feb, 2012, 13:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/wiki/#Indicato ... _checklist


 
 Post subject: Re: Historical Tester and Indicators problem Post rating: 0   New post Posted: Mon 06 Feb, 2012, 17:16 
User avatar

User rating: 0
Joined: Tue 17 Jan, 2012, 15:15
Posts: 20
Location: Russian FederationRussian Federation
Thanks.


 

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