Dukascopy
 
 
Wiki JStore Search Login

JFOREX-3818 Standalone API: charts available in strategy
 Post subject: JFOREX-3818 Standalone API: charts available in strategy Post rating: 0   New post Posted: Sat 05 May, 2012, 19:34 
User avatar

User rating: 7
Joined: Fri 13 Jan, 2012, 20:49
Posts: 94
Location: Poland, Warsaw
Hi,

It would be very useful for developers of external clients using Standalone API to be able to start chart container from Strategy. By chart container I mean the chart window with tabs etc. like in JForex Desktop (have a look at the attachment). I am writing about charts for live trading not for backtesting.

Ideally it would be great if there was a method in the API that starts/opens charts container and charts are accessible/modifiable by API.

Can you please add this to Standalone API?

Thanks and kind regards,
Kurak


Attachments:
charts.png [121.42 KiB]
Downloaded 1918 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: Standalone API: charts available in strategy Post rating: 0   New post Posted: Mon 07 May, 2012, 15:08 
User avatar

User rating: 7
Joined: Fri 13 Jan, 2012, 20:49
Posts: 94
Location: Poland, Warsaw
Hi Support Team!

Why did you move the the post to Knowledge Base category? I put it originally in Feature Requests as it is a feature request.

regards,
Kurak


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Fri 11 May, 2012, 09:25 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
What is the reason for requesting this. Why not use JForex client?


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Sat 12 May, 2012, 16:17 

User rating: 0
Joined: Fri 19 Aug, 2011, 20:29
Posts: 45
Location: Germany,
This would be great.

The JForex client is not really useful as a charting platform since the IIndicator interface is not usable at all (no access to previous data e.g. for MA calculation optimization, no fixed bar indices e.g. 0 first bar on chart - the indices are viewport based, difficult and unreliable multi currency access, no attaching a strategy to a specific chart, no decent drawing methods, etc)

Right now im pulling the jforex pricefeed via api into MT5 because of this which is less than ideal too since MT5 is just so slow with its ticks, candle closes etc so im working on my own java charting too.

The best thing of course would be if Dukascopy would just open source the client or at least charting.


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Sun 13 May, 2012, 16:42 

User rating: 0
Joined: Fri 19 Aug, 2011, 20:29
Posts: 45
Location: Germany,
How is Dukascopys policy on the following:

If one is to create his own frontend aka client using the jforex standalone api:

1) Can this be distributed freely opensource for public/private/commercial use?
2) Can this be distributed freely closed source for public/private/commercial use?
3) Can this be distributed commercially opensource for public/private/commercial use?
4) Can this be distributed commercially closed source for public/private/commercial use?
5) Would Dukascopy maybe support something like this as a community project? e.g. JForex client like client but with the usability of MT and the power of JForex / Java or is this in contrast to supporting its own client.

Thanks


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Tue 15 May, 2012, 09:04 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
yoursong wrote:
no access to previous data e.g. for MA calculation optimization
Indicators can be calculated on an arbitrary historical interval over an arbitrary data feed (see https://www.dukascopy.com/wiki/#Indicator_Calculation). You can even calculate an indicator on a value array. Please elaborate what data you can't access.
yoursong wrote:
no fixed bar indices e.g. 0 first bar on chart - the indices are viewport based
Indicator calculation from strategy has nothing to do with the chart. If you mean that the result arrays are time-wise in ascending order (as opposed to MT), then it is "as designed".
yoursong wrote:
difficult and unreliable multi currency access
You don't receive all possible instrument data on purpose, since it would cause storing irrelevant data in your local cache. You need to subscribe to all the needed instruments on strategy start, see https://www.dukascopy.com/wiki/#Subscrib ... instrument
yoursong wrote:
no attaching a strategy to a specific chart
This might also be interpreted an advantage, that the strategy can work without a chart. It also makes multi-instrument strategies more straightforward. And you can always retrieve a chart from strategy if it is opened.
yoursong wrote:
no decent drawing methods
Please elaborate what additional methods do you require besides the ones that are given in https://www.dukascopy.com/wiki/#Chart_object_catalog
yoursong wrote:
The best thing of course would be if Dukascopy would just open source the client or at least charting.
We don't plan to do this. In case of any problems with chart usage, please register either a Bug report or Feature request.
yoursong wrote:
How is Dukascopys policy on the following:

If one is to create his own frontend aka client using the jforex standalone api:

1) Can this be distributed freely opensource for public/private/commercial use?
2) Can this be distributed freely closed source for public/private/commercial use?
3) Can this be distributed commercially opensource for public/private/commercial use?
4) Can this be distributed commercially closed source for public/private/commercial use?
5) Would Dukascopy maybe support something like this as a community project? e.g. JForex client like client but with the usability of MT and the power of JForex / Java or is this in contrast to supporting its own client.

Thanks
We don't restrict the redistribution of Standalone API.


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Tue 15 May, 2012, 15:13 

User rating: 0
Joined: Fri 19 Aug, 2011, 20:29
Posts: 45
Location: Germany,
API Support wrote:
yoursong wrote:
no access to previous data e.g. for MA calculation optimization
Indicators can be calculated on an arbitrary historical interval over an arbitrary data feed (see https://www.dukascopy.com/wiki/#Indicator_Calculation). You can even calculate an indicator on a value array. Please elaborate what data you can't access.
If you calculate an exponential moving average (same applies to almost any indicator) you calculate e.g. the SMA of your most left bar, calculate another 100 or whatever bars for smoothing and then calculate your actual EMA for every of the following bars till your recent bar based on the EMA value of the previous bar. This technique (which applies to most indicators) is crucial for at least half way performant calculation of a lot of such things on multiple charts. This is not possible in JForex (to my knowledge) since you cannot access prev. values. Instead of one calculation you calculate 200 or more (decent smoothing) bars for every single bar that you need a value for. This is already an absolut no go. You can't even simply save the values in your own array since you never really know where you are what has been calculated etc since it just randomly chooses a barrange based on the viewport. This might be because of the independence of indicators to charts but indicators are primarily meant for charts and decoupling them from each other defeats most of the purpose.

API Support wrote:
yoursong wrote:
no fixed bar indices e.g. 0 first bar on chart - the indices are viewport based
Indicator calculation from strategy has nothing to do with the chart. If you mean that the result arrays are time-wise in ascending order (as opposed to MT), then it is "as designed".
No the order doesn't matter at all. MT5 even got the same reverse order. You simply reverse it yourself if you want it the other way. The problem is what you described - decoupling of indicators from charts - which are their primary (not sole yes) use. This way you cannot are always constrained to the current bars that jforex wants you to calculate. If you indicator wants to access the current chart_bar although you scrolled somewhere else this is not possible. You are always getting pushed around randomly based on viewport which also created the above mentioned problem in almost any calculation.

API Support wrote:
yoursong wrote:
difficult and unreliable multi currency access
You don't receive all possible instrument data on purpose, since it would cause storing irrelevant data in your local cache. You need to subscribe to all the needed instruments on strategy start, see https://www.dukascopy.com/wiki/#Subscrib ... instrument
Yeah of course. If you want to display an usd index (i know there are examples and they work alpha quality at best exactly because of this) it is a pain in the ... to get data from multiple instruments for the same amount of bars. Sometimes you got x bars there, x bars there and so on. It's never consistent and you can't really decide on your own how much you need / how much you want to access / calculate. Again because of the basic decoupling problem managed above you are always being constrained to arbitrary values / bars that are either not enough for your needs / that you don't want / need whatever. This is especially frustrating since jforex is excellent for this since it got no "empty - missing/skipped" bars like MT.

API Support wrote:
yoursong wrote:
no attaching a strategy to a specific chart
This might also be interpreted an advantage, that the strategy can work without a chart. It also makes multi-instrument strategies more straightforward. And you can always retrieve a chart from strategy if it is opened.
Yes in general that is fine. It could help to overcome iindicator decoupling problems though since a strategy actually follows the all bars are accessible logic (you are not restrained to viewport but can access any bar at any time). It still is less useful of course since you can only draw in charts and not create a indicator view window with a strategy. Basically a strategy attached to a specific chart could emulate 100% MT behavior if it could (in addition to being able to attach to a specific chart) open indicator split windows under a chart and draw in them like an indicator.

API Support wrote:
yoursong wrote:
no decent drawing methods
Please elaborate what additional methods do you require besides the ones that are given in https://www.dukascopy.com/wiki/#Chart_object_catalog
While i know you could override the draw methods and draw pretty much anything yourself the following are missing in my opinion:

- ohlc bars
- multi color lines etc (i know can be "hacked" but there we are again... usability is poor)
- draw those option on charts e.g. blank out current chart to draw your own candles of a synthetic instrument e.g. usdx on a chart or in an indicator. most simple thing would be of course if you could create your own feed / descriptor whatever to let the client chart a synthetic feed e.g. usdx. this would also solve most multi currency problems since you could simply change the underlying feed and then let indicators / strategies work on the output values

API Support wrote:
yoursong wrote:
The best thing of course would be if Dukascopy would just open source the client or at least charting.
We don't plan to do this. In case of any problems with chart usage, please register either a Bug report or Feature request.
No problem. Understandable.

PS: Don't be offended. It's just frustrating from time to time since the jforex api + feed is very good but there is of course a reason why everyone still uses MT for charting and tries to pull the feed into there instead of simply using the jforex client.


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Tue 15 May, 2012, 17:45 

User rating: 0
Joined: Fri 19 Aug, 2011, 20:29
Posts: 45
Location: Germany,
Hmm i am a bit surprised that my post get edited / forged although it was simple objective answers.


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Wed 16 May, 2012, 07:55 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The post's formatting made it hard to read and reply, we returned the contents and reformatted it. The post will be replied as soon as available.


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Wed 16 May, 2012, 12:02 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
yoursong wrote:
If you calculate an exponential moving average (same applies to almost any indicator) you calculate e.g. the SMA of your most left bar, calculate another 100 or whatever bars for smoothing and then calculate your actual EMA for every of the following bars till your recent bar based on the EMA value of the previous bar. This technique (which applies to most indicators) is crucial for at least half way performant calculation of a lot of such things on multiple charts. This is not possible in JForex (to my knowledge) since you cannot access prev. values. Instead of one calculation you calculate 200 or more (decent smoothing) bars for every single bar that you need a value for. This is already an absolut no go. You can't even simply save the values in your own array since you never really know where you are what has been calculated etc since it just randomly chooses a barrange based on the viewport. This might be because of the independence of indicators to charts but indicators are primarily meant for charts and decoupling them from each other defeats most of the purpose.
Exponential moving average uses the unstable period property which automatically gives the indicator access to previous bars for smoothing.
The latest bar can be accessed through IHistory object made available in indicators (IIndicatorContext.getHistory()).
You can, in some way, bypass the viewport limitation by setting recalclateAll/unstablePeriod to true in your custom indicators.

yoursong wrote:
If you indicator wants to access the current chart_bar
For that purpose you can use IHistory interface, which is accessible also from IIndicatorContext.
yoursong wrote:
You are always getting pushed around randomly based on viewport which also created the above mentioned problem in almost any calculation.
a) Indicator's job is to calculate output array over a given inputs array, b) jforex platform's job is to pass at the given moment the input array that it requires outputs for. You should not be concerned about b).

yoursong wrote:
Yeah of course. If you want to display an usd index (i know there are examples and they work alpha quality at best exactly because of this) it is a pain in the ... to get data from multiple instruments for the same amount of bars. Sometimes you got x bars there, x bars there and so on. It's never consistent and you can't really decide on your own how much you need / how much you want to access / calculate. Again because of the basic decoupling problem managed above you are always being constrained to arbitrary values / bars that are either not enough for your needs / that you don't want / need whatever. This is especially frustrating since jforex is excellent for this since it got no "empty - missing/skipped" bars like MT.
Please specify if you refer to strategies or indicators?
From strategy you can consistently retrieve the necessary bar data at any moment. See: https://www.dukascopy.com/wiki/#History_bars
For indicators, if you need a specified number of bars (i.e. >10), then set the lookback to 10, see: https://www.dukascopy.com/wiki/#IIndicator_interface/Method_getLookback
For indicator work with multiple instruments, see:
https://www.dukascopy.com/wiki/#Indicator_for_multiple_instruments

yoursong wrote:
It still is less useful of course since you can only draw in charts and not create a indicator view window with a strategy.
Do you mean plotting the indicator on chart? https://www.dukascopy.com/wiki/#Add_indicators_on_chart


yoursong wrote:
- ohlc bars
For strategy you would draw an rectangle and a short line.
For indicator you can use HeikenAshi indicator as an example, see:
https://www.dukascopy.com/wiki/#Platform_indicator_source_files
yoursong wrote:
- multi color lines etc (i know can be "hacked" but there we are again... usability is poor)
For strategy you would combine multiple short lines.
For indicator, if you suffice two-colored line with different trend-up and trend-down colors, then you can use:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/indicators/OutputParameterInfo.html#setColor2(java.awt.Color)
If you have any other setting for the coloring, then you need to use IDrawingIndicator.drawOutput.

yoursong wrote:
- draw those option on charts e.g. blank out current chart to draw your own candles of a synthetic instrument e.g. usdx on a chart or in an indicator. most simple thing would be of course if you could create your own feed / descriptor whatever to let the client chart a synthetic feed e.g. usdx. this would also solve most multi currency problems since you could simply change the underlying feed and then let indicators / strategies work on the output values
Again you can use Heikin Ashi indicator as example how to draw your custom candles. Also you can see CustomCandleIndicator as another example.

For more efficient assistance, for further inquiries please for each point specify if you are referring to IStrategy, IIndicator, platform chart usage, indicator calls from strategies, strategy usage with charts or indicator usage with charts.


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Thu 17 May, 2012, 09:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Regarding redistribution and copyrights, please see the copyright notice at the beginning of standalone.Main.java of JForexClientLibrary.


 
 Post subject: Re: Standalone API: charts available in strategy Post rating: 0   New post Posted: Sun 20 May, 2012, 18:57 
User avatar

User rating: 7
Joined: Fri 13 Jan, 2012, 20:49
Posts: 94
Location: Poland, Warsaw
Hi,

Thanks for the answers. I am glad there are people besides me who would find such functionality of API useful.

For me Dukascopy Desktop platform is generally fine but offers only basic functionality... I created own application for displaying quotes, sending orders, trades and position management and most importantly risk management. The app completely replaces and extends functionality of Dukascopy GUI.

The application is based on JForex Standalone API. The only thing that is missing is functionality of charts. I want to offer this app to my clients. If I have decided to do it now, the app without charts would be an incomplete product. Of course there are workarounds - I can run my app from JForex Desktop platform or run my app + JForex Desktop - those multiply windows would make it not only harder to use but also it is not elegant and not professional.

I know Dukascopy API already offers plenty of functionalities, it is free and most open API of forex broker I have ever seen. I think opening charts for developers would be the final complement of this great API.

Probably JForex Desktop platform and Standalone API could be decompiled and all needed classes extracted but such option is time consuming, not resistant to updates of API, not supported and what is more important probably it is not legal to offer such “hacked” product to clients.

Would be very grateful for adding this to “Features Requests” and API soon :)

Best regards,
Kurak


 
 Post subject: Re: JFOREX-3818 Standalone API: charts available in strategy Post rating: 1   New post Posted: Wed 04 Jul, 2012, 08:18 
User avatar

User rating: 7
Joined: Fri 13 Jan, 2012, 20:49
Posts: 94
Location: Poland, Warsaw
Dear Support,

Is there any roadmap for requests implementation? Is there any planned date of implementing this specific requirement?

Thanks and best regards,
Kurak


 
 Post subject: Re: JFOREX-3818 Standalone API: charts available in strategy Post rating: 0   New post Posted: Thu 05 Jul, 2012, 12:54 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
There is no a roadmap. But we will increase priority for such request.


 
 Post subject: Re: JFOREX-3818 Standalone API: charts available in strategy Post rating: 0   New post Posted: Thu 12 Jul, 2012, 05:41 

User rating: 7
Joined: Wed 11 Jul, 2012, 11:16
Posts: 34
Dear Support:

I will also jump on board and request that charting be available in the Standalone API.


 
 Post subject: Re: JFOREX-3818 Standalone API: charts available in strategy Post rating: 0   New post Posted: Mon 03 Sep, 2012, 09:40 
User avatar

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


 
 Post subject: Re: JFOREX-3818 Standalone API: charts available in strategy Post rating: 1   New post Posted: Mon 28 Jan, 2013, 19:57 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Yes, please continue to enhance what we can do with charting in the standalone API.

MouseClickListeners and ability to translate to time/price.
Ability to influence chart coloration attributes.
Ability to control whether chart shows closed trades, etc.

Anything that can be done to safely open the Charts to standalone API usage is appreciated.

HyperScalper


 
 Post subject: Re: JFOREX-3818 Standalone API: charts available in strategy Post rating: 0   New post Posted: Fri 10 Jul, 2015, 11:48 
User avatar

User rating: 21
Joined: Thu 19 May, 2011, 20:50
Posts: 413
Location: Germany, Munich
Is it possible to send my own feed to a JForex chart?
e.g. if I want to add EUR/USD and GBP/USD prices and display them in an own IChart. Is this possible?
I have not found anything like a CustomFeedDescriptor which would accept such a custom Instrument.


 

Jump to:  

  © 1998-2024 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