Dukascopy
 
 
Wiki JStore Search Login

testerClient not finish
 Post subject: testerClient not finish Post rating: 0   New post Posted: Tue 24 Sep, 2013, 02:20 
User avatar

User rating: 0
Joined: Wed 03 Jul, 2013, 14:08
Posts: 16
Location: BrazilBrazil
Why my testerClient strategy don't finish.

I have 64 tests to run and all still "waiting" after onStop().

How to fix?


 
 Post subject: Re: testerClient not finish Post rating: 1   New post Posted: Tue 24 Sep, 2013, 12:11 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Hi,

I think it is nearly impossible to say without any further information, code sample, or anything that helps.
Show us the strategy that ' hangs'. Explain the running conditions, etc, etc.

Edit: also you have better chance to get help here. But only, if you have provided more information...


 
 Post subject: Re: testerClient not finish Post rating: 0   New post Posted: Tue 24 Sep, 2013, 13:52 
User avatar

User rating: 0
Joined: Wed 03 Jul, 2013, 14:08
Posts: 16
Location: BrazilBrazil
I have 64 strategies to run, so I need iterate over than:

for (Configuration configuration: configurations)
    new runMyStrategy(configuration)


On my tests purpose I try with:

new runMyStrategy(configurations.get(0))


Here runMyStrategy is my all ITesterClient process (connect, set strategy/instrument, run strategy and desirable exit).
and I got System.exit(0).

On my strategy I have:

testClient.setSystemListener(new ISystemListener() {
            private int lightReconnects = 3;

            @Override
            public void onStart(long processId) {
                LOGGER.info("Strategy started: " + processId);
            }

            @Override
            public void onStop(long processId) {
                LOGGER.info("Strategy stopped: " + processId);

                File reportFile = new File(filename + ".html");
                try {
                    testClient.createReport(processId, reportFile);
                } catch (Exception e) {
                    LOGGER.error(e.getMessage(), e);
                }

                if (testClient.getStartedStrategies().size() == 0)
                    System.exit(0); // exit
            }


I don't want to exit of all, I need to stop only this strategy.
If I comment this System.exit(0), my strategy enter onStop, process it and don't exit, still "running".

I try put testClient.stopStrategy(strategyId) on OnStop, but it always return null to strategyId (i guess it already done). strategyId is the long strategyId = testClient.startStrategy(...);


 
 Post subject: Re: testerClient not finish Post rating: 0   New post Posted: Tue 24 Sep, 2013, 14:11 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Hi,

Take a look on this topic, where I tried to achieve something similar. I am not exactly sure if you are after something similar, but maybe...


 

Jump to:  

  © 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