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.

Wrong value for long period indicators
 Post subject: Wrong value for long period indicators Post rating: 0   New post Posted: Sun 15 Aug, 2010, 17:22 

User rating: -
Hi,

My strategy is calculating wrong values for long period (i.e 200) moving averages (sma, kama, mama etc...) - what is the problem? The values are always different by a large amount from the values I can see on the chart.

Example of the code:
double smaSlow = indicators.sma(instrument, Period.FIFTEEN_MINS, OfferSide.BID, IIndicators.AppliedPrice.CLOSE, 200, 0);

For example, on EUR/GBP on 2010-08-05 at 11:15 on-the-screen sma is at around 0.83088 while the one calculated as above in the strategy code is at 0.83254 - this is a huge difference.

Do you know what might be the problem?

By the way - I double checked - both the instrument and time frame are set correctly in the strategy and the chart i.e. EURGBP / 15M. This problem is persisent on all currency pairs / timeframes / currencies.

Please help!
Thanks


 
 Post subject: Re: Wrong value for long period indicators Post rating: 0   New post Posted: Tue 17 Aug, 2010, 17:18 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
It's probably the filtering on your chart. Check the preferences to see if you're filtering any flat bars.


 

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