All available Free Pro versions are listed below (They are very similar and I don't want to publish them as separate indicators):
ver 1.0: style columns implementation
ver 2.0: style histogram implementation
ver 3.0: style line implementation
This indicator calculates for a given range and shows it as a histogram consisting of 25 horizontal bars.
It can also show Point of Control ( ), Developing , Value Area/ StdDev High/Low as dynamically moving levels.
Free accounts can't access Standard TradingView , hence this indicator.
There are 3 basic methods to calculate the Value Area for a session.
- original method developed by Steidlmayr (calculated around )
- classical method using StdDev (calculated around the mean )
- another method based on the mean absolute deviation (calculated around the median)
is a high node and can be used as . But when far from the day's average price it may not be as good a trend filter as the other methods.
The 80% Rule: When the market opens above/below the Value Area and then returns/stays back inside for 2 consecutive 30min periods it has 80% chance of filling VA (like a gap).
There are several versions: Free, Free Pro, Free MAX. This is the Free Pro version. The Differences are listed below:
- Free: 30 levels, Buy/Sell/Total views,
- Free Pro: 25 levels, +Developing , Value Area/ High/Low Levels, Above/Below Area Dimming
- Free MAX: 50 levels, packed to the limit
- with up to 25 levels (3 implementations)
- , Developing Levels
- Buy/Sell/Total/Side by Side View modes
- Side Cover
- Value Area, VAH / VAL dynamic levels
- High/Low dynamic levels with Source, Length, StdDev as params
- Show/Hide all levels
- Dim Non Value Area Zones
- Custom Range with Highlighting
- 3 Anchor points for
- Flip Levels Horizontally
- Adjustable width, offset and spacing of levels
- Custom Color for /VA/ levels and Transparency for buy/sell levels
- specify max_level/min_level for a range (required in ver 1.0/2.0, auto/optional in ver 3.0 = set to highest/lowest)
- select range (start_bar, range length), confirm with range highlighting
- select mode Value Area or to show corresponding levels.
- flip/select anchor point to position the buy/sell levels, adjust width and spacing as needed
- select Buy/Sell/Total/Side by Side view mode
- use /Developing /VA/ High/Low as S/R levels. Usually daily values from 1-3 days back are used as levels for the current day.
- Green - buy of a specific price level in a range, Red - sell . Green + Red = Total of a price level in a range
There's no native support for vertical histograms in Pinescript (with price axis as base)
Basically, there are 4 ways to plot a series of horizontal bars stacked on top of each other:
1. plotshape style labeldown (ver 0 prototype discarded)
- you can have a set of fixed width/height text labels consisting of a series of underscores and moving dynamically as levels. Level offset controls visible length.
- you can move levels and scale the base width of the histogram dynamically
- you can calculate the highest/lowest range values automatically. max_level/min_level inputs are optional
- you can't fill the gaps between levels/adjust/extend width, height - this results in a half baked and looks ugly
- fixed text level height doesn't adjust and looks bad on a log scale
- fixed font width also doesn't scale and can't be properly aligned with bars when zooming
2. plot style columns + hist_base (ver 1.0)
- you can plot long horizontal bars using a series of small adjacent vertical columns with level offsets controlling visible length.
- you can't hide/move levels of the histogram dynamically on each bar, they must be plotted at all times regardless - you can't delete the history of a plot.
- you can't scale the base width of the histogram dynamically, can't set show_last from input, must use a preset fixed width for each level
- hist_base can only be a static const expression, can't be assigned highest/lowest range values automatically - you have to specify max_level/min_level manually from input
- you can't control spacing between columns - there's an equalizer bar effect when you zoom in, and solid bars when you zoom out
- using hist_base for levels results in ugly load/redraw times - give it 3-5 sec to finalize its shape after each UI param change
- level top can be properly aligned with another level's bottom producing a clean good looking histogram
- columns are properly aligned with bars automatically
3. plot style histogram + hist_base (ver 2.0)
- you can plot long horizontal bars using a series of small vertical bars (horizontal histogram) instead of columns.
- you can control the width of each histogram bar comprising a level (spacing/horiz density). Large enough width will cause bar overlapping and give level a "solid" look regardless of zoom
- you can only set width <= 4 in UI Style - custom textbox input is provided for larger values. You can set width and plot transparency from input
- this method still uses hist_base and inherits other limitations of ver 2.0
4. plot style lines (ver 3.0)
- you can also plot long horizontal bars using lines with level offsets controlling visible length.
- lines don't need hist_base - fast and smooth redraw times
- you can calculate the highest/lowest range values automatically. max_level/min_level inputs are optional
- level top can't be properly aligned with another level's bottom and have a proper spacing because line width uses its own units and doesn't scale
- fixed line width of a level (vertical thickness) doesn't scale and looks bad on log (level overlapping)
- you can only set width <= 4 in UI Style, a custom textbox input is provided for larger values. You can set width and plot transparency from input
- hist_base for levels results in ugly load/redraw times - give it 3-5 sec to finalize its shape after each UI param change
- indicator is slow on TFs with long history 10000+ bars
- /Value Area are calculated for a given range and updated on each bar. Each level has a fixed width. Offsets control visible level parts. Side Cover hides the invisible parts.
- Custom Color for /VA/ levels - UI Style color/transparency can only change shape's color and doesn't affect textcolor, hence this additional option
- Custom Widh for levels - UI Style supports only width <= 4, hence this additional option
- is visible in both modes. In mode Developing becomes , VA High and Low => High and Low correspondingly to minimize the number of plot outputs
- You can't change buy/sell level colors (only plot transparency) - this requires 2x plot outputs exceeding max 64 limit. That's why 2 additional plots are used to dim the non Value Area zones
- Use Side by Side view to compare buy and sell volumes between each other: base width = max(total_buy_vol, total_sell_vol)
- All buy/sell lengths are calculated as % of a fixed base width = 100 bars (100%). You can't set show_last from input
- Sell Offset is calculated relative to Buy Offset to stack/extend sell on top of buy. Buy Offset = Zero - Buy Length. Sell Offset = Buy Offset - Sell Length = Zero - Buy Length - Sell Length
- If you see "loop too long error" - change some values in UI and it will recalculate - no need to refresh the chart
- There's no such thing as buy/sell , there's just , but for the purposes of the method, assume: bull candle = buy , bear candle = sell
- Range is limited to 5000 bars for free accounts
P.S. Cantaloupia Will be Free!
Links on and Value Area calculation and usage:
- style histogram implementation
- level width/density control and zero/cover offset micro adjustments for more solid looking levels
- empty range is now handled properly. VWAP, zero and cover are shown regardless of the range.
- source option for Volume Profile calculation
- swapped level_top with level in plot - seems more logical, doesn't affect redraw time
- density is the width of a single histogram bar forming a level. typically level/cover density should both be assigned the same value
- 12 is the optimal density for a solid looking levels on both large/small zoom scales, higher values require micro adjustment of zero/cover offset when zoomed out depending on scale
- level transparency is counter-acted by density. Higher density = less transparent levels given the same transparency
- you can now specify source for Volume Profile calculation i.e. use high/low instead of close if needed
ver 1.0: ver 2.0 ver 3.0
- style columns - style histogram - style line
- manual min/max level - manual min/max level - manual min/max level
- fixed 100% base width - fixed 100% base width - fixed 100% base width
- hist_base (ugly redraw) - hist_base (ugly redraw) - no hist_base (cleaner redraw)
- no level density (equalizer) - level density control (more solid) - line width control (outline from level center)
- level gaps auto fill - level gaps auto fill - manual level height adjustments for normal/log
- manual spacing - manual spacing - no spacing control, only width + compensation
- better transparency - less transparency (density is in the way) - better transparency
Changes in ver 3.0:
- style line implementation (no hist_base => cleaner redraw)
- width now controls the actual level/line width, while density only affects cover
- compensate level width and multiplier for log scale option
- level shift % of step h option to compensate for large level width
- extended cover option to compensate for large level width
- this is a more straightforward version with cleaner redraw, it doesn't use hist_base for levels, just lines
- downside: you can't fill the gaps between levels automatically, spacing doesn't work, width has its own units, you have to adjust it manually for each zoom/scale or leave huge gaps in between.
- you can have one level width for normal scale and another with a multiplier for a log scale
- you can shift levels vertically (middle of a step is default) and adjust zero/cover offsets to compensate for width outline
- level transparency now works again as expected since there's no density in the way
- assigning highest/lowest range values produces curves instead of straight lines as range changes dynamically - you still have to set max_level/min_level manually from input
please adjust Max Level, Min Level and Vertical Spacing to 8, 2 and 0 respectively.
All newcomers, please read the description before use.
What settings should I use for forex? Eg EURUSD chart.
I quote the Notes in the description above: If you see "loop too long error" - change some values in UI and it will recalculate - no need to refresh the chart.
Pinescript has a time limit of 200ms per bar for any script and 20000ms for the whole history.
When a script exceeds these limits you will see the loop/execution too long system error.
There's no way of handling system errors in script internally as there's no such thing as event handlers.
That's why you will see this error occasionally in many complex scripts usually having for loops.
Also there's no viable way of measuring the performance of a script except by stripping it down to basic components and completely rewriting it several times
(very time consuming) until you have a version that stays within the limits with some common settings most of the time and can compile.
But some combination of settings may still cause a run-time error:
- always (Pinescript's limits are exceeded such as max 5000/10000 bars of history for free/paid accounts or some other value is too large) or
- occasionally (site's engine normally handles this combination of settings but randomly freezes and can't complete the loop calculation for some reason).
- change some values to figure out which of them cause the error (try reducing range length etc), refresh the chart and avoid these values in the future
- remove and then reattach the indicator and try other settings.
- try MAX 50 and Ultra 100 versions
Coding is messy and most code comments are just useless. Sorry for having to be too direct but you will thank me later probably in 5 - 10 years time. For the time being google on how to work around arrays in Pinescript. No it does not slow things down if you know do it properly.