17 Comments
User's avatar
TradeQuantiX's avatar

What would be really cool is if you took say 5 good strategies that are stable over time and then 5 strategies which die/fail at some point in the backtest, then see if the controller can catch on to this and keep the portfolio afloat when half of its strategy’s are decaying.

Then in live trading you can rest assured that if a strategy loses it edge your portfolio won’t suffer.

Expand full comment
Stuart Farmer's avatar

That’s a cool idea… Maybe I’ll make a mock example and see how it goes. In theory, it should work.

I found it kind of difficult to allocate across systems that oscillate between bad and good in my preliminary work continuously.

Expand full comment
TradeQuantiX's avatar

Yea I think it would be super powerful. Have you considered a noise buffer where allocations don’t change to ignore noise? May make it less likely to whipsaw

Expand full comment
Stuart Farmer's avatar

Interesting… how would you define noise? Some of the systems I wrote about like OLMAR and LOAD use the passive aggressive update for this reason. It tries to stay passive to avoid transaction fees and whipsaw but then aggressively updates if needed.

Expand full comment
TradeQuantiX's avatar

That’s probably more sophisticated than I was thinking. I was thinking a simple % buffer where you don’t update unless the change in allocation is more than x% different. But I’m sure there are more intricate methods

Expand full comment
Stuart Farmer's avatar

Yeah maybe you look at directional change so you only make a decision after an asset has moved X% since the last time you updated its allocation.

You could also probably use some sort of digital filters to help. There was some StackOverflow thread I came across a long time ago where someone made a novel online system that ignored outliers but then “caught on” if the outlier persisted after a few time step. I’ll try to find it.

But yeah something like this would be super helpful I imagine.

Also tuning the target and maybe changing that into some sort of loss function or regret function (amount of profit lost by not being allocated optimally or in the current winning strategy).

Expand full comment
Rong Deng's avatar

If you set your target very high it might allocate everything to the best performer and becomes momentum chasing. if your target is medicore then it will allocate less to the best past performer and become mean reversion.. is it the right understanding of the dynamics?

Expand full comment
Mehdi's avatar

why not using your surefire ratio instead of the sortino ratio ?

Expand full comment
Stuart Farmer's avatar

Give it a try ;)

Expand full comment
Nipples Ultra's avatar

What techniques are available for executing these trades?

Scenario: I could run the notebook every weekend and change the pie weights on an M1 robo-trading portfolio. Next Monday, M1 sells a few/buys a few.

Maybe loading the code into Alpaca/Tradestation?

Expand full comment
Stuart Farmer's avatar

Good question. I actually have some preliminary execution code that allows you to take strategies you make in Portwine and deploy them but it’s not ready for release, and would be a paid feature.

Otherwise, you can get the weights, calculate the difference between the new weights and your current portfolio to determine the buys and sells needed, and execute like that.

There’s also the possibility of translating the code into another platform’s programming system like EasyLanguage or MQL but I haven’t dug too deep into that. MQL in my experience is such a headache and barely a serious development environment so I would advise against that.

When you say M1 robo trader, what are you referring to?

Expand full comment
Nipples Ultra's avatar

Apologies, I mixed up two concepts, algorithmic trading and simple rebalancing. M1 does rebalancing. They have the "pie" UI for stock basket management: you pick desired percentage weights for each stock in the basket (each slice of the pie, adding up to 100%). The rebalance operation will buy and sell what is needed to match that weight set. This is not algorithmic trading.

Fidelity has "Baskets", which are roughly the same thing, they only offer rebalancing. Fidelity has a few other products for managing a portfolio.

Expand full comment
Stuart Farmer's avatar

Ah... Ok! So you're talking about this app: https://m1.com/

Yes, that should work if you can manually input the weights and they handle the execution.

Expand full comment
Everett Minshall's avatar

Maybe a novice question, but what is sortino and why use that as the 'heading' over other metrics?

Expand full comment
Stuart Farmer's avatar

The 'heading'? What do you mean?

The Sortino ratio is an improvement over the Sharpe ratio. The Sharpe ratio seeks to maximize the mean returns, and minimize the volatility (standard distribution of those returns). But, in doing so, upward volatility, or volatility in the direction you want, is treated the same as downside volatility.

The Sortino ratio only looks at downside volatility when penalizing the score. Therefore, it can be seen as a more 'sophisticated' approach.

Expand full comment
SmartReversals's avatar

Very good content.

Expand full comment
MT's avatar

I’m skeptical

Expand full comment