Basket Re-balancing Algo

I built a script to automatically re-balance a basket of commodities when prices go up or down. Kind of like a 401k, I have a target allocation for each. I track my average cost of each commodity, and sell an amount of shares for a particular commodity when it's price is high and buy an amount when it's low. The goal is for the algo to maintain a target allocation, accumulate shares when they are cheap, and sell for profit when they are high. I use a high and low threshold of 5% to trigger orders.

I wanted to ask this community, what do you think of this strategy? Does someone have a recommendation on how to backtest this? How to optimize the threshold?

Submitted September 28, 2020 at 09:44PM by policybreh

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s