About

Phoenix Next Candle Bias is a table in the corner of the chart. It scores five signals from recent candles. Then it adds them up to one reading: BULLISH, BEARISH or NEUTRAL. Bullish means leaning up. Bearish means leaning down.

To add it in KAGAMI, click Indicators at the top of the chart. Search for it, then click Phoenix Next Candle Bias v1.0 - Table Only. On the chart, its name shows as PHX Bias Table. See Indicators.

This indicator is not in every account's Indicators list yet.

What you see on the chart

A chart shows the price as candles, also called bars. Each candle is one slice of time. The timeframe is how much time each candle covers.

Nothing is drawn on the candles. You see one dark table in the top-right corner of the price area. It has a thin gold border. The table always describes the last candle that has closed.

From top to bottom:

  • PHX BIAS and the reading: BULLISH in green, BEARISH in red or NEUTRAL in grey. Next to it is its strength: STRONG, MODERATE, WEAK or NEUTRAL.
  • ▲ Bull Prob and ▼ Bear Prob. Two percentages that always add up to 100%. They are a score, shown as a percentage. They are not a real chance.
  • ─ Signals ─, with the columns State and Wt. Wt means weight: how much each signal counts.
  • Structure (25%). Are recent peaks and dips getting higher or lower?
  • Order Block (20%). Is the price back inside a candle from just before a strong move?
  • FVG (15%). FVG means fair value gap. It is a jump between candles that left a gap. Is one close to the price?
  • Momentum (20%). Has the price been moving up or down lately? This row uses averages of past closes and the RSI.
  • Candle (20%). The shape of the last closed candle.
  • Liquidity (Bonus). Did the last candle poke past a recent high or low, then close back inside? This row is only shown. It does not change the score.
  • RSI(14). The RSI is a number from 0 to 100. It compares recent up moves with recent down moves. You see its zone and its value.
  • Statistical bias only — not a prediction. This is the table's own reminder.

In each row, green points up, red points down and grey means neither.

The table keeps its dark colours on a light chart too.

A 15-minute chart of AAPL with the dark signal table in the top-right corner. The table reads PHX BIAS, BULLISH, MODERATE, then Bull Prob 83% and Bear Prob 17%, then the signal rows, most of them green.A 15-minute chart of AAPL with the dark signal table in the top-right corner. The table reads PHX BIAS, BULLISH, MODERATE, then Bull Prob 83% and Bear Prob 17%, then the signal rows, most of them green.
AAPL, 15-minute candles, New York time, with the table for the 11:00 candle. 1 — the top row: BULLISH, with the strength MODERATE. 2 — ▲ Bull Prob 83% and ▼ Bear Prob 17%. 3 — the five signal rows, with their state and weight. Order Block is grey: Outside OB. The other four are green. 4 — the last closed candle. The table describes this candle.

How traders often read it

  • Many traders read the top row as a quick summary of all the rows.
  • Some traders look at how many rows agree. When most rows are green, Bull Prob is higher.
  • When the rows disagree, the reading is often NEUTRAL. Many traders read that as "no clear lean".
  • Some traders compare a STRONG reading with a WEAK one.
  • Some traders compare the same market on several timeframes.
  • Some traders look at single rows, like RSI(14) showing Overbought ⚠ or Oversold ⚠.

The table only describes candles that have closed. It cannot know what the next candle will do. An indicator only describes past prices. It cannot tell the future.

The settings

This indicator has no settings you can change in KAGAMI. It always uses fixed values:

  • Weights: Structure 25%, Order Block 20%, FVG 15%, Momentum 20% and Candle 20%.
  • Neutral zone: one side needs 55% or more. Otherwise the reading is NEUTRAL.
  • Peaks and dips: a peak or a dip needs 5 candles on each side.
  • Averages: EMAs of the last 8, 21, 50 and 200 closes. An EMA is an average that counts the newest prices more.
  • RSI: measured over 14 candles.
  • The table: top right, with large text.

When it can mislead

  • The name says "next candle". But the table only describes closed candles. It does not know the next one.
  • The percentages are not chances. They come from fixed rules and weights. A high Bull Prob is no promise.
  • The forming candle is left out. The table changes only when a candle closes. On a daily chart, that is once a day.
  • Few candles. Some rows need 50 candles of history. One average needs 200. Before that, those rows stay grey.
  • Choppy markets. When the price moves sideways, the rows flip often. The reading can change with every candle.
  • Close to the line. A tiny change can push the reading across 55%. Then it flips between BULLISH and NEUTRAL, or BEARISH and NEUTRAL.
  • Old gaps still count. A gap counts even after the price has moved back through it. Jumps at the market's open count too.
  • The Liquidity row. It looks important, but it never changes the score.
  • Short labels. HH ▲ can also mean that only the dips got higher.

Charts are for learning, not advice. Read our Risk Disclaimer.

An example

  1. Open NASDAQ:AAPL in KAGAMI. Pick the 15-minute timeframe.
  2. Click Indicators and add Phoenix Next Candle Bias v1.0 - Table Only.
  3. The table appears in the top-right corner.

Now say the table shows these made-up states:

  • Structure: HH+HL ▲▲. Peaks and dips are both getting higher. That is full points up: 25 of 25.
  • Order Block: Outside OB. No points: 0 of 20.
  • FVG: Bull FVG ▲▲. Full points up: 15 of 15.
  • Momentum: Strong Bull ▲▲. Here, two of three steps up: about 13.3 of 20.
  • Candle: Bull ▲. One of three steps up: about 6.7 of 20.

Together that is 60 out of 100 points. Bull Prob is 50 + 60 ÷ 2 = 80%. Bear Prob is 20%. The top row reads BULLISH and MODERATE. When the next 15-minute candle closes, the table is worked out again.

Technical details

This part gives the exact rules, for readers who want them. KAGAMI's servers apply the original Pine script's rules; the chart only draws the table they send.

The calculation

On every closed candle, oldest first, the servers work out:

  1. Volatility. ATR = 0.6 × ATR(14) + 0.4 × ATR(50), both Wilder's average true range. It has no value for the first 49 candles.
  2. Timeframe scale. scale = √(max(minutes per candle, 1) ÷ 60), kept between 0.20 and 1.00. The swing threshold is ATR × 0.5 × scale.
  3. Swings. A swing high is a candle whose high is above each of the 5 highs before it and not below any of the 5 after it. A swing low mirrors this with lows. A swing is known 5 candles later. It is accepted only when it is at least the threshold away from the last accepted swing of the same kind. The first one is accepted as soon as ATR has a value. The last 30 of each kind are kept.
  4. Structure score. Compare the newest two accepted swing highs: higher is +1, lower is −1. Do the same with the swing lows. The score runs from −2 to +2.
  5. Order blocks. Look back over the 20 candles before this one, newest first. The first red candle (close below open) with close now − its close ≥ 1.5 × ATR becomes the bull block: its high and low. The first green candle with its close − close now ≥ 1.5 × ATR becomes the bear block. A block stays until a newer one is found. Score: +2 when the close is inside the bull block (edges included), else −2 when it is inside the bear block, else 0.
  6. Fair value gaps. Look back over candles 1 to 50 before this one, newest first. Compare each candle with the candle two before it. An up gap: its low is above that candle's high by at least 0.3 × ATR. A down gap: its high is below that candle's low by at least 0.3 × ATR. A gap's level is its middle. The first level found below the close is the bull level; the first found above it is the bear level. Whether the price later filled the gap is not checked. Then, with distances measured from the close: the bull level nearer and within 3 × ATR gives +2; the bear level nearer and within 3 × ATR gives −2; both equally near and within 3 × ATR gives +1; anything else gives 0.
  7. Liquidity grab. Take the highest high and the lowest low of the 30 candles before this one. A grab high: this candle's high reaches the highest high, and its close is below it. A grab low: its low reaches the lowest low, and its close is above it. This is shown only. It adds nothing to the score.
  8. Momentum. EMAs of the close over 8, 21, 50 and 200 candles, and the RSI over 14 candles (Wilder's). Points: +1 when EMA 8 > EMA 21 > EMA 50; −1 when EMA 8 < EMA 21 < EMA 50; +1 when the close is above EMA 200; −1 when it is below; +1 when the RSI is above 50 and below 70; −1 when it is below 50 and above 30; +1 when the RSI is 30 or less; −1 when it is 70 or more. The total is kept between −3 and +3.
  9. Candle score. The up side gives a bull engulfing +3, else a bull pin +2, else a bull marubozu +2, else a green candle +1. The down side gives a bear engulfing −3, else a bear pin −2, else a bear marubozu −2, else a red candle −1. The two sides are added. A doji sets the score to 0. The shapes are defined below.
  10. The bias. raw = (Structure ÷ 2 × 25 + Order Block ÷ 2 × 20 + FVG ÷ 2 × 15 + Momentum ÷ 3 × 20 + Candle ÷ 3 × 20) ÷ 100. Then Bull Prob = 50 + raw × 50, kept between 0 and 100, and Bear Prob = 100 − Bull Prob. The reading is BULLISH when Bull Prob is 55 or more, else BEARISH when Bear Prob is 55 or more, else NEUTRAL. The strength comes from the size of raw: 0.70 or more STRONG, 0.40 or more MODERATE, 0.15 or more WEAK, else NEUTRAL.
A column chart of the points of the five signal rows for the AAPL table: Structure +25, Order Block 0, FVG +15, Momentum +20 and Candle +6.7. Their sum, +66.7, gives Bull Prob 83%, shown in the table's top three rows.A column chart of the points of the five signal rows for the AAPL table: Structure +25, Order Block 0, FVG +15, Momentum +20 and Candle +6.7. Their sum, +66.7, gives Bull Prob 83%, shown in the table's top three rows.
Step 10 for the AAPL table shown under What you see on the chart (the 11:00 candle). Each column is one row's points: its score ÷ its largest score × its weight. The grey frame is the most a row can add or take away. The points add up to 66.7 of 100, so raw = 0.667. Bull Prob is 50 + 66.7 ÷ 2 = 83%. The strength is MODERATE, as raw is between 0.40 and 0.70.

BULLISH starts at a raw of 0.10, but WEAK starts at 0.15. So the top row can read BULLISH with the strength NEUTRAL. The same holds for BEARISH.

The candle shapes in step 9, with body = abs(close − open), range = high − low, upper wick = high − max(open, close) and lower wick = min(open, close) − low:

  • Bull engulfing: a green candle after a red one, closing above the previous open and opening below the previous close, with a body more than 0.8 × the previous body. A bear engulfing mirrors it.
  • Bull pin: lower wick ≥ 2 × body, lower wick ≥ 55 % of the range, and upper wick ≤ 0.5 × body. A bear pin mirrors it. A pin can have either colour.
  • Bull marubozu: a green candle with body ≥ 75 % of the range and each wick ≤ 10 % of the body. A bear marubozu mirrors it.
  • Doji: body ≤ 12 % of the range, and range ≥ 0.3 × ATR.

The table

The table has 3 columns and 12 rows. The left column is left-aligned; the others are centred.

RowLeft cellMiddle cellRight cell
1PHX BIASBULLISH, BEARISH or NEUTRALSTRONG, MODERATE, WEAK or NEUTRAL
2▲ Bull ProbBull Prob, rounded, with %empty
3▼ Bear ProbBear Prob, rounded, with %empty
4─ Signals ─StateWt
5StructureHH+HL ▲▲ (+2), HH ▲ (+1), Mixed (0), LH ▼ (−1), LH+LL ▼▼ (−2)25%
6Order BlockIn Bull OB ▲ (+2), In Bear OB ▼ (−2), Outside OB (0)20%
7FVGBull FVG ▲▲ (+2), Bull FVG ▲ (+1), No FVG (0), Bear FVG ▼ (−1), Bear FVG ▼▼ (−2)15%
8MomentumStrong Bull ▲▲ (+2 or +3), Mild Bull ▲ (+1), Neutral (0), Mild Bear ▼ (−1), Strong Bear ▼▼ (−2 or −3)20%
9CandleThe first that applies: Bull Engulf ▲▲, Bull Pin ▲▲, Bull Marubozu ▲▲, Bear Engulf ▼▼, Bear Pin ▼▼, Bear Marubozu ▼▼, Doji ◆, Bull ▲ (a green candle), Bear ▼ (any other)20%
10LiquidityLiq Grab Low ▲, Liq Grab High ▼, or —Bonus
11RSI(14)Overbought ⚠ (70 or more), Oversold ⚠ (30 or less), Bullish Zone (above 50), Bearish Zone (any other)The RSI, rounded
12Statistical bias only — not a predictionemptyempty

The colours:

  • Rows 1 to 3: PHX BIAS in gold #FFD700. The reading and the strength in green #26A69A (BULLISH), red #EF5350 (BEARISH) or blue-grey #90A4AE (NEUTRAL). ▲ Bull Prob and its value in green #26A69A; ▼ Bear Prob and its value in red #EF5350.
  • Rows 5 to 9: the middle cell follows the row's score: green #26A69A above 0, red #EF5350 below 0, grey #546E7A at 0. The names and weights are grey #546E7A.
  • Row 10: the middle cell is green #26A69A for a grab low, red #EF5350 for a grab high and grey #546E7A for —. Liquidity and Bonus are grey #546E7A.
  • Row 11: the zone and the value are red #EF5350 for Overbought and Bearish Zone, green #26A69A for Oversold and Bullish Zone. RSI(14) is grey #546E7A.
  • Rows 4 and 12: grey #546E7A text.
  • Backgrounds: rows 1, 4 and 12 are dark #161B22. The others are near-black #0D1117 at 5 % transparency.
  • Lines: cell borders gold #FFD700 at 70 % transparency, 1 px. The outer frame is gold at 40 % transparency, 1 px.
  • Size and place: text of about 16 px (the original's Large). The table sits 6 px inside the top-right corner of the price pane, left of the price scale. It is the only thing this indicator draws.

What the labels hide:

  • Structure shows HH ▲ for any +1, even when it comes from a higher swing low alone. It shows LH ▼ for any −1, even from a lower swing low alone. A higher high with a lower low adds up to 0 and shows Mixed.
  • FVG: by the rules above, −1 cannot happen, so Bear FVG ▼ never shows. Bull FVG ▲ needs two gaps exactly equally near.
  • Candle: a doji that also matches a pattern shows the pattern's name, but scores 0 and shows in grey.
  • RSI: at exactly 50, the row shows Bearish Zone in red but adds no momentum point.

Inputs

KAGAMI shows no inputs for this indicator. It always uses the original script's defaults, and none of them can be changed:

Input in the original scriptValue KAGAMI usesRange in the original
Pivot Left52 to 15
Pivot Right52 to 15
Min Swing ATR×0.50.1 to 3.0
OB Lookback205 to 100
Min FVG (ATR×)0.30.1 to 2.0
Liquidity Lookback3010 to 100
Market Structure (weight)250 to 50
Order Block (weight)200 to 50
FVG Imbalance (weight)150 to 50
Momentum (EMA+RSI) (weight)200 to 50
Candlestick Pattern (weight)200 to 50
Show Signal Tableonon or off
Color Candlesoffon or off; never drawn in KAGAMI
Neutral Zone %5550 to 75
Table PositionTop Rightthe four corners
Table Text SizeLargeTiny, Small, Normal, Large, Huge

These are fixed in the original script too: the ATR blend (14 and 50, at 0.6 and 0.4), the 1.5 × ATR move for order blocks, the 50-candle gap scan and its 3 × ATR reach, EMA 8, 21, 50 and 200, the RSI over 14 with its 30, 50 and 70 lines, the 30 swings kept per kind, the candle-shape ratios and the strength steps 0.70, 0.40 and 0.15.

When values change

  • Closed candles only. The table always shows the last closed candle. The forming candle is never used.
  • Refresh: the page asks for the table again when a new candle closes, and every 60 seconds. Between closes, it stays the same.
  • No history on the chart. Only today's table is shown. Nothing is drawn for past candles, so nothing old can repaint.
  • Memory: order blocks, swings and averages are worked out again from the loaded candles each time. As old candles drop out of the loaded history, values can shift slightly.
  • Daily candles: a daily candle counts as closed 24 hours after it opens. For a US stock, that is midnight New York time, not the 16:00 close. Weekly candles count as closed 7 days after they open, monthly candles 30 days after.

Timeframes

  • Every timeframe works, from seconds (crypto only) to monthly.
  • The scale shrinks the swing threshold below 1 hour: 1 minute and every seconds chart 0.20, 3 minutes about 0.22, 5 minutes about 0.29, 15 minutes 0.50, 30 minutes about 0.71, 45 minutes about 0.87, 1 hour and above 1.00.
  • Seconds charts: the servers read at most 2,000 candles, about 33 minutes at 1 second. That is enough for every row, including the 200-candle average.
  • US stocks: KAGAMI's stock data can include pre-market and after-hours candles. The table counts them like any other candle.

Differences from the original Pine script

KAGAMI draws the same table, with the same cells and colours, as the original script with its default inputs. These are the differences:

  • The last closed candle. On TradingView, the table reads the live, still-forming candle and changes tick by tick. KAGAMI reads the last closed candle and changes when a candle closes.
  • No settings. Every input stays at its default, so the table is always top right with large text.
  • No candle colouring. Color Candles is off by default in the original. KAGAMI never draws it.
  • No hidden plot. The original keeps a hidden Bull Probability % plot for its alert messages. KAGAMI does not draw it.
  • No alerts. The original offers alerts when the reading turns bullish, bearish or neutral. KAGAMI raises no alerts.
  • Shorter history. KAGAMI loads at most 2,000 candles. Values that depend on long history, like the 200-candle average, the swings and the order blocks, can differ slightly from TradingView's.
  • At least 3 closed candles. KAGAMI shows no table before that. TradingView shows one from the first candle.
  • The look. The text size is close to TradingView's Large, in KAGAMI's own font, with its own cell spacing. The table's place is worked out from the chart's frame, with fixed margins as a fallback.
  • Daily stock candles. In KAGAMI, a daily stock candle counts as closed at midnight New York time, so the table shows the day before until then.

Edge cases

  • Fewer than 3 closed candles: no table.
  • The first 49 candles: ATR has no value. No swings are accepted and no order blocks, gaps or dojis are found. Structure shows Mixed, Order Block Outside OB and FVG No FVG.
  • The first 14 candles: the RSI has no value. The RSI row shows Bearish Zone in red with NaN, and the RSI adds no momentum points.
  • The first 49 and 199 candles: EMA 50 and EMA 200 have no value yet. The EMA stack and the EMA 200 test add nothing.
  • The first 30 candles: no liquidity grab can be found. The row shows —.
  • A candle that doesn't move: when open, high, low and close are all equal, it matches both pin rules. It shows Bull Pin ▲▲ in grey and scores 0.
  • Open equals close: a candle that is not a doji and has no pattern shows Bear ▼, in grey, with a score of 0.
  • Jumps between sessions: a price jump at the market's open can count as a fair value gap, like any other.
  • Hidden or removed: hiding the indicator hides the table. Removing it removes the table.