Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Reusing of strategy object
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=81&t=50397
Page 1 of 1

Author:  hebasto [ Wed 20 Nov, 2013, 22:04 ]
Post subject:  Reusing of strategy object

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 252 times

Author:  hebasto [ Sat 05 Apr, 2014, 23:08 ]
Post subject:  Re: Reusing of strategy object

Hi, Support Team!

Any comments?

  Page 1 of 1