Buy rule that trigger sell

I can't explain this precisely, but when you use dynamic weight you have two options at the very bottom: transaction scaling no and yes. If you use transaction scaling, you will have no negative cash balances; however, your formula weights will be inconsistent from week to week depending on how much cash you have available. So if you need to buy 1 position one week and 5 positions the next week, the weights of those positions will be completely different. If, on the other hand, you don't use transaction scaling, then the position weights will be relatively consistent, but the snag is that it sometimes has to go to negative cash to accomplish this. So that's why I set my leverage at 0.9 so that I don't have to dip into negative cash.

1 Like

I see, I get it. In your opinions which one is more replicabe in real trading? (between use transaction scaling and 0.9 leverage)

Also where do I find leverage setting?

Try running the simulation both ways and look at your weekly transactions. What you want to look for is your buys being consistent in terms of weight. Watch out if you're ending up buying huge amounts of a stock one week and small amounts of a stock another week, ending up with a portfolio with deep imbalances. In that case, transaction scaling is causing trouble. If, on the other hand, that's not a problem with transaction scaling, then maybe it works fine.

Keeping 0.9 or 0.95 leverage, in my opinion, reflects actual trading quite well, if you usually keep some cash on hand.

If you have a margin account, you probably want to set your margin limits to reflect that.

1 Like

I have been testing the buy driven simulations the last few days, im getting quite consistently better results with my strategies.

But one thing I have noticed that I don't understand. If I have a sell rule like "PosCnt > 25 and RankPos > 25", I can still be holding more than 25 positions and some leverage for many weeks on a row.

I'm still taking on a lot of leverage even with it set to 0.9 if I use more complex rank formula (like $estimated_profit - $estimated_cost), even with Max Portfolio Drift, Max Position Drift, and Min Rebalance Transaction are set to 100%.

This goes away if using a simple formula like "MktCap" or just "RankPos / 1" and the simulation runs as expected.

I'm not sure why the issue arises, but wondered if you had a solution for this? Normally I run just "Yes" on transaction scaling and that works fine. Thank you!

The reason I don't use transaction scaling is this. Let's say you're holding 15 positions and you sell one and buy one. And then the next week you sell four and buy four. And then the next week you sell one and buy one. Now look at the actual transactions and see how much of each stock you bought. Depending on the weight of the stocks you sold, the weights of the stocks you bought are going to be very wildly different from one week to the next because you're scaling transactions but not scaling the whole portfolio due to the limitations you use for max portfolio drift, max position drift, and min rebalance transactions. Now if you don't limit your transaction rebalances and just rebalance fully every on every rebalance date, then this won't be a problem. But if you have strict limits to prevent too much rebalancing, you'll find yourself with new positions that don't really correspond to the formula you're using.

1 Like