Join today
Strategies / Momentum / Vectorial Slope

Vectorial Slope

The angle of a 10-period EMA over 15 bars must reach 45 or more for a long, or -37 or less for a short. A 20 EMA slope must also confirm against its signal line. Exits use percent targets, an ATR trailing stop and a time stop on losing trades.

MomentumLong & shortSwingUS Crude OilDaily
1.76Profit factor
8,907Net profit EUR
87.31%Win rate
268Trades
-4,158Max drawdown
33.23Avg trade

Best run of 15. US Crude Oil, Daily, spread 3, from run pf:2026-09-15-CRUDE-D.tsv:2.

Entry rules, long

  1. The angle of the 10 EMA over 15 bars is 45 or more
  2. Members only
  3. That slope is still below zero

Entry rules, short

  1. The angle of the 10 EMA over 15 bars is -37 or less
  2. Members only
  3. That slope is above -1

Exit rules

  1. Long target 4.25%, short target 1.25%
  2. Members only
  3. A losing long is closed after 950 bars, a losing short after 650 bars

Test conditions

PeriodUp to 2026-09-15
InstrumentUS Crude Oil, Daily
Spread3 points
Contracts1
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-09-16

Parameters

positionSize
Contracts per long trade
1
shortSizeMultiplier
Shorts trade this multiple of positionSize
2
anglePeriod
EMA length for the angle
10
angleLookback
Bars the angle is measured over
15
buyAngle
Minimum angle for a long
45
sellAngle
Maximum angle for a short
-37
slopePeriod
EMA length for the slope
20
slopeLookback
Bars the slope is measured over
35
slopeLag
Extra length for the slope's signal line
5
slopeSellFloor
Shorts only while the slope is above this
-1
longTargetPct
Long profit target, percent
4.25
shortTargetPct
Short profit target, percent
1.25
useTrailingStop
1 turns the trailing stop on
1
trailAtrPeriod
ATR length for the trail distance
25
trailLongFactor
Trail distance multiple for longs
7.5
trailShortFactor
Trail distance multiple for shorts
4
atrPriceDivisor
Price scaling inside the ATR input, as published
10
atrScaleDivisor
Final ATR scaling, as published
1000
minStopPoints
Minimum trail distance
0
maxBarsLong
Close a losing long after this many bars
950
maxBarsShort
Close a losing short after this many bars
650

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
US Crude OilBest runDaily1.76 26887.318,907 EUR-4,158
SilverDaily1.62 20581.4610,550 USD-4,229
FTSE 1004 hours1.34 37480.755,627 EUR-3,421
DAX 404 hours1.33 39880.9011,668 EUR-7,541
Dow Jones1 hour1.29 46065.4324,708 EUR-8,304
Nikkei 2254 hours1.19 33183.0814,346 USD-12,547
US Crude Oil30 min1.18 2,10973.2116,844 EUR-4,602
Nikkei 2251 hour1.16 1,21870.2828,930 USD-18,706
S&P 5005 min1.16 30460.861,277 EUR-921
DAX 4030 min1.14 1,99760.3916,845 EUR-5,328
Nikkei 22530 min1.12 2,18661.0232,383 USD-23,899
Nasdaq 10030 min1.11 1,41765.0710,901 EUR-7,938
Brent Crude30 min1.11 1,55072.328,152 EUR-6,335
DAX 401 hour1.10 1,38768.2010,393 EUR-9,180
S&P 5001 minn/a 5352.83569 EUR-494

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.00.51.01.52.01.0 = break-evenUS Crude Oil · Daily1.76Silver · Daily1.62FTSE 100 · 4 hours1.34DAX 40 · 4 hours1.33Dow Jones · 1 hour1.29Nikkei 225 · 4 hours1.19US Crude Oil · 30 min1.18Nikkei 225 · 1 hour1.16S&P 500 · 5 min1.16DAX 40 · 30 min1.14Nikkei 225 · 30 min1.12Nasdaq 100 · 30 min1.11Brent Crude · 30 min1.11DAX 40 · 1 hour1.10

Net profit against max drawdown

Net profitMax drawdown
0-25K-13K25K50KNikkei 225 · 30 minNikkei 225 · 1 hourDow Jones · 1 hourDAX 40 · 30 minUS Crude Oil · 30 minNikkei 225 · 4 hoursDAX 40 · 4 hoursNasdaq 100 · 30 minSilver · DailyDAX 40 · 1 hourUS Crude Oil · DailyBrent Crude · 30 minFTSE 100 · 4 hoursS&P 500 · 5 minS&P 500 · 1 min

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.

// ============================================================
// Vectorial Slope
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: Daily
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false
DEFPARAM PreloadBars = 1000

// --- Parameters ---
positionSize = 1            // contracts per long trade
shortSizeMultiplier = 2     // shorts trade twice the long size
anglePeriod = 10            // EMA used for the angle
angleLookback = 15          // bars the angle is measured over
buyAngle = 45               // minimum angle for a long
sellAngle = -37             // maximum angle for a short
slopePeriod = 20            // EMA used for the slope
slopeLookback = 35          // bars the slope is measured over
slopeLag = 5                // extra length for the slope's signal line
slopeSellFloor = -1         // shorts only while the slope is above this
longTargetPct = 4.25        // long profit target, percent
shortTargetPct = 1.25       // short profit target, percent
useTrailingStop = 1         // 1 = trailing stop on
trailAtrPeriod = 25         // ATR length for the trail distance
trailLongFactor = 7.5       // trail distance multiple for longs
trailShortFactor = 4        // trail distance multiple for shorts
atrPriceDivisor = 10        // price scaling inside the ATR input, as published
atrScaleDivisor = 1000      // final scaling of the ATR, as published
minStopPoints = 0           // minimum trail distance
maxBarsLong = 950           // close a losing long after this many bars
maxBarsShort = 650          // close a losing short after this many bars

// --- Indicators ---
angleMA = ExponentialAverage[anglePeriod](close)
angleSlope = (angleMA - angleMA[angleLookback] * PipSize) / angleLookback
angleValue = ATAN(angleSlope)

slopeMA = ExponentialAverage[slopePeriod](close)
slopeValue = (slopeMA - slopeMA[slopeLookback] * PipSize) / slopeLookback
slopeSignal = ExponentialAverage[slopePeriod + slopeLag](slopeValue)

atrTrail = AverageTrueRange[trailAtrPeriod]((close / atrPriceDivisor) * PipSize) / atrScaleDivisor
trailDistanceLong = round(atrTrail * trailLongFactor)
trailDistanceShort = round(atrTrail * trailShortFactor)

63 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • Shorts trade 2 contracts and longs 1, so short-side losses weigh twice as much.
  • Losing trades can stay open up to 950 bars for longs and 650 for shorts before the time exit closes them.
  • The best run on US Crude Oil Daily had 268 trades with a max drawdown of EUR 4,158.
  • Many rows have a profit factor near 1.1, for example DAX 40 1 hour at 1.1 with a drawdown of EUR 9,179.90.

Indicators used

EMAATR

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 Vectorial Slope be automated in ProOrder?

Yes. The rewritten code has not been compile-checked, and the stats come from the pre-rewrite version.

How did it do across markets?

Every row tested was profitable. US Crude Oil Daily had a profit factor of 1.76, Silver Daily 1.62 and DAX 40 4 hours 1.33.

What does 1 contract risk?

At 1 contract for longs and 2 for shorts, the best run had a max drawdown of EUR 4,158. Nikkei 225 30 minutes reached USD 23,898.70.

Why do the long and short rules differ?

Longs need a 45 angle and a 4.25% target, while shorts use -37 and 1.25%. The tested version treats down moves as shorter and sharper.

Related

Strategies like this one

Monday Dip Buy

Uses the same indicator.

n/a PF · 146 trades

Pathfinder

Best run on the same market, US Crude Oil.

1.24 PF · 430 trades

RSI 2 Trend Pullback

A similar profit factor.

1.76 PF · 362 trades

Momentum systems like this are part of what we trade. Join the ProRealAlgos waitlist to see more.

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