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.

The getStrategyChartObjects method does not work as expected
 Post subject: The getStrategyChartObjects method does not work as expected Post rating: 1   New post Posted: Wed 25 Dec, 2013, 20:28 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
The getStrategyChartObjects method of the interface IChart does not work as expected.
It returns an empty list of created objects while objects are obviously created.
    public void onStart(IContext context) throws JFException {
        IChart chart = context.getLastActiveChart();
        ICustomWidgetChartObject widget = chart.getChartObjectFactory().createChartWidget();
        chart.add(widget);
        context.getConsole().getOut().println(chart.getStrategyChartObjects()); // output is empty list, but an object has been created
        context.stop();
    }
A test strategy is attached.


Attachments:
Widget.java [902 Bytes]
Downloaded 63 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.
 
The Best Answer  Post subject: Re: The getStrategyChartObjects method does not work as expected Post rating: 0   New post Posted: Tue 07 Jan, 2014, 16:30 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is a legacy method which is going to be deprecated with the next JForex-API version. If you wish to keep track on all strategy-created objects, simply maintain their collection in a local field of type java.util.Set.


 

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