Builtins: FVG gaps and the Stop Run, Iceberg and Delta Spike markers

Four more chart indicators are read by what they draw. FVG draws gaps, which a script reads exactly like zones. Stop Run, Iceberg and Delta Spike draw markers, which a script reads one marker at a time. Each needs its indicator visible on the chart and uses that indicator's own settings.

FVG

SignatureReturns
fvg.available() -> boolWhether a visible FVG indicator is on this chart
fvg.count() -> intHow many of its gaps cover this bar
fvg.started() -> intHow many of those gaps begin on this bar
fvg.high(index: int) -> floatTop of a gap covering this bar
fvg.low(index: int) -> floatBottom of that gap
fvg.side(index: int) -> sideBUY for a bullish gap, SELL for a bearish gap
fvg.start(index: int) -> floatStart of the gap's first bar, epoch milliseconds
fvg.at(price: float) -> intIndex of the newest gap whose band holds the price, edges included, or -1
fvg.above(price: float) -> intIndex of the gap entirely above the price with the lowest bottom, or -1
fvg.below(price: float) -> intIndex of the gap entirely below the price with the highest top, or -1
  • A gap covers the bars from the bar that completed it through the bar its box ends on. Indexes run oldest gap first, and -1 is none, exactly as for the zones above.
  • side is the gap's own direction, whatever colour the chart paints it.
  • Without the indicator visible the settings say FVG Required.

Stop Run, Iceberg and Delta Spike

SignatureReturns
stop_run.available() -> boolWhether a visible Stop Run indicator is on this chart
stop_run.count() -> intHow many of its markers sit on this bar
stop_run.price(index: int) -> floatThe market price the marker stands for
stop_run.side(index: int) -> sideBUY for a buy side marker, SELL for a sell side marker
iceberg.available() -> boolWhether a visible Iceberg indicator is on this chart
iceberg.count() -> intHow many of its markers sit on this bar
iceberg.price(index: int) -> floatThe market price the marker stands for
iceberg.side(index: int) -> sideBUY for a buy side marker, SELL for a sell side marker
delta_spike.available() -> boolWhether a visible Delta Spike indicator is on this chart
delta_spike.count() -> intHow many of its markers sit on this bar
delta_spike.price(index: int) -> floatThe market price the marker stands for
delta_spike.side(index: int) -> sideBUY for a buy side marker, SELL for a sell side marker
  • Each marker sits on its own bar only. A bar's markers are indexed from its lowest price up, and -1 or an index past the last marker answers nan or UNDEFINED.
  • price is the market price the marker stands for, the same at every zoom, even though the chart draws the marker glyph slightly offset from it.
  • side is BUY for the indicator's buy side marker and SELL for its sell side marker, the same split the indicator shows with its two colours.
  • iceberg.* reads the Iceberg indicator. For individual resting orders, including Iceberg MBO's, use mbo.*.
  • Delta Spike may be on the chart more than once; a script reads the first visible one.
  • Without the indicator visible the settings say Stop Run Required, Iceberg Required or Delta Spike Required.
let gap: int = fvg.at(close)
let run_price: float = stop_run.price(0)
let run_in_gap: bool = stop_run.count() > 0 && fvg.at(run_price) >= 0
plot.marker(run_in_gap && stop_run.side(0) == "BUY", run_price, "#22C55E", "circle", "below", 10, 2)
plot.marker(run_in_gap && stop_run.side(0) == "SELL", run_price, "#EF4444", "circle", "above", 10, 2)
plot.candle_color(gap >= 0 && fvg.side(gap) == "BUY", "#22C55E", 0.35)

Všechny vrstvy trhu – od Orderflow po optionflow – v jednom grafu.

Orderflow data institucionální kvality s vestavěným backtestingem a obchodním deníkem. Zapište se na čekací listinu a získejte předběžný přístup.

Získat přístup