1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
35 lines of Pine Script v4 from beta/arrays/test-003-push_array.pinescript, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
My Script defines helper functions to insert values into a fixed-size array. On each bar it calculates the 10-bar highest high and lowest low, then checks for the formation of a new high or low using change. When detected it pushes the current high and low values into the array after shifting out the oldest element. The array starts filled with the close price and holds up to 6 elements. It plots the average of the array values, the maximum array value, the minimum array value and the current close price on the chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
length
int
6
length
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.
This Pine Script indicator calculates Z-Score based bands for grid trading using a user-selectable moving average. It computes the MA from chosen type, length and source then derives upper and lower bands offset by stddevs. Grid ranges are set by min and max w
The indicator computes bias and mbias curves from typical price relative to highest and lowest closes across periods 3, 6, 9, 12, and 20. It sums the positive and negative biases then negates and plots them as b (red) and s (green) lines in a separate pane to
This indicator plots auto trade signals for E-mini S&P 500 futures on the price chart. It computes an EMA200 filter along with day ETH RTH session levels and percentage-based entry zones. Signals trigger CALL or PUT cases when price crosses defined thresholds
This Pine Script indicator overlays institutional liquidity levels on the price chart. It identifies order block levels using pivot highs and lows, then draws mean reversion lines from the 20 and 50 period simple moving averages, a volatility range midpoint pr
This indicator plots an anchored MIDAS support and resistance curve from launch-anchored volume-weighted price on the price chart. It adds two configurable volume-weighted standard-deviation, ATR, or hybrid bands and a topfinder or bottomfinder accelerated exh
VWAP Trader NXi calculates a daily session-anchored Volume Weighted Average Price along with two custom standard deviation bands on the main price chart. It plots the core VWAP, Value Area bands, outer extension zones with background shading, and the previous