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.

EMA values differ between chart and strategy
 Post subject: EMA values differ between chart and strategy Post rating: 0   New post Posted: Fri 10 Oct, 2014, 21:50 
User avatar

User rating: 0
Joined: Fri 10 Oct, 2014, 00:35
Posts: 58
Location: New Zealand, Auckland
Hi

I am writing a simple ma cross strategy using an ema(8) cross over sma(20). I notice that the values for the ema in the strategy are different from those on the chart. (The values for the sma agree.) I think this is due to the number of historical bars used to calculate the ema.

Is it possible to set the number of bars for calculation of the ema? I only need to use the last value.

I am using JForex. This is not a "Visual JForex" question, but I don't know if this is the correct place to ask it. (My first need for support.) If it's not, please advise where such strategy programming questions should be asked.

Cheers
Tony


 
 Post subject: Re: EMA values differ between chart and strategy Post rating: 0   New post Posted: Mon 13 Oct, 2014, 18:04 
User avatar

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

Probably you use difference settings (filters, etc) on the chart. This might help.

Also, this is an interesting topic about 'unstable period', which is also affecting indicator calculation.

Hope this helps.


 
 Post subject: Re: EMA values differ between chart and strategy Post rating: 0   New post Posted: Tue 14 Oct, 2014, 03:46 
User avatar

User rating: 0
Joined: Fri 10 Oct, 2014, 00:35
Posts: 58
Location: New Zealand, Auckland
Thank you, tcsabina.

You are correct; the big differences I saw were due to charts using the filter WEEKENDS, but strategy using NO_FILTER.

I knew to check them, but I am new to the platform and it took a long time for me to realise what filter the charts were using. I understand that now.

The article about unstable periods addresses exactly what I meant when I asked how many historical bars were used to calculate the EMA. It's very interesting, but with a short EMA, it is not an issue.

Thanks for your help. I realise now that learning the platform means also becoming very familiar with the right forums!

Cheers
Tony


 

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