Wick to Body Ratio Trend Forecast

Wick to Body Ratio Trend Forecast

1) One-line summary

This indicator (by Fluxchart) compares the wick-to-body ratio of the latest candle to historical analogues and projects an average forward path on your chart, color-coding each forecast step by dispersion/confidence.

2) The problem it solves (TL;DR)

Candlestick wicks vs bodies often reveal imbalance between aggressive and passive flows. Instead of reading a single candle in isolation, this tool hunts the past for candles with similar wick/body structure, then projects the typical path that followed comparable setups—giving you a data-driven, visual “what usually happens next” for the next N bars.

3) How it works — intuition

  1. Compute a ratio per candle that encodes wick/body relationships (four modes available).
  2. Find historical candles whose ratio is sufficiently close to the current one (optionally only same bullish/bearish direction).
  3. For each match, take the price trajectory around the match (see “Algorithm details”) and average those trajectories to draw a forecast line ahead of the current bar.
  4. Use dispersion (standard deviation) among matched paths to color each segment: tighter agreement ⇒ lower dispersion; wider disagreement ⇒ higher dispersion.

Practical read: the slope of the projected line suggests likely path; the color hints at confidence.

4) The four ratio modes (when to use which)

  • General Ratio (default)
    Compares total wick length to body, signed by candle direction.
    Use it for a balanced, all-purpose analogue search.
  • Top Wick Ratio
    Focuses on the upper wick relative to body, signed by direction.
    Use it when upper rejections/exhaustion (selling into highs) are central to your thesis.
  • Bottom Wick Ratio
    Focuses on the lower wick relative to body, signed by direction.
    Use it for hammer-type absorption or lower-shadow demand clues.
  • Body Ratio
    Body vs full range.
    Use it to emphasize closing strength within the bar’s range (breakout/drive conditions).

5) Inputs & defaults (cheat sheet)

Input Default What it does Typical tweaks
loopback 400 How many past bars to scan for analogues. 200–1000 depending on timeframe/market history.
forecast 10 Number of forecast bars to draw ahead. 5 (scalping) to 20 (swing).
ratioType 1 1=General, 2=Top Wick, 3=Bottom Wick, 4=Body. Switch per setup hypothesis.
directionBias 1 If 1, only compare candles with the same direction (bull/bear). Set 0 to allow cross-direction analogues.
defaultAccuracy 2 Initial tolerance for ratio matching: 1=High (strict), 2=Medium, 3=Low (loose). Tighten for clean regimes; loosen in noisy ones.
deviationHigh(R,G,B) 255,0,0 Color when dispersion is high (lower confidence). Adjust to your palette.
deviationLow(R,G,B) 0,0,255 Color when dispersion is low (higher confidence). Adjust to your palette.
trendSquare 1 Draw a box around each matched analogue window. Turn off for a cleaner chart.
trendSquareLabels 1 Show ratio labels for current & matched candles. Useful for debugging/tuning.
displayLogs 1 Show on-chart warnings (e.g., no matches). Keep on while calibrating.

Note on colors: by default blue = lower dispersion (higher agreement), red = higher dispersion (lower agreement).

6) What you’ll see on the chart

  • Forecast polyline ahead of the last bar: one segment per future step up to forecast.
  • Color per segment from dispersion: blue ≈ more agreement among matches; red ≈ less.
  • Boxes around historical analogue windows (if enabled), so you can visually audit what the indicator considered “similar.”
  • Text labels with the computed ratio for the current bar and each match (if enabled).

7) Algorithm walkthrough (step by step)

  1. Compute the ratio & sign
    • Based on ratioType, the indicator calculates myRatio using OHLC and assigns a sign from candle direction (bullish = +, bearish = −).
    • The General mode normalizes total wick vs body; Top/Bottom isolate upper/lower wick contributions; Body uses body vs full range.
  2. Adaptive matching loop
    • Start from an initial accuracy (0.02, modified by defaultAccuracy).
    • Scan up to loopback bars back. For each past bar i, compare absolute ratios |myRatio[i]| vs |myRatio[1]|.
    • A match occurs if the difference ≤ accuracy and, when directionBias=1, the sign matches.
    • The loop widens accuracy if < 5 matches, tightens if > 15; otherwise it accepts the set (guarded by a safety loop of 20 passes).
    • If accuracy exceeds 0.10 with zero matches, a warning is displayed and the routine exits.
  3. Build the forecast path from analogues
    • For each matched bar, the code aggregates relative price changes over the forecast length into arrays:
      candleValue = close[i - y - 1] - close[i] for y = 0…forecast-1.
    • Those values are averaged across matches to obtain an average trajectory avgCurrent, avgNext.

    Implementation nuance: the indicator projects forward the average pre-move path around each analogue, applied from today’s close. In practice, this works like a pattern-shape template.

  4. Confidence via dispersion
    • It computes a standard deviation for each step from the sums of squares, and toggles the color:
      low dispersion ⇒ deviationLow (default blue), high dispersion ⇒ deviationHigh (default red).
  5. Draw it
    • The forecast is drawn ahead of the last bar using DRAWSEGMENT, from close[1] + avgCurrent to close[1] + avgNext, step by step.

7) ProBuilder code

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

avatar
Register or
Related users ' posts
xpe74 Hello it seems the file format does not allow to import the file. At importation stage, an e...
Iván You always can copy/paste directly from the post
elcortijoverde Gracias Iván,...sigo tus videos en Youtube. Ya estoy con la V12 y se descarga, pero algo est...
elcortijoverde Bueno, ya aparecen las velas, pero ahora, cada fin de vela aparece un nuevo pronóstico y no ...
Roger Gracias por compartir, pero no tengo ninguna predicción. @Ivan @elcortijoverde ¿qué modifica...
Nicolas
6 years ago
Tradingrob Hi Nicolas, i am not that of a coder.. Did you make already a new PRC so we can download the...
Tradingrob Was easier than i thought! thanks! it works now great!
falco44 Bonjour Nicolas, L'indicateur n'affiche rien, peux tu m'aider stp ?
Nicolas Please add a request on forums for any MT4 code conversion, thank you. Follow these easy ste...
mecon I will do so, thank you!
avatar
Anonymous @mecon, did you ever get one?

Top