How about basket trading strategy #529
-
Hi, Here is some background why I ask this question: in equities trading, there is a set of popular strategy tends to trading a basket of signal names as a whole. for example, statistical arbitrage which could run intraday at different frequency (depending on how fast the computation can be done after sampling and how fast can we trade). Usually the basket could contain from 2 to 200 or even more names. as I mentioned, this kind of strategy tends to trade at some sample times, as the computation could be heavy and execution could be slow. I noticed that the project run backtest and trading based on single names (Instruments), correct me if I am wrong please. I understand that you can always involves multiple instruments in 1 strategy. however, we need some kind of sync to make sure all the instrument in the basket get the sample time and data, and produce a target basket, them try to execute them as a whole. Like partial fill is not great as it breaks strategies to some degree. I guess this probably more a client side thing to implement. But I am wondering do you have any suggestion to construct this kind of strategy in nautulus trader? or even build in some function in to core engine, or you think it is better just leave it to the client side. thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @wangzhe3224 , |
Beta Was this translation helpful? Give feedback.
-
Hi Zhe, You're right that you'd want a single strategy to handle a rebalancing from one portfolio state to a target state. Then at this stage you would need to write your own logic to execute towards your target portfolio state. Something as simple as calculating the differences (within a threshold or not), and submitting the necessary orders. This rebalancing approach is very popular though, and will likely be one of the first execution algos introduced, however for the time being it falls into the category of specific strategy logic, and so must be written by the trader. Hope this helps to shed some light! |
Beta Was this translation helpful? Give feedback.
Hi Zhe,
You're right that you'd want a single strategy to handle a rebalancing from one portfolio state to a target state.
Assuming you have those { 2 .. 200 } instruments available, then you could just fetch those with the
self.cache.instrument(...)
method (if you needed to reference them for price and quantity).Then at this stage you would need to write your own logic to execute towards your target portfolio state. Something as simple as calculating the differences (within a threshold or not), and submitting the necessary orders.
This rebalancing approach is very popular though, and will likely be one of the first execution algos introduced, however for the time being it falls into the…