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.

different values of sma-indicator
 Post subject: different values of sma-indicator Post rating: 0   Post Posted: Thu 15 Sep, 2011, 13:35 

User rating: 0
Joined: Mon 23 May, 2011, 13:03
Posts: 6
Location: Switzerland,
Hi,

I get different values for the sma-indicator, which I calculate from context.getIndicators().sma(...) and the jforex sma-indicator in the chart. I use the same inputs.

In the first screenshot you see the chart:
red line = SMA(20),
blue line = SMA (100)

the ohlc informations in the left corner are from 14th september 2011 and in the console you see the values of my calculation for the 14th september 2011 and the code you see in the second screenshot.

Why are there different values from the indicators? Did I make a mistake?

thanks for help,
best regards, bt


Attachments:
smaCode.png [20.79 KiB]
Downloaded 317 times
chart, 14.09.2011.png [66.2 KiB]
Downloaded 331 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: different values of sma-indicator Post rating: 0   Post Posted: Fri 16 Sep, 2011, 10:03 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please consider adding time values to your print statements, see:
https://www.dukascopy.com/wiki/index.php ... _Date/Time
Or just log IBar.toString() or ITick.toString() values.


 
 Post subject: Re: different values of sma-indicator Post rating: 0   Post Posted: Fri 16 Sep, 2011, 14:01 

User rating: 0
Joined: Mon 23 May, 2011, 13:03
Posts: 6
Location: Switzerland,
Thank you for your answer.

In the attachment you will find the same screenshot with ohlc-informations from 14th september 2011 like in the previous post (red=SMA(20), blue=SMA(100)). In the console I added the whole bar-informations like you said.

The second screenshot shows you the code.

I hope, I did the right thing what you need.

thanks and best regards,
bt


Attachments:
DailyChartEURUSDwithSMAs.png [88.63 KiB]
Downloaded 329 times
PrintCodeSMAs.png [21.21 KiB]
Downloaded 327 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: different values of sma-indicator Post rating: 0   Post Posted: Mon 19 Sep, 2011, 12:35 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Are the filters disabled on the chart?
That is done through: Tools > Preferences > Chart > Flats Filter is disabled.


 
 Post subject: Re: different values of sma-indicator Post rating: 0   Post Posted: Mon 19 Sep, 2011, 19:49 

User rating: 0
Joined: Mon 23 May, 2011, 13:03
Posts: 6
Location: Switzerland,
thank you for help, now it works.

In 90% of cases the problem is sitting between the screen and the chair. ;)

Best regards,
bt


 

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