Performance Throttle

Performance Throttle is a strategy that trades EURUSD on 30-minute bars. It holds at most 1 open trade and stops for the day after losing $500.

account and history

performance-throttle.abx
1strategy "Performance Throttle"
2market: EURUSD
3bars: 30m
4max_open: 1
5max_daily_loss: $500
6
7input base_risk = 1%
8
9week = history.this_week
10recent_r = trades.closed(tag: "trend").keep_last(10).map(t => t.r).sum()
11risk_scale = if week.profit_factor < 1 or recent_r < -3 then 0.5 else 1.0
12
13when crosses_above(ema(close, 20), ema(close, 50)):
14buy risk: base_risk * risk_scale, stop: 25 pips, target: 2R, tag: "trend"
15
16on exit(trade):
17if trade.reason == "stop" and trade.r <= -1:
18log "Stopped out; recent R total is {recent_r:0.0}"
What this script says

Performance Throttle is a strategy that trades EURUSD on 30-minute bars. It holds at most 1 open trade and stops for the day after losing $500.

You can change one input: base_risk (default 1%).

It calculates week as history.this_week, recent_r as trades.closed(tag: "trend").keep_last(10).map(t => t.r).sum() and risk_scale as 0.5 when week.profit_factor is below 1 or recent_r is below -3, otherwise 1.0.

When the 20-bar EMA of the close crosses above the 50-bar EMA of the close, it buys at market, risking base_risk × risk_scale of the balance, with a stop 25 pips from the entry, with a target 2R from the entry and tagged "trend".

When a trade closes, it checks whether trade.reason is "stop" and trade.r is at or below -1 and, if so, logs "Stopped out; recent R total is {recent_r:0.0}".

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

Create my free account