Join today
Strategies / Momentum / Price Angle Trend

Price Angle Trend: trading the slope of price

This system measures the per bar percent change from the open 2 bars ago, turns it into an angle and runs it through a sine function. A cross above 0.02 buys and a cross below -0.02 sells short. It has not been backtested yet.

MomentumLong & shortSwingNot yet tested
This strategy has not been backtested yet. The rules and code are published now, and the numbers will appear here after the first runs.

Entry rules, long

  1. Members only

Entry rules, short

  1. Members only

Exit rules

  1. Profit target of 275 points
  2. Members only
  3. An opposite signal reverses the position

Parameters

positionSize
Contracts per trade
1
anglePeriod
Bars the price change is measured over
2
angleThreshold
Entry level for the angle reading
0.02
takeProfitPoints
Profit target in points
275
stopLossPoints
Protective stop in points
350

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.

// ============================================================
// Price Angle Trend
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: Not yet tested
// ============================================================

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

// --- Parameters ---
positionSize = 1          // contracts per trade
anglePeriod = 2           // bars the price change is measured over
angleThreshold = 0.02     // entry level for the angle reading
takeProfitPoints = 275    // profit target in points
stopLossPoints = 350      // protective stop in points

// --- Indicators ---
// Percent change per bar, turned into an angle and scaled with sine.
priceAngle = SIN(ATAN((close - open[anglePeriod]) / open[anglePeriod] * 100 / anglePeriod))

16 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • No backtest exists, so there is no evidence of an edge yet.
  • The 350 point stop is wider than the 275 point target, so the strategy needs a win rate well above half just to break even.
  • A 2 bar lookback reacts to very short moves, which can mean frequent reversals in sideways markets.

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 Price Angle Trend run in ProOrder?

The code is written for ProOrder, but it is not compile checked or tested. Backtest it on your chosen market first.

What has it been tested on?

Nothing yet. The point based stop and target are sized for an index like the DAX, so other markets would need new values.

What is the risk per trade at default size?

With 1 contract the stop is 350 points plus spread. There is no drawdown figure until a backtest is run.

Why a sine of an angle?

Converting the change to an angle and taking the sine squeezes large moves into a bounded range, so one threshold of 0.02 can work across calm and fast periods.

Related

Strategies like this one

Twelve Minus Two Momentum

Also a momentum strategy.

12.00 PF · 52 trades

Repulse DPO

Also a momentum strategy.

2.87 PF · 104 trades

MA Slope Momentum

Also a momentum strategy.

2.11 PF · 126 trades

Follow along as untested ideas get backtested. Join the ProRealAlgos waitlist.

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