- ago
I have multiple strategies running that all use MOC orders. There is a fair bit of overlap among the strategies in terms of symbols. Is there any way of overlaying netting across multiple WL strategies to minimise unnecessary trades/reduce costs? Thx
1
471
Solved
11 Replies

Reply

Bookmark

Sort
Cone8
 ( 6.07% )
- ago
#1
Strategies aren't going to be able to trade positions from other strategies for backtests. However, in Live Trading you can sync positions to the full size at the broker, which would effectively allow any one strategy to sell the entire position for any instrument.

But maybe you should give a specific example of what you mean, since I'm not really sure.
1
- ago
#2
That's helpful thx.

Common example is that I have a risk premia portfolio that includes TLT that usually rebalances once a month (up or down). I also have TLT in a strategy that exploits a monthly seasonality anomaly. At the moment both strategies run on the last day of the month. It's quite common for them to generate opposing signals, in some cases with a perfect size match, so collectively no trade is needed at all.

Sounds like what you suggest could work for this situation.
0
Cone8
 ( 6.07% )
- ago
#3
I don't think so. I was imagining a scenario in which you simply wanted to close all the shares when any strategy created an exit signal for that instrument.

Trading Strategies that run at the same time will still create multiple orders that would be all placed. But now I understand the scenario...

The idea is that if you're trading the same instrument in multiple accounts, when orders are placed on the same bar, you want to combine the shares to create a single order. So if one strategy sells 100 ABC and the other buys 150 ABC, you'd like to place one order to buy 50 ABC.

This may be impossible to pull off in practice since strategies don't really "run at the same time".

However, if it's important enough to you, you could combine multiple strategies into one to accomplish it.
You'd just collect the orders in a List and process them to create one combined order.
0
- ago
#4
QUOTE:
... both strategies run on the last day of the month. It's quite common for them to generate opposing signals, ...

What you really need to do is combine these two strategies into one so they are not fighting against one another. In your Execute {block}, you can create
CODE:
if (...) else if (...) else if (...) ... else
constructs so there are multiple legs for entry and exit for your many PlaceTrade statements. Be sure to include Signal messages in all your PlaceTrade statements so you can mouse over each trading triangle on the Chart to identify which PlaceTrade statement triggers that trade.

I do this all the time with strategies that share the same indicators, and it works nicely.
0
Best Answer
- ago
#5
Many thanks both.

Would it be possible to have another function (a meta strategy if you like) that called the other strategies at the desired time, aggregated their net order output and sent the net order to the broker?
0
Cone8
 ( 6.07% )
- ago
#6
Anything's "possible".
Worthwhile for the added complexity?

Probably not, but let's make it feature request and let the system decide.
Add your vote in the starter topic.
0
- ago
#7
QUOTE:
Would it be possible to have ... a meta strategy ... that called the other strategies

You're trying to make this too complicated. Just create a single strategy that combines the PlaceTrade statements from the other strategies into this single strategy with the "else if" Execute {block} construct discussed above. Keep it simple.

Having different strategies fighting each other on what to Buy and Sell is not good. That needs to be fixed (prioritized) with a unified process or paradigm (say within the PreExecute {block}).

It is possible the have the PreExecute {block} compute a discriminate "steering metric" for each stock (and for each bar independently) in a large dataset, which then can be sorted and passed into the Execute {block}. Stocks with high ranking metrics can be traded one way, and stocks with low ranking metrics can be traded another way. I would check out the PreExecute example at https://www.wealth-lab.com/Support/ApiReference/UserStrategyBase PreExecute questions should be posted in separate topic; just search the forum.
1
- ago
#8
I agree with @superticker on honoring the KISS principle by simply handling this in C# Strategy code rather than adding an arcane feature.
1
- ago
#9
Again thanks both. I wasn't actually thinking of a new WL feature - effectively in programming terms I was thinking of one function that called two (or perhaps more) others.

Anyway, need to digest and experiment with your suggestions. Thanks again, much appreciated.
2
- ago
#10
QUOTE:
Would it be possible to have another function (a meta strategy if you like) that called the other strategies at the desired time, aggregated their net order output and sent the net order to the broker?

Yes, the StrategyRunner. Its result is a Backtester instance with an Orders collection that you can do what you like with.
0
- ago
#11
Thx v much - totally missed that
0

Reply

Bookmark

Sort