Hedged Breakout
Hedged Breakout is a strategy that trades EURUSD on 1-hour bars. It holds at most 2 open trades (1 per side) and hedges on an opposite signal.
core language
strategy "Hedged Breakout"market: EURUSDbars: 1hopposite: hedgemax_open: 2max_open_per_side: 1when crosses_above(close, highest(high, 24)[1]):buy risk: 0.5%, stop: 40 pips, target: 80 pips, tag: "up"when crosses_below(close, lowest(low, 24)[1]):sell risk: 0.5%, stop: 40 pips, target: 80 pips, tag: "down"for trade in trades.open():if trade.bars_open >= 48:close tradeSample data. Not a result. The real AlgoBarsX engine ran this exact script on made-up bars, and this replays what it drew and did. It shows no profit or loss, and it says nothing about how the script would do in a real market.
Replay of this script on 150 sample bars: 8 trades.
Hedged Breakout is a strategy that trades EURUSD on 1-hour bars. It holds at most 2 open trades (1 per side) and hedges on an opposite signal.
When the close crosses above the previous bar's highest high of the last 24 bars, it buys at market, risking 0.5% of the balance, with a stop 40 pips from the entry, with a target 80 pips from the entry and tagged "up".
When the close crosses below the previous bar's lowest low of the last 24 bars, it sells at market, risking 0.5% of the balance, with a stop 40 pips from the entry, with a target 80 pips from the entry and tagged "down".
On each bar, it goes through each trade in open trades and checks whether trade.bars_open is at or above 48 and, if so, closes trade.