Momentum on one exchange
Momentum on one exchange's stocks, in any account currency: on the first trading day of each month, hold the eight US stocks and ETFs with the strongest six-month momentum that trade above their 200-day average, each an equal share of equity. Choose Run Settings ▸ Currency to hold them in an account in Australian dollars, euros or another currency the data has a forex pair for: cash, costs and results are then in that currency, each stock's prices stay in dollars, and its P&L includes the dollar's moves. Change "US" to another exchange's code, such as "ASX", to rotate its stocks instead.
Exchanges and currencies · world/one_exchange_momentum.rvw
language 1
strategy "Momentum on one exchange" {
universe exchange("US")
mom roc(close, lookback)
enter long when mom > 0 and close > sma(close, 200)
rank by mom
size equal weight, max 8 positions
rebalance monthly, band 20%
param lookback = 126 in 63..252 step 63
}
Functions it uses
Try it
These need data from more than one exchange or currency: stocks of other exchanges, a forex pair for each currency, and each currency’s interest rates for carry. stocks_and_forex.rvwp holds the market ETF strategy and the forex trend in sleeves of 70% and 30%, rebalanced each month. See Several exchanges’ days and Currencies and forex pairs.
File ▸ New Script from Example adds it to a project. The examples read the sample’s index label, SYN500, and market ETF, SYNSPY; when your data has neither, a sheet asks what to read instead, one of your index labels (or every stock and ETF) and a ticker, so the example runs on your data as it is.
Before you trust what it does on your data, see whether it’s luck: Is this result luck?