OPEN-SOURCE SCRIPT
SMC Strategy BTC 1H - OB/FVG

General Context
This strategy is based on Smart Money Concepts (SMC), in particular:
The bullish Break of Structure (BOS), indicating a possible reversal or continuation of an upward trend.
The detection of Order Blocks (OB): consolidation zones preceding the BOS where the "smart money" has likely accumulated positions.
The detection of Fair Value Gaps (FVG), also called imbalance zones where the price has "jumped" a level, creating a disequilibrium between buyers and sellers.
Strategy Mechanics
Bullish Break of Structure (BOS)
A bullish BOS is detected when the price breaks a previous swing high.
A swing high is defined as a local peak higher than the previous 4 peaks.
Order Block (OB)
A bearish candle (close < open) just before a bullish BOS is identified as an OB.
This OB is recorded with its high and low.
An "active" OB zone is maintained for a certain number of bars (the zoneTimeout parameter).
Fair Value Gap (FVG)
A bullish FVG is detected if the high of the candle two bars ago is lower than the low of the current candle.
This FVG zone is also recorded and remains active for zoneTimeout bars.
Long Entry
An entry is possible if the price returns into the active OB zone or FVG zone (depending on which parameters are enabled).
Entry is only allowed if no position is currently open (strategy.position_size == 0).
Risk Management
The stop loss is placed below the OB low, with a buffer based on a multiple of the ATR (Average True Range), adjustable via the atrFactor parameter.
The take profit is set according to an adjustable Risk/Reward ratio (rrRatio) relative to the stop loss to entry distance.
Adjustable Parameters
Enable/disable entries based on OB and/or FVG.
ATR multiplier for stop loss.
Risk/Reward ratio for take profit.
Duration of OB and FVG zone activation.
Visualization
The script displays:
BOS (Break of Structure) with a green label above the candles.
OB zones (in orange) and FVG zones (in light blue).
Entry signals (green triangle below the candle).
Stop loss (red line) and take profit (green line).
Strengths and Limitations
Strengths:
Based on solid Smart Money analysis concepts.
OB and FVG zones are natural potential reversal areas.
Adjustable parameters allow optimization for different market conditions.
Dynamic risk management via ATR.
Limitations:
Only takes long positions.
No trend filter (e.g., EMA), which may lead to false signals in sideways markets.
Fixed zone duration may not fit all situations.
No automatic optimization; testing with different parameters is necessary.
Summary
This strategy aims to capitalize on price retracements into key zones where "smart money" has acted (OB and FVG) just after a bullish Break of Structure (BOS) signal. It is simple, customizable, and can serve as a foundation for a more comprehensive strategy.
This strategy is based on Smart Money Concepts (SMC), in particular:
The bullish Break of Structure (BOS), indicating a possible reversal or continuation of an upward trend.
The detection of Order Blocks (OB): consolidation zones preceding the BOS where the "smart money" has likely accumulated positions.
The detection of Fair Value Gaps (FVG), also called imbalance zones where the price has "jumped" a level, creating a disequilibrium between buyers and sellers.
Strategy Mechanics
Bullish Break of Structure (BOS)
A bullish BOS is detected when the price breaks a previous swing high.
A swing high is defined as a local peak higher than the previous 4 peaks.
Order Block (OB)
A bearish candle (close < open) just before a bullish BOS is identified as an OB.
This OB is recorded with its high and low.
An "active" OB zone is maintained for a certain number of bars (the zoneTimeout parameter).
Fair Value Gap (FVG)
A bullish FVG is detected if the high of the candle two bars ago is lower than the low of the current candle.
This FVG zone is also recorded and remains active for zoneTimeout bars.
Long Entry
An entry is possible if the price returns into the active OB zone or FVG zone (depending on which parameters are enabled).
Entry is only allowed if no position is currently open (strategy.position_size == 0).
Risk Management
The stop loss is placed below the OB low, with a buffer based on a multiple of the ATR (Average True Range), adjustable via the atrFactor parameter.
The take profit is set according to an adjustable Risk/Reward ratio (rrRatio) relative to the stop loss to entry distance.
Adjustable Parameters
Enable/disable entries based on OB and/or FVG.
ATR multiplier for stop loss.
Risk/Reward ratio for take profit.
Duration of OB and FVG zone activation.
Visualization
The script displays:
BOS (Break of Structure) with a green label above the candles.
OB zones (in orange) and FVG zones (in light blue).
Entry signals (green triangle below the candle).
Stop loss (red line) and take profit (green line).
Strengths and Limitations
Strengths:
Based on solid Smart Money analysis concepts.
OB and FVG zones are natural potential reversal areas.
Adjustable parameters allow optimization for different market conditions.
Dynamic risk management via ATR.
Limitations:
Only takes long positions.
No trend filter (e.g., EMA), which may lead to false signals in sideways markets.
Fixed zone duration may not fit all situations.
No automatic optimization; testing with different parameters is necessary.
Summary
This strategy aims to capitalize on price retracements into key zones where "smart money" has acted (OB and FVG) just after a bullish Break of Structure (BOS) signal. It is simple, customizable, and can serve as a foundation for a more comprehensive strategy.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.