Momentum Rotation

Momentum Rotation is a strategy that trades EURUSD, GBPUSD, USDJPY and AUDUSD on 4-hour bars. It holds at most 1 open trade.

several markets

momentum-rotation.abx
1strategy "Momentum Rotation"
2markets: EURUSD, GBPUSD, USDJPY, AUDUSD
3bars: 4h
4max_open: 1
5
6input lookback = 30
7input threshold = 2%
8
9when bar.confirmed and trades.open(tag: "rotation").len == 0:
10for s in [EURUSD, GBPUSD, USDJPY, AUDUSD]:
11if roc(close_of(s), lookback) > threshold:
12buy market: s, risk: 0.5%, stop: 30 pips, target: 2R, tag: "rotation"
13break
14
15when trades.open(tag: "rotation").len > 0 and roc(close, lookback) < 0:
16close_all tag: "rotation"
What this script says

Momentum Rotation is a strategy that trades EURUSD, GBPUSD, USDJPY and AUDUSD on 4-hour bars. It holds at most 1 open trade.

You can change 2 inputs: lookback (default 30) and threshold (default 2%).

When the bar has closed and the number of open trades tagged "rotation" is 0, it goes through each s in EURUSD, GBPUSD, USDJPY and AUDUSD and checks whether the rate of change of the close of s over lookback bars is above threshold and, if so, buys s at market, risking 0.5% of the balance, with a stop 30 pips from the entry, with a target 2R from the entry and tagged "rotation"; it also stops the loop.

When the number of open trades tagged "rotation" is above 0 and the rate of change over lookback bars is below 0, it closes all trades tagged "rotation".

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

Create my free account