Pyramid Momentum

Pyramid Momentum is a strategy that trades NAS100 on 1-hour bars. It takes long trades only, adds up to 3 entries in the same direction, keeps at leas

state

pyramid-momentum.abx
1strategy "Pyramid Momentum"
2market: NAS100
3bars: 1h
4direction: long
5pyramiding: 3
6min_distance: 100 points
7max_total_risk: 3%
8
9state adds = 0
10
11when crosses_above(close, ema(close, 50)) and trades.open().len == 0:
12buy risk: 1%, stop: 3 * atr(14), tag: "core"
13adds = 0
14
15when trades.open().len > 0 and adds < 2 and close > trades.last().entry_price + 2 * atr(14):
16buy risk: 0.5%, stop: 3 * atr(14), tag: "add"
17adds += 1
18
19when crosses_below(close, ema(close, 50)):
20close_all
What this script says

Pyramid Momentum is a strategy that trades NAS100 on 1-hour bars. It takes long trades only, adds up to 3 entries in the same direction, keeps at least 100 points between entries and never risks more than 3% across open trades.

It remembers adds from one bar to the next.

When the close crosses above the 50-bar EMA of the close and the number of open trades is 0, it buys at market, risking 1% of the balance, with a stop 3 × the 14-bar ATR from the entry and tagged "core"; it also sets adds to 0.

When the number of open trades is above 0 and adds is below 2 and the close is above trades.last().entry_price plus 2 × the 14-bar ATR, it buys at market, risking 0.5% of the balance, with a stop 3 × the 14-bar ATR from the entry and tagged "add"; it also adds 1 to adds.

When the close crosses below the 50-bar EMA of the close, it closes all trades.

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account