Dukascopy
 
 
Wiki JStore Search Login

Cannot catch the Exception of waitForUpdate(...)
 Post subject: Cannot catch the Exception of waitForUpdate(...) Post rating: 0   New post Posted: Mon 16 Mar, 2015, 08:47 
User avatar

User rating: 0
Joined: Sat 02 Aug, 2014, 10:12
Posts: 23
Location: China, Shijiazhuang
Hi, support!
^Codes:
if (cA < 0) {
try {
order_short = submitOrder(getlots(), OrderCommand.SELL, slippage);
order_short.waitForUpdate(10000, FILLED);
cA = 0;
} catch (JFException e) {
}
}
^Operational environment:
History Back Testor.
EURUSD,M15,Last 6 Months.
^Result:
The console print info just as below:
com.dukascopy.api.JFException: state is CLOSED
at com.dukascopy.dds2.greed.agent.strategy.tester.cc.a(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.w.a(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.ba.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.dukascopy.dds2.greed.agent.strategy.tester.aw.a(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.cc.waitForUpdate(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.cc.waitForUpdate(Unknown Source)
at clientsprograms.AccStrategy.onTick(AccStrategy.java:103)
at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.w.run(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.Fh(Unknown Source)
at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.EA(Unknown Source)
at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

^PS:
In "submitOrder(...)" method, there are some codes to set sl/tp with the order which was submited. So, it is too near that makes the order to be closed by sl/tp instantly after it was submited. The problem is that I try to catch the JFException in codes, but it still appears.


 

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