Thesis
Buy the imbalance bar of a fresh bullish FVG; short the mirror. Exit when the gap fills.
Fits Mean reversion setups — works best when the underlying market behavior matches the thesis, and breaks down when it doesn't. Pair with the backtester's walk-forward mode before committing real capital.
Momentum-into-imbalance — fires on explosive bars, exits when the imbalance reverts. Equity curve is choppy with frequent small trades; works best when price respects imbalances and gives the bot a chance to ride the displacement.
YAML rule-set
Paste this into the Strategy Designer's Text tab, or use the dashboard button above to load it as a template.
_template:
title: Fair Value Gap — buy unfilled bullish FVG
category: mean_reversion
skill: intermediate
name: fair_value_gap
weight: 1.0
long_only: false
indicators:
fvg:
kind: fair_value_gap
min_gap_pct: 0.001
entry:
combine: OR
rules:
- combine: AND
direction: long
rules:
- {lhs: {indicator: fvg, field: bull_signal}, op: gt, rhs: {value: 0}}
- combine: AND
direction: short
rules:
- {lhs: {indicator: fvg, field: bear_signal}, op: gt, rhs: {value: 0}}
exit:
combine: OR
rules:
- {lhs: {indicator: fvg, field: bull_filled}, op: gt, rhs: {value: 0}}
- {lhs: {indicator: fvg, field: bear_filled}, op: gt, rhs: {value: 0}}
risk:
trailing_stop_pct: 0.04
cooldown_bars: 3
Indicators
fvgFair Value Gap (min gap 0.1%)Clean-room 3-bar Fair Value Gap / imbalance detector. bull_signal / bear_signal fire on the bar a new gap opens; bull_filled / bear_filled fire when price retraces back through the gap.
Entry conditions
The bot opens a position the bar after every condition below has fired.
- Long on the bar a bullish FVG opens (bull_signal > 0).
- Short on a bearish FVG.
Exit conditions
Any of the conditions below will close the position.
- Position closes the bar the gap is filled (rebalanced).
- 4% trailing stop, 3-bar cooldown.
Expected behavior
Momentum-into-imbalance — fires on explosive bars, exits when the imbalance reverts. Equity curve is choppy with frequent small trades; works best when price respects imbalances and gives the bot a chance to ride the displacement.
Equity-curve character, not a return forecast. Backtests are not promises about live performance.
Try it on your own data
Open the template in the dashboard to backtest it on BTC, ETH, or any CCXT symbol — or copy the YAML into the Strategy Designer to edit it first.
Past behavior on backtests is not a guarantee of future performance. Markets change; rule sets need re-validation. Trade at your own risk.