Currently, I am running two strategies. I would like to measure the P/L for those strategies separately. what is the best approach?
I prefer to use the same account so that need to transfer $ back and forth.
Currently, I am running two strategies. I would like to measure the P/L for those strategies separately. what is the best approach?
I prefer to use the same account so that need to transfer $ back and forth.
proxy your broker account in to sub accounts on a server you run send order flow the same but for account buying power and equity sub it in to self hosted accounts
@yan_2020 There isn’t a good way to run two, or more, independent strategies in the same account. On some level there needs to be an overarching ‘strategy manager’ to be aware of each strategy’s orders, or at the very least manage total leverage and buying power.
Two constraints you will need to manage 1) there cannot be a simultaneous long and short position in an account and 2) there cannot be both a buy and sell order for the same asset at the same time. This could result in a ‘wash trade’ and will result in orders being rejected.
Certainly the simplest approach to both manage orders as well as measure P/L for multiple strategies would be to only trade unique non-overlapping assets in each strategy. If that isn’t possible, one can set client_order_ids
for each order with some prefix or other identifier indicating the associated strategy. Then, when fetching orders to calculate P/L, one can assign specific trades to the specific strategy. This may not be easy to do if replacing orders or using stop orders or other order types where the system creates new orders and assigns new random client_order_ids
, but could be an option to calculate P/L by strategy.