Join today
Strategies / Momentum / Twelve Minus Two Momentum

Twelve Minus Two Momentum

The system compares two past closes, one 28 bars back and one 207 bars back. If the recent one is higher, it buys and holds until that comparison flips. It is long only and sizes each trade from a fixed capital amount.

MomentumLong onlySwingVisaDaily
12.00Profit factor
38,440Net profit USD
61.54%Win rate
52Trades
-8,990Max drawdown
739Avg trade

Best run of 31. Visa, Daily, from run stock2-queue:2026-09-15-Visa.tsv:13.

Entry rules, long

  1. Members only
  2. No position is open

Exit rules

  1. Members only
  2. No stop loss or target

Test conditions

PeriodUp to 2026-09-15
InstrumentVisa, Daily
Capital per trade10,000
CostsNot recorded for this run.
BarsDaily bars, full available history
Last tested2026-09-15

Parameters

capitalPerTrade
Money committed to each trade
10000
recentLag
Bars back to the recent reference close
28
distantLag
Bars back to the distant reference close
207

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
VisaBest runDaily12.00 5261.5438,440 USD-8,990
PalantirDaily111.46 1376.9279,699 USD-50,083
MetaDaily13.28 1952.6379,285 USD-16,771
BroadcomDaily10.25 6251.6175,723 USD-16,715
AmazonDaily9.95 10757.94177,764 USD-94,854
OracleDaily9.77 14957.72257,341 USD-78,792
TeslaDaily8.92 6746.27207,426 USD-48,440
CiscoDaily8.54 10845.37179,574 USD-45,603
MicrosoftDaily8.12 11446.49169,311 USD-40,856
AppleDaily7.88 9154.95175,138 USD-40,091
NvidiaDaily6.78 7047.14149,329 USD-57,284
AbbVieDaily6.48 4768.0916,154 USD-6,527
MastercardDaily6.42 5954.2451,965 USD-16,760
WalmartDaily6.16 19752.79122,002 USD-20,904
AlphabetDaily5.93 3464.7114,192 USD-5,273
Lam ResearchDaily4.14 10648.1192,002 USD-34,505
ExxonMobilDaily4.10 20154.2377,170 USD-7,211
Coca-ColaDaily3.97 19949.2564,236 USD-12,081
Eli LillyDaily3.90 17350.87103,217 USD-14,390
S&P 500Daily3.27 17455.1743,109 EUR-4,902
Johnson & JohnsonDaily3.23 21650.4662,022 USD-10,144
Berkshire HathawayDaily2.94 10444.2327,076 USD-7,719
CostcoDaily2.82 14051.4347,827 USD-12,266
Bank of AmericaDaily2.45 9255.4330,060 USD-15,712
Applied MaterialsDaily2.33 10650.0036,101 USD-43,779
ChevronDaily2.26 15354.9025,356 USD-5,342
CaterpillarDaily1.84 23145.8941,171 USD-12,765
AMDDaily0.81 9236.96-10,026 USD-41,370
IntelDaily0.34 911.11-12,833 USD-19,500
JPMorganDaily0.20 4325.58-10,192 USD-10,310
MicronDaily0.12 825.00-10,992 USD-15,567

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.0501001502001.0 = break-evenPalantir · Daily111.46Meta · Daily13.28Visa · Daily12.00Broadcom · Daily10.25Amazon · Daily9.95Oracle · Daily9.77Tesla · Daily8.92Cisco · Daily8.54Microsoft · Daily8.12Apple · Daily7.88Nvidia · Daily6.78AbbVie · Daily6.48Mastercard · Daily6.42Walmart · Daily6.16Alphabet · Daily5.93Lam Research · Daily4.14ExxonMobil · Daily4.10Coca-Cola · Daily3.97Eli Lilly · Daily3.90S&P 500 · Daily3.27Johnson & Johnson · Daily3.23Berkshire Hathaway · Daily2.94Costco · Daily2.82Bank of America · Daily2.45

Net profit against max drawdown

Net profitMax drawdown
0-100K-50K250K500KOracle · DailyTesla · DailyCisco · DailyAmazon · DailyApple · DailyMicrosoft · DailyNvidia · DailyWalmart · DailyEli Lilly · DailyLam Research · DailyPalantir · DailyMeta · DailyExxonMobil · DailyBroadcom · DailyCoca-Cola · DailyJohnson & Johnson · Daily

The code

ProBuilder, rewritten to house standard

Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.

// ============================================================
// Twelve Minus Two Momentum
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long only
// Timeframe tested: Daily
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
capitalPerTrade = 10000   // money committed to each trade
recentLag = 28            // bars back to the recent reference close
distantLag = 207          // bars back to the distant reference close

// --- Indicators ---
positionSize = capitalPerTrade / close
momentumUp = close[recentLag] > close[distantLag]
momentumDown = close[recentLag] < close[distantLag]

14 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • The best run on Visa had only 52 trades. Palantir had 13, Intel 9 and Micron 8, which is too few to rely on.
  • No stop loss. Exits wait for the 28 and 207 bar comparison to flip, so drawdowns can be deep, such as USD 50,082.96 on Palantir.
  • Four stocks lost money: AMD, Intel, JPMorgan and Micron.
  • Tested only on large US stocks and the S&P 500, a group that rose strongly over the test period.

How to load it

  1. Copy the code with the copy button above the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Questions

About this strategy

Can I run it in ProOrder on stocks?

Yes, it works on Daily bars and places market orders. The code is a rewrite without a compile check, and the stats are from the earlier version.

Which stocks were tested?

A set of large US stocks from Apple to Walmart, plus the S&P 500. Visa made USD 38,439.91 with a profit factor of 12.0, while AMD, Intel, JPMorgan and Micron ended negative.

How much capital does each trade use?

Each trade commits 10000 USD, divided by the close to get the share count. Visa's max drawdown at that size was USD 8,990.42.

Why Daily bars?

The rule looks back 207 bars, which on Daily bars covers most of a trading year. On faster bars the signal would lose that meaning.

Related

Strategies like this one

Four Percent Dip

Best run on the same market, Visa.

8.77 PF · 68 trades

Long-Term Moving Average Cross

A similar profit factor.

12.31 PF · 61 trades

Repulse DPO

Also a momentum strategy.

2.87 PF · 104 trades

Stock momentum can sit next to index and FX systems. Join the ProRealAlgos community to learn how.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs