OPEN-SOURCE SCRIPT
ที่อัปเดต:

Allah's Compass

1 017
This strategy trades bullish divergence setups using the Bollinger Band %B indicator (BB%) as its primary signal. Rather than trading price action directly, it reads momentum through the position of price relative to the Bollinger Bands, entering when oversold conditions show signs of reversal and exiting when price reaches the upper extreme.
Entry Logic
The strategy enters on a bullish divergence — when price makes a lower low but BB% makes a higher low, signaling that downside momentum is weakening while price is still falling. This divergence must occur while BB% is in oversold territory, filtered by an adjustable ceiling threshold. A second divergence while already in a trade triggers a scaled add-on position using a configurable multiplier. A third add-on fires when BB% crosses back above zero, confirming the bounce is underway.
Failed Run Double-Down
If BB% runs up after entry but fails to reach the exit threshold, then pulls back with price making a new low and a fresh divergence forming, the strategy adds to the position again using a separate multiplier. This targets the scenario where the first recovery attempt stalls and resets before a stronger move.
Exit Logic
All positions are closed when BB% reaches the configurable exit threshold, defaulting to 1.0 which represents price touching the upper Bollinger Band. A percentage-based stop loss is set at each entry and updated to the lowest stop across all add-on entries.
Inputs Summary
BB length, standard deviation multiplier, stop loss percentage, divergence lookback period, divergence BB% ceiling, double-down multiplier, failed run multiplier, green cross add-on toggle, and exit threshold are all adjustable from the strategy settings panel.
Release Note
Allah's Compass — Strategy Description
This strategy uses the Bollinger Band %B indicator (BB%) to identify momentum reversals, entering on strength confirmation and adding on weakness with a scaled recovery position.
Entry Logic
The initial buy triggers when BB% crosses above zero, meaning price has moved back inside the lower Bollinger Band and momentum is shifting upward. This is a smaller probe entry with a tight stop loss to keep risk low if the move fails immediately.
Divergence Add-On
If price pulls back while already in the trade and a bullish divergence forms — price making a lower low while BB% makes a higher low — the strategy adds to the position with a multiplied order size configurable in the settings. This larger add-on is designed to recover losses from the first entry being stopped out and capitalize on the stronger divergence signal. A separate wider stop loss is applied to this order to give it room to develop.
Stop Loss Structure
Two independent stop loss settings allow fine-tuned risk control. The first entry uses a tight stop to minimize damage if the initial green cross fails. Once the divergence add-on fires, the stop updates to the wider divergence stop, reflecting the higher conviction and larger position size. This two-tier structure is designed to reduce drawdown in downtrending conditions where the first entry gets faked out before the real move begins.
Exit Logic
All positions are closed when BB% reaches 1.0, meaning price has reached the upper Bollinger Band. This applies regardless of which entries are active.
Adjustable Settings
BB length, standard deviation multiplier, first entry stop loss, divergence add-on stop loss, divergence add-on size multiple, and divergence lookback bars are all configurable from the strategy settings panel.
Release Note
Allah's Compass — Strategy Description
This strategy uses the Bollinger Band %B indicator (BB%) to identify momentum reversals, entering on strength confirmation and adding on weakness with a scaled recovery position. Pyramiding is set to 3, allowing up to three entries in the same direction within a single trade.
Entry Logic
The initial buy triggers when BB% crosses above zero, meaning price has moved back inside the lower Bollinger Band and momentum is shifting upward. This is a smaller probe entry with a configurable stop loss to keep risk low if the move fails immediately.
Divergence Add-On
If price pulls back while already in the trade and a bullish divergence forms — price making a lower low while BB% makes a higher low — the strategy adds to the position with a multiplied order size configurable in the settings. This larger add-on is designed to recover losses from the first entry and capitalize on the stronger divergence signal. A separate wider stop loss is applied to this order to give it room to develop.
Stop Loss Structure
Two independent stop loss settings allow fine-tuned risk control. The first entry uses its own stop to minimize damage if the initial green cross fails. Once the divergence add-on fires, the stop updates to the divergence stop level, reflecting the higher conviction and larger position size. Both stops default to 100% so they are effectively disabled until manually configured. This two-tier structure is designed to reduce drawdown in downtrending conditions where the first entry gets faked out before the real move begins.
Exit Logic
All positions are closed when BB% reaches 1.0, meaning price has reached the upper Bollinger Band. This applies regardless of which entries are active.
Adjustable Settings
BB length, standard deviation multiplier, first entry stop loss, divergence add-on stop loss, divergence add-on size multiple, divergence lookback bars, and pyramiding depth are all configurable from the strategy settings panel.
Release Note
Visual Signals

🟢 Green triangle — initial long entry
🔵 Aqua diamond — divergence buy go bigger
🟠 Orange diamond — divergence sell or go bigger
🔴 Red triangle — exit signal at BB% top



Allah's Compass — BB% Momentum & Divergence Strategy
A Bollinger Band %B oscillator-based strategy designed to catch momentum entries at the lower band and ride price back toward the upper extreme.
Entry Logic

Primary entry triggers when BB% crosses up through 0 (price reclaims the lower Bollinger Band)
Divergence add-on triggers when price makes a lower low but BB% holds higher — signaling hidden strength — while BB% is below 0.2

Exit Logic

Full position exit when BB% reaches or exceeds 1.0 (price at or above the upper Bollinger Band)
Stop loss adjustable via input (default disabled at 100%)

Visual Signals

🟢 Green triangle — initial long entry
🔵 Aqua diamond — bullish divergence add-on
🟠 Orange diamond — bearish divergence warning (price higher high, BB% lower high above 0.8)
🔴 Red triangle — exit signal at BB% top

Background Zones

Light green — BB% between 0 and 0.5 (lower half, building momentum)
Teal — BB% above 0.5 (upper half, trending)
Red — BB% below 0 (outside lower band, oversold)

Best used on higher timeframes with trending instruments. Combine with price action and SMC confluence for highest probability setups.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน