//@version=4
study("Price vs Past", "", true)
var int MAX_LOOKBACK = 300
int i_lookBack = input(150, minval = 1, maxval = MAX_LOOKBACK, step = 10)
color i_c_Bull = input(#00FF00ff, "Bull", inline = "11")
color i_c_Bear = input(#FF0080ff, "Bear", inline = "11")
// ————— Function returning `_color` with `_transp` transparency.
f_colorNew(_color, _transp) =>
// color _color : base color to derive a new transparency from. Its current transparency is ignored.
// float _transp: 0-100 transparency of `_color` to return.
_r = color.r(_color)
_g = color.g(_color)
_b = color.b(_color)
color _return = color.rgb(_r, _g, _b, _transp)
// ————— Function draws a heatmap showing the position of the current `_src` relative to its past `_lookBack` values.
f_drawHeatmap(_src, _lookBack) =>
// float _src : evaluated price series.
// int _lookBack: number of past bars evaluated.
// Dependency: MAX_LOOKBACK
// Force historical buffer to a sufficient size.
max_bars_back(_src, MAX_LOOKBACK)
// Only run table code on last bar.
if barstate.islast
var _heatmap = table.new(position.bottom_center, _lookBack, 1)
for _i = 1 to i_lookBack
float _transp = 100. * _i / _lookBack
if _src > _src[_i]
table.cell(_heatmap, _lookBack - _i, 0, bgcolor = f_colorNew(i_c_Bull, _transp))
else
table.cell(_heatmap, _lookBack - _i, 0, bgcolor = f_colorNew(i_c_Bear, _transp))
f_drawHeatmap(high, i_lookBack)
Overview
On the last bar it compares the current high with each of the previous lookback highs. A cell is bull-colored when the current high is above that past high and bear-colored otherwise. Transparency increases with the age of the compared bar. The lookback length and the two colors are the main settings. It does not generate trade signals or exits.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
i_lookBack
int
150
i_lookBack
Bull
color
#00FF00ff
i_c_Bull
Bear
color
#FF0080ff
i_c_Bear
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
Symbol Info Helper is an informational utility script that displays metadata about the currently selected instrument directly on the main price chart. It gathers built-in symbol properties including ticker identifier, description, instrument type, point value,
The indicator plots ICT displacement candles on the price chart and can switch to retracement scanning. Displacement requires a move larger than a set share of the 14-bar average high-low range, lasting at least a chosen number of bars, with optional close, pr
This indicator classifies each bar as bull, bear, or sideways from a rolling log return compared with adjustable percentage thresholds. It paints a regime ribbon on the price chart, shows a current-regime banner, and labels state changes after a minimum hold.
This indicator monitors multiple cryptocurrency symbols for trading signals. It calculates and plots entry prices, take profit, and stop loss levels for each symbol including BTCUSDT, ETHUSDT, BNBUSDT and others. Price crossovers trigger buy, sell or close ale
This indicator calculates theoretical options contract values and in-the-money probabilities using historical realized volatility across multiple standard deviations. It displays these metrics in a table overlay directly on the price chart. Users can adjust th
3938 Tracker visualizes historical buying and selling activity from ARK Invest funds directly on the main price chart. It plots labels at specific timestamps corresponding to trade dates, indicating buy or sell actions along with the count of participating ETF