Fibonacci retracement levels mark horizontal price zones where a pullback might stall, based on ratios of a prior swing move.
Formula
From swing high H and swing low L over the lookback window:
Price_r = H − r × (H − L) (pullback in an uptrend)
Common ratios r: 0.236, 0.382, 0.5, 0.618, 0.786
Common levels
dogabot supports these retracement ratios:
| Level | Typical role |
|---|---|
| 0.236 | Shallow pullback |
| 0.382 | Moderate pullback |
| 0.5 | Midpoint of swing |
| 0.618 | “Golden” retracement — popular for entries |
| 0.786 | Deep pullback |
How levels are built
Over a lookback window (default 20 bars), dogabot finds the swing high and low, then projects retracement prices between them. The rule checks whether current price is near a chosen level (within about 0.5%).
How traders use Fibonacci
- Support on pullbacks — In an uptrend, traders watch 0.382–0.618 for buy zones.
- Resistance on rallies — In a downtrend, the same levels can act as sell zones.
- Confluence — Stronger when levels align with trend lines or prior structure.
In dogabot
The Fibonacci rule uses:
- entryLevel (default 0.618) for entry and reversal sections
- exitLevel (default 0.382) for exit section
Direction logic: retracement ratios ≥ 0.5 lean buy (support); lower ratios lean sell (resistance).
Example
Over 20 bars, swing high $100 and low $80. The 0.618 level is $87.64. If price pulls back to $87.50 (within ~0.5%), the Fibonacci rule with entryLevel 0.618 can fire a support-style buy in an uptrend context.