Post subject: order.setStopLossPrice() invocation requires context.executeTask() wrapper?
Post rating: 0
Posted: Tue 13 Mar, 2012, 20:53
User rating: 3
Joined: Mon 23 May, 2011, 16:06 Posts: 17 Location: Hungary,
Dear Support,
I've read in the API Javadoc that users have to use context.executeTask() for submitting orders from threads other than that of the concerning strategy. Is this obligation stands for order.setStopLossPrice() too? (I'd like to invoke setStopLossPrice() from a TimerTask to avoid too frequent stop-loss change requests.)
Thanks, regards, Argiris
API Support
Post subject: Re: order.setStopLossPrice() invocation requires context.executeTask() wrapper?
Is this obligation stands for order.setStopLossPrice() too?
Yes, all trade-related operations need to be done in the strategy thread OR when called from another thread the Callable task needs to be executed in IContext.executeTask. See: https://www.dukascopy.com/wiki/#Threading