Active Trade Manager

Active Trade Manager is a strategy that trades XAUUSD on 5-minute bars. It holds at most 1 open trade.

core language

active-trade-manager.abx
1strategy "Active Trade Manager"
2market: XAUUSD
3bars: 5m
4max_open: 1
5
6when crosses_above(close, vwap()) and rsi(close, 7) > 55:
7buy risk: 1%, stop: 2 * atr(14), target: 3R, tag: "managed"
8
9for trade in trades.open(tag: "managed"):
10if trade.r >= 1 and trade.stop < trade.entry_price:
11modify trade, stop: trade.entry_price
12elif trade.r >= 2:
13close trade, size: 50%
14modify trade, target: trade.entry_price + atr(14) * 6
Watch it run · XAUUSD · 5m bars
entrystoptargetexit

Sample 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: 2 trades.

What this script says

Active Trade Manager is a strategy that trades XAUUSD on 5-minute bars. It holds at most 1 open trade.

When the close crosses above VWAP and the 7-bar RSI is above 55, it buys at market, risking 1% of the balance, with a stop 2 × the 14-bar ATR from the entry, with a target 3R from the entry and tagged "managed".

On each bar, it goes through each trade in open trades tagged "managed" and checks whether trade.r is at or above 1 and trade.stop is below trade.entry_price and, if so, moves the stop to trade.entry_price for trade; otherwise, if trade.r is at or above 2, closes trade (50% of it) and moves the target to trade.entry_price plus 6 × the 14-bar ATR for trade.

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

Create my free account