Order Operations Thread Safe dispatch ?

Created at 07 Apr 2015, 22:37
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
HY

hyperscalper

Joined 02.03.2015

Order Operations Thread Safe dispatch ?
07 Apr 2015, 22:37


For a Robot which has its own asynchronous Threading,

what is the method of safely dispatching Orders and Trade Requests?

For example, in JForex Java API the Callable interface is used so that

any asynchronous thread can safely dispatch Order Entry operations

using Future<type> f = context.executeTask(<task implementing Callable interface>)

Thanks!

HyperScalper

 


@hyperscalper
Replies

hyperscalper
07 Apr 2015, 22:42

Trying to be clear here, what I mean is that normally Robot trading

logic is placed in onTick or onBar.  For critical trade operations, from asynchronous

threads there needs to be a way for those asynchronous threads to safely

execute/dispatch code, as though the code were in the onTick or onBar context

and executing on the same thread, I assume, which is used to serialize operations.

HyperScalper

 


@hyperscalper

hyperscalper
09 Apr 2015, 03:18

 

Well, the "poor man's way" of doing things would be to

queue up some action specs, and maybe pick items off the

queue for execution on a Timer tick maybe.....  But I was

hoping for a more advanced method.  HyperScalper

 


@hyperscalper

Spotware
09 Apr 2015, 17:19

Dear Trader,

Currently there is no such dispatching method in the API. We plan to add it in the future.

Well, the "poor man's way" of doing things would be to

queue up some action specs, and maybe pick items off the

queue for execution on a Timer tick

It is the only way for now.


@Spotware