Dukascopy
 
 
Wiki JStore Search Login

Reusing of strategy object
 Post subject: Reusing of strategy object Post rating: 3   New post Posted: Wed 20 Nov, 2013, 22:04 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
I've noticed that the object of a strategy isn't being destroyed after local running strategy stops.
If this strategy local runs again the platform (DEMO 2.29.1) re-uses the object of a strategy.

Question to the Support Team:
if this is a bug, please fix it;
if this is a feature for performance purpose, please document it.

Thanks in advance.
package jforex;

import com.dukascopy.api.*;

public class TestStrategyObject implements IStrategy {

    public void onStart(IContext context) throws JFException {
        context.getConsole().getOut().println(this.hashCode());
        context.stop();
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {}
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
    public void onMessage(IMessage message) throws JFException {}
    public void onAccount(IAccount account) throws JFException {}
    public void onStop() throws JFException {}
}


Attachments:
File comment: Local run this strategy TWICE and see the same hash.
TestStrategyObject.java [629 Bytes]
Downloaded 249 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: Reusing of strategy object Post rating: 0   New post Posted: Sat 05 Apr, 2014, 23:08 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
Hi, Support Team!

Any comments?


 

Jump to:  

cron
  © 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