|
JFOREX-3224 Differences between API and charts values |
m_ax
|
Post subject: JFOREX-3224 Differences between API and charts values |
Post rating: 0
|
Posted: Sun 04 Sep, 2011, 20:32
|
|
User rating: -
|
Hello Support,
I have few issues with your JForex platform and strategy tester. I wrote a simple strategy (see att.), which makes sell or buy orders depending on stochastic indicator values. However the values I'm getting in JForex charts seems to be different than the one I get from JForex API.
Issue no. 1 - the order is submitted in 'onBar()' method. When I submit an order I give it a comment with the time of current bar. However on the chart it is marked on the previous bar (see screen1)
Issue no. 2 - in the message window I print values of stochastic indicator, based on which the strategy decides to submit an order. The values I see on the chart are different from the values that are printed in the message window. I'm not able to find stochastic indicator value from given time moment on chart (e.g. on the screen %K=73.77, %D=75.59; on the chart for %K=73 the value %D is around 80)
Thanks a lot for your feedback. Best regards, m_ax
|
|
|
|
 |
API Support
|
Post subject: Re: Differences between API and charts values |
Post rating: 0
|
Posted: Mon 05 Sep, 2011, 09:46
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please, provide the screenshots and the relevant strategy source code fragments.
The problem may be in the fact that onBar method is called when a bar is finished, i.e. it is called at bidBar.getTime() + period.
|
|
|
|
 |
m_ax
|
Post subject: Re: Differences between API and charts values |
Post rating: 0
|
Posted: Mon 05 Sep, 2011, 20:37
|
|
User rating: 0
Joined: Sun 04 Sep, 2011, 20:32 Posts: 4 Location: PL
|
|
|
|
 |
API Support
|
Post subject: Re: Differences between API and charts values |
Post rating: 0
|
Posted: Tue 06 Sep, 2011, 12:20
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please, check two things: 1) Indicator on the chart and in the strategy must have equal input parameters. In the strategy default parameter is MaType.EMA whereas in the screenshot SMA is used. 2) The chart displays time in GMT time zone, but your strategy prints it in CEST. Here is a way to print GMT time: SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") {{setTimeZone(TimeZone.getTimeZone("GMT"));}}; System.out.println(sdf.format(bidBar.getTime()));
|
|
|
|
 |
m_ax
|
Post subject: Re: Differences between API and charts values |
Post rating: 0
|
Posted: Sat 17 Sep, 2011, 14:04
|
|
User rating: 0
Joined: Sun 04 Sep, 2011, 20:32 Posts: 4 Location: PL
|
Ad. 1 The stochastic indicator values issue is presented on screen 2, where MaType.EMA is used. See new attachment (screen 3) where again EMA is used an the values between strategy output and chart are diffrent.
Ad. 2 I added suggested settings with the time zone. However now the marker is one hour late (in the screen 3 it is placed on 08.00 hour bar, but should be on 07.00)
Regards, m_ax
Attachments: |
File comment: Strategy
Stochastic.0917.java [5.26 KiB]
Downloaded 494 times
|
File comment: Screen 3
screen3.PNG [84.81 KiB]
Downloaded 608 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.
|
|
|
|
|
 |
API Support
|
Post subject: Re: JFOREX-3224 Differences between API and charts values |
Post rating: 0
|
Posted: Tue 20 Sep, 2011, 11:04
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
onBar method is called when a new bar is created. The bar with index 0 in history corresponds to the new unfinished bar. Whereas index 1 corresponds to the last finished bar, that is also passed to onBar as askBar and bidBar. Therefore, the value of indicator at lastBarTime is not final and will change after the bar is finished.
|
|
|
|
 |
m_ax
|
Post subject: Re: JFOREX-3224 Differences between API and charts values |
Post rating: 0
|
Posted: Tue 27 Sep, 2011, 20:50
|
|
User rating: 0
Joined: Sun 04 Sep, 2011, 20:32 Posts: 4 Location: PL
|
I've made corrections to bar time retrieving. Now the marker on the chart is correctly described. However I still don't understand why the value of stochastic indicator fetched in strategy is diffrent than the value showed on the chart. As you can see in attached screen no. 4, for two previous bars I'm getting values for %D around 16 and 13. But there is no such low %D value on the chart at all. Regards, m_ax
Attachments: |
Stochastic.0927.java [5.43 KiB]
Downloaded 518 times
|
File comment: Screen 4
screen4.PNG [72.93 KiB]
Downloaded 617 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.
|
|
|
|
|
 |
Guest
|
Post subject: Re: JFOREX-3224 Differences between API and charts values |
Post rating: 0
|
Posted: Thu 29 Sep, 2011, 10:51
|
|
User rating: -
|
Why this post is now under 'Fixed Bugs' ? The value of stochastic indicator retrieved from API is diffrent than one showed on the chart.
|
|
|
|
 |
API Support
|
Post subject: Re: JFOREX-3224 Differences between API and charts values |
Post rating: 0
|
Posted: Thu 29 Sep, 2011, 11:28
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
It is fixed and will be available in a next release.
|
|
|
|
 |
m_ax
|
Post subject: Re: JFOREX-3224 Differences between API and charts values |
Post rating: 0
|
Posted: Sun 02 Oct, 2011, 10:26
|
|
User rating: 0
Joined: Sun 04 Sep, 2011, 20:32 Posts: 4 Location: PL
|
Can you please write in what version fix will be available? Best regards, m_ax
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|