OPEN-SOURCE SCRIPT

Intrabar BoxPlot

The Intrabar BoxPlot publication highlights an uncommon technique by displaying statistical intrabar Lower Timeframe (LTF) values on the chart.

🔶 USAGE

imagen

🔹 Middle 50% Boxes

By showing the middle 50% intrabar values through a box, we can more easily see where the intrabar activity is mainly situated.

The middle 50% intrabar values are referred to from here on as Interquartile range (IQR).

In this example, the successive IQRs form a channel where the price eventually breaks out.

imagen

Disproportionately distributed values can give insights which can be used to find potential support/resistance areas.

imagen

IQR gaps can give valuable information as well. Potentially, the price can return to these gaps.

imagen

Seeing the IQR areas against regular candles gives an alternative image of the underlying price movements.

imagen

🔹 Highest volume Price level

The script displays the price level with the highest volume situated, dependable on the user's source setting. Setting the source at 'close' will only display intrabar close values; the same goes for high, low, ...

As seen in the above example, the volume levels can aid in finding support/resistance.

🔹 Median

The location of the median off all intrabar values is displayed as a coloured dot: green when the close price is higher than the opening price and red if otherwise. The median can give valuable insights into price movements.

imagen

🔹 Outliers

Medium (white dots) and extreme (white X) outliers, in combination with the IQR box, can help identify potential areas of interest.

imagen

🔹 Volume Delta

imagen

When there is a discrepancy between the delta volume and direction of the candle, this will be displayed as follows:
  • Green candle: when the sum of the volume of red intrabars is higher than the sum of the volume of green intrabars, the candle will be coloured orange.
  • Red candle: when the sum of the volume of green intrabars is higher than the sum of the volume of red intrabars, the candle will be coloured blue.


🔹 Highlight Boxplot only

Probably the easiest way to display boxplot only is by changing the Bar's style to Bars.

imagen

🔶 DETAILS

All intrabar values (Lower TimeFrame - LTF) are sorted and evaluated. Values can be close, high, low, ... by selecting this in Settings (source).

The middle 50% of all values are displayed as a box; this contains the values between percentile 25 (p25) and percentile 75 (p75). The value of percentile rank 75 means 75% of all values are lower. The value of percentile rank 25 means 25% of all values are lower, or 75% is higher.

imagen

The difference between p75 and p25 is also known as Interquartile range (IQR)

IQR is used to check for outliers.

imagen

Wiki: Boxplot, Interquartile range

  • Extreme high: maximum value, higher than p75 + IQR*3
  • Max outlier high: maximum value, higher than p75 + IQR*1.5 but lower than p75 + IQR*3
  • Max: maximum value, lower than p75 + IQR*1.5
  • Min: minimum value, higher than p25 - IQR*1.5
  • Min outlier low: minimum value, lower than p25 - IQR*1.5 but higher than p25 - IQR*3
  • Extreme low: minimum value, lower than p25 - IQR*3


imagen

Max and min must not be interpreted with the current candle high/low.

🔹 Example: Length of chart-puppets

The following example can make it easier to digest. Forty "chart-puppets" are sorted by their length.

imagen

  • The p25 value is 97
  • The p50 value is 120
  • The p75 value is 149


  • 75% of all "chart-puppets" are smaller than p75, and 25% is larger than p75.
  • 50% of all "chart-puppets" are smaller than p50, and 50% is larger than p50 (= median).
  • 25% of all "chart-puppets" are smaller than p25, and 75% is larger than p25.


IQR = 149 - 97 = 52

Extreme outlier limit max: p75 + IQR*3 = 149 + 52*3 = 305
Mild outlier limit max: p75 + IQR*1.5 = 149 + 52*1.5 = 227
Mild outlier limit min: p25 - IQR*1.5 = 97 - 52*1.5 = 19
Extreme outlier limit min: p25 - IQR*3 = 97 - 52*3 = -59

In this example there are no outliers to be found, all values are located between p25 - IQR*1.5 (19) and p75 + IQR*1.5. (227)

🔹 Source settings

Note that results are dependable on the chosen source (settings). When, for example, close is chosen as the source, only intrabar close prices are included. This means a low or high can stretch further then the min or max.

imagen

Here we can see different results with different source settings

imagen

🔹 LTF settings

When 'Auto' is enabled (Settings, LTF), the LTF will be the nearest possible x times smaller TF than the current TF. When 'Premium' is disabled, the minimum TF will always be 1 minute to ensure TradingView plans lower than Premium don't get an error.

Examples with current Daily TF (when Premium is enabled):
  • 500 : 3 minute LTF
  • 1500 (default): 1 minute LTF
  • 5000: 30 seconds LTF (1 minute if Premium is disabled)


🔶 SETTINGS

  • Source: Set source at close, high, low,...


🔹 LTF
  • LTF: LTF setting
  • Auto + multiple: Adjusts the initial set LTF
  • Premium: Enable when your TradingView plan is Premium or higher


🔹 Intrabar Delta: Colors, dependable on different circumstances.
  • Up: Price goes up, with more bullish than bearish intrabar volume.
  • Up-: Price goes up, with more bearish than bullish intrabar volume.
  • Down: Price goes down, with more bearish than bullish intrabar volume.
  • Down+: Price goes down, with more bullish than bearish intrabar volume.


🔹 Table
  • Show table: Show details at the top right corner
  • Show TF: Show LTF at the bottom right corner
  • Text color/table size


See DETAILS for more information
boxplotCandlestick analysisdeltaintrabariqrmultitimeframestatistics

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?


PineCoder: pinecoders.com

- We cannot control our emotions,
but we can control our keyboard -

Exención de responsabilidad