Skip to content

Equal-weight portfolio

Request an equal-weight target across four instruments on a monthly schedule.

Complete strategy

12_equal_weight_portfolio.strat
//@version=1

universe: [RELIANCE, TCS, INFY, HDFCBANK]
run: monthly
size: 99% of portfolio in total
hold: equal weight

# Original: rebalance to equal weight every 10 BARS.
# This example uses a monthly rebalance cadence.

Read the rule

The names share one 99% portfolio-basis budget, before constraints and rounding. Each desires 24.75%. This form can rebalance the target holdings; independent entries and exits are a different strategy shape.

Try it in the editor

Copy the script into a TradeScript draft, resolve diagnostics and use the historical backtest flow. Start by inspecting an entry and exit or a portfolio rebalance. Change one value at a time.

Read the target book

Rule Declaration in the sample
Schedule run: monthly
Budget size: 99% of portfolio in total
Selection and split hold: equal weight

With four eligible names and a basis of 10,000, the desired budget is 9,900, or 2,475 per name. The remaining 100 is outside the desired allocation before costs and rounding. Equal money targets generally require different unit quantities when prices differ.

On an eligible monthly evaluation, the strategy can adjust continuing positions toward the new targets. It does not wait for an RSI entry and does not use conditional exit clauses. Adding a fifth eligible name changes each equal desired share to 19.8%.

Change the budget or membership

Change the budget to 80% to target 20% per name with this four-name list. Change the list to alter what is held. If you want to select only some names by a score, use a ranked hold: form and read its allocation defaults. Inspect each rebalance's target amounts and orders rather than searching for an entry signal.