Dukascopy
 
 
Wiki JStore Search Login

Strategy not working on Remote Run!
 Post subject: Strategy not working on Remote Run! Post rating: 0   New post Posted: Thu 25 Jul, 2013, 22:03 

User rating: 0
Joined: Thu 25 Jul, 2013, 21:54
Posts: 7
Hi,

I prepared a strategy in the demo version. After some fine tuning it was running perfectly in local run mode for more than one week of testing. Then I tried it on remote run mode and it works nothing!

Some problem I found:
1) IOrder.waitForUpdate(800) almost always timeout after 0,8 sec even if order already changed state (and it's the same even if I increase it to 2000, didn't tried more)
2) But biggest problem is that the cycle
for(IOrder o : myEngine.getOrders()){
if(o.getState() == IOrder.State.OPENED){
o.close();
o.waitForUpdate(800);
}
}
Get stupid list of orders and try to cancel orders that are NOT present while not cancelling order that should be canceled.

If someone can help I would be really grateful, since it many days that I can't understand why strategy work perfectly in Local Run but totaly wrong on Remote Run.

Thanks in advance


Attachments:
LongEURCHFOscillator3.java [11.92 KiB]
Downloaded 386 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: Strategy not working on Remote Run! Post rating: 0   New post Posted: Fri 26 Jul, 2013, 09:03 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Both Locally and Remotely the strategy did trade. If you want to report a difference in Local vs Remote behaviour then please:
  • Precisely describe what order action gets executed differently.
  • Post an example strategy which pin-points the problem and does not do any additional trading logic.


 
 Post subject: Re: Strategy not working on Remote Run! Post rating: 0   New post Posted: Mon 29 Jul, 2013, 21:29 

User rating: 0
Joined: Thu 25 Jul, 2013, 21:54
Posts: 7
Hi,

In attachment a much simpler strategy and the log generated while running.

Strategy should do this:
1) Lunch Refresh() function that cancel all Open Orders and put 30 PLACE_BID just under actual EURCHF market price
2) Every 5 minutes check all Open Orders and if they are not 30, re-lunch Refresh()

I tested this strategy on Local Run and I don't find any problems. Everything seems OK!

Now what happens when I test in on Remote Run is:
1) At the start lunch Refresh() --> Almost Perfect! Just a little consideration: Why the "OrderPlaced[i].waitForUpdate(800);" at line 165 of the code always time out after 0,8 second? (look the log) Does it take so long to place an order? It's not a critical problem but it slow down a lot strategy.
2) After first 5 minutes it check all Open Orders (which should and are 30 on my screen since no one has been executed!!) and here I start having some trouble because:
- Strategy doesn't see ANY orders in open state (code from line 95 to 100 should get them!!!), but they should be 30!!
- As consequence strategy put in log: "Incoerence of submitted orders. Submitted: 0; Should be: 30" and lunch again Refresh()
3) This time Refresh() works badly and differently from the first time at the start. In particular
- NO orders all canceled! Code from line 153 to 159 is not working!
- This time "OrderPlaced[i].waitForUpdate(800);" doesn't timeout after 0,8 sec but all orders got executed very fast!
- After refresh I can see on my screen that 60 orders are placed and not 30! Ofc since noone got canceled but 30 new where put!
4) After other 5 minutes strategy execute again the check of orders in open status and again I have trouble:
- From log you can see that it seems that Strategy see ONLY 19 orders in open state!!!! Even if should be 60!
- But in any case Strategy act like there are 30 orders and do not print something like "Incoerence of submitted orders. Submitted: 19; Should be: 30"
- As consequence Strategy DO NOT lunch Refresh()... even if there are 60 orders and log show only 19...

If you can help me with this issue because I can find what is not working on remote run and this is preventing me from going live!!

Thanks in advance for your time!

best regards,
Riccardo


Attachments:
StrategyLog.txt [16.28 KiB]
Downloaded 359 times
TestRemoteStrategy.java [5.93 KiB]
Downloaded 353 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: Strategy not working on Remote Run! Post rating: 0   New post Posted: Tue 30 Jul, 2013, 12:53 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The issue has been registered.


 
 Post subject: Re: Strategy not working on Remote Run! Post rating: 0   New post Posted: Thu 01 Aug, 2013, 11:14 

User rating: 0
Joined: Thu 25 Jul, 2013, 21:54
Posts: 7
I have some news on this issue.

Most problems come from the fact that strategy submit order in the onStart method. All order submitted in the onStart just "disappear" for the strategy, manually I see them but strategy acts like they did not exist. If I change the strategy just skipping the first call of Refresh() in the onStart body, the strategy works almost well.

I say almost because I still have the issue that the println() doesn't work well and everytime skip some lines.
This happens also on every strategy that I use on remote run. When I use println() method inside a fast cycle it skips some line on the log. This issue affect only reporting and not the execution of orders but still generate some trouble because a incomplete log doesn't allow me to monitor correctly the strategy while executing.

In any case I would like to understand why order submitted on onStart method generate such problems.

Kind regards and thanks for your time in dealing with this issue,
Riccardo Faroppa


 

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