|
Attention! Read the forum rules carefully before posting a topic.
Try to find an answer in Wiki before asking a question. Submit programming questions in this forum only. Off topics are strictly forbidden.
Any topics which do not satisfy these rules will be deleted.
Minimizing order submission latency (tick listeners, orders, threads) |
rauschie
|
Post subject: Minimizing order submission latency (tick listeners, orders, threads) |
Post rating: 0
|
Posted: Fri 10 Jun, 2016, 13:52
|
|
User rating: 0
Joined: Tue 04 Sep, 2012, 06:35 Posts: 11 Location: Hungary,
|
I am building a system working with a few dozen tick feeds at a time, with order submissions triggered via the onTick method (the logic to be executed is basically the same, longer computations are done elsewhere).
Let's assume we have a class for each feed with some logic determining if an order needs to be placed, based on the last tick of the feed. The goal would be to minimize the latency of this class a) getting the last tick of the feed b)submitting an order if the conditions are met
At the moment I see two ways of doing this: either: each class implementing IStrategy in its own Thread and order placement getting triggered with IStrategy's .onTick() method or: Having a single strategy for order placement, implementing an own ITIckfeedListener for each feed , wrapping orders in a Callable and placing them via the strategy's IContex.ExecuteTask()
All other things being equal, is there a latency difference between the two methods? Would there be a better way of implementing the desired funcionality? Also, where do feeds come from (i.e which object is calling the onTick methods in the listeners)? Do I get any performance benefits running listeners in separate threads? How about orders? Is there anything to be done except making sure that IEngine.submitOrder gets called ASAP?
A big Thank You in advance for your input!
|
|
|
|
 |
API Support
|
Post subject: Re: Minimizing order submission latency (tick listeners, orders, threads) |
Post rating: 0
|
Posted: Mon 13 Jun, 2016, 13:46
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
First step could be to measure the latency. This is needed to make sure that response time does not get worse. To to that strategy can use time difference from ITick.getTime() to IOrder.getCreationTime(). Executing each strategy in a separate thread could improve response time. But it will add some overhead as well. One way that could improve performance is to use JForex SDK instead of JForex Client.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|