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.

ma return false values
 Post subject: ma return false values Post rating: 0   New post Posted: Fri 13 Apr, 2012, 07:23 

User rating: 1
Joined: Wed 07 Mar, 2012, 05:56
Posts: 101
Location: New CaledoniaNew Caledonia
hello support,

i have some problem with the value of ma. perhaps it's my fault but i don't think.

this is my code :
double maH1 = indicators.ma(instrument,Period.ONE_HOUR,OfferSide.ASK,IIndicators.AppliedPrice.CLOSE,maPeriod,IIndicators.MaType.SMA,0);
        double maH11 = indicators.ma(instrument,Period.ONE_HOUR,OfferSide.ASK,IIndicators.AppliedPrice.CLOSE,maPeriod,IIndicators.MaType.SMA,1);


but the return values it not the same as on the graph.
maH1 = 1.3289 and on the graph ma value is 1.3302

please look an attached file


Attachments:
troubleshoot.png [10.21 KiB]
Downloaded 314 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: ma return false values Post rating: 0   New post Posted: Fri 13 Apr, 2012, 07:36 
User avatar

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


 
 Post subject: Re: ma return false values Post rating: 0   New post Posted: Fri 13 Apr, 2012, 09:14 

User rating: 1
Joined: Wed 07 Mar, 2012, 05:56
Posts: 101
Location: New CaledoniaNew Caledonia
i think all is good on my code

definition of timezone :
 public String toStr(double d) {
        return (new DecimalFormat("#.#######")).format(d);
    }
 
    public String toStr(Long time) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") {
 
            {
                setTimeZone(TimeZone.getTimeZone("GMT"));
            }
        };
        return sdf.format(time);
    }
     
    private String toStr(IBar bar) {
        return toStr(bar.getTime()) + "  O:" + bar.getOpen() + " C:" + bar.getClose() + " H:" + bar.getHigh() + " L:" + bar.getLow();
    }
 
    private void printTime(Long time) {
        console.getOut().println(toStr(time));
    }
 
}


my chart is on ASK candlesticks
i have changed my shift 0 to 1 and i have compared with ohlc. ohlc return good value but not the code.
see the new attached file.
perhaps i have an error on my strategy. please look on it.


Attachments:
reversalfractal.java [14.67 KiB]
Downloaded 274 times
troubleshoot.png [53.1 KiB]
Downloaded 317 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: ma return false values Post rating: 0   New post Posted: Fri 13 Apr, 2012, 09:32 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
what are the chart filter settings that you use?


 
 Post subject: Re: ma return false values Post rating: 0   New post Posted: Fri 13 Apr, 2012, 10:26 

User rating: 1
Joined: Wed 07 Mar, 2012, 05:56
Posts: 101
Location: New CaledoniaNew Caledonia
ok thanks you for your idea. i need to change my setting of "flat filtration" on "flats filter is disable".


 
 Post subject: Re: ma return false values Post rating: 0   New post Posted: Fri 13 Apr, 2012, 10:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
or use a calculation method that uses the same filter as the chart:
https://www.dukascopy.com/wiki/#Indicator_Calculation/Candlestick_price_feed


 

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