Library

Library

Library

Library

ScaleScale Library v1 - The Ultimate UI Framework for Pine Script™
Construct. Visualize. Deploy.
📢 ABOUT
Scale is a comprehensive, open-source UI framework meticulously designed to simplify the creation of advanced visual scales, interactive progress bars, and complex dashboards in Pine Script™. It abstracts away the cumbersome and error-prone complexity of manual drawing (such as managing lines, labels, boxes, and calculations) into a clean, chainable, and highly intuitive method suite.
Whether you're building a simple RSI indicator, a dynamic MACD histogram, or a complex multi-metric trading dashboard, Scale handles the heavy lifting of:
• Auto-scaling : Intelligently calculates positions relative to bars or time, ensuring your UI elements are perfectly aligned regardless of chart zoom or resolution.
• Real-time updates : Flawlessly handles intra-bar price changes, providing smooth and accurate visualizations on every tick without flickering.
• Theming : Offers robust support for aesthetic customization, including smooth gradients, auto-coloring based on conditions, and custom branding.
• Responsive layout : Features granular padding, offset, and alignment controls so your visual components flexibly adapt to any chart environment.
✨ WHAT'S NEW IN v1
📛 Method Badges
Quickly identify method capabilities and execution context with visual badges:
• 🔵 method-primary — The core function required to initialize a specific feature or element.
• 🟣 chainable — Indicates the method returns the setup object itself, allowing for elegant, single-line method chaining (e.g., `scale.build().addMarker().show()`).
• 🟡 realtime — Specialized methods that update fluidly on every tick (realtime data), ideal for timers and loaders.
• 🔷 since-v6 — Leverages the latest Pine Script™ v6 features for maximum performance.
📊 Icon Reference Tables
No more guessing icon indices! Comprehensive tables are integrated directly into this documentation, showing every available icon for Markers, Rulers, Trends, and more.
🎯 Inline Examples
Every core module is accompanied by copy-paste ready examples, getting you from an empty script to a functioning UI in seconds.
🚀 QUICK START
1. Import the library
Bring the Scale framework into your script:
import cryptolinx/Scale/1 as s
2. Create a Theme (optional but recommended)
Define your aesthetic preferences early on:
// Example theme for a classic blue look
var theme = s.theme.new(
color_bar_filled = color.blue,
color_bar_unfilled = color.new(color.blue, 80)
)
3. Build and Deploy
Create your scale, feed it data, and add components:
// Simple RSI Scale with a marker and a background ruler
var myScale = s.setup.new()
myScale.build(theme, bar_index, high + 10, ta.rsi(close, 14), 14, 0, 100)
.addMarker(_icon = 0) // Pinpoints current value
.addRuler() // Adds a structural background
🔧 CORE METHODS
build() 🔵 primary 🟣 chainable
The foundational engine that initializes your scale's model, view, and controller. It explicitly defines *what* data is visualized, *where* it is anchored on the chart, and the dimensional constraints.
scale.build(__theme, _xOffset, _y, _src, _length, _minValue, _maxValue, ...)
• `__theme` (theme) — Required : Theme object encapsulating your colors/styling.
• `_xOffset` (int) — Required : Horizontal offset relative to `bar_index` (can be historical or future bars).
• `_y` (float) — Required : Vertical y-coordinate anchor (price/value level).
• `_src` (float) — Required : The incoming source value to visualize (e.g., RSI, Stochastic, custom oscillator).
• `_length` (int) — Required : Mathematical lookback length for internal calculations and dynamic ranges.
• `_minValue` (float) — Required : Minimum baseline value of the scale (representing 0%).
• `_maxValue` (float) — Required : Maximum ceiling value of the scale (representing 100%).
• `_numBars` (int) — Default: 10: Total number of discrete segments or 'ticks' comprising the bar.
• `_barWidth` (int) — Default: 2: Visual width of each individual segment in chart bars.
• `_barHeight` (int) — Default: 5: Visual vertical thickness of the bar in pixels.
• `_prefill` (bool) — Default: true: Determines fill behavior (Left-to-Right progression vs Center-out Range).
• `_dynamic` (bool) — Default: false: If explicitly set to true, minimum and maximum values will auto-adapt to the source data's historical extremes.
show() / hide() 🟣 chainable
Conditionally control visibility. Highly effective for decluttering the chart based on specific market conditions, timeframes, or user toggles.
// Only display the scale on the very last active bar
scale.show(barstate.islast)
// Automatically hide the scale during bearish price action
scale.hide(close < open)
🎨 ELEMENT METHODS
Modular add-ons that enhance the visual clarity and depth of your scale.
addLabel() 🔵 primary 🟣 chainable
Attaches a clean, customizable text label at specific anchor points relative to the scale geometry.
scale.addLabel(position.top_center, _text="RSI", _textColor=color.white)
addMarker() 🔵 primary 🟣 chainable
Places a precise symbol or shape exactly at the current value's interpolated position along the scale.
scale.addMarker(_icon=0, _color=color.yellow, _location=location.bottom)
📊 Marker Icon Table (_icon)
• 0 : ▼ : ▲ | 5 : ↧ : ↥ | 10 : ⁝
• 1 : ▽ : △ | 6 : ⇟ : ⇞ | 11 : ⋎ : ⋏
• 2 : ▾ : ▴ | 7 : ↓ : ↑ | 12 : ⋁ : ⋀
• 3 : ▿ : ▵ | 8 : |
• 4 : ⇣ : ⇡ | 9 : ⁞
addMark() 🔵 primary 🟣 chainable
Injects a static structural mark at a specific numerical offset. Highly useful for visualizing thresholds, midlines, or historic support/resistance levels.
// Places a '┼' symbol at the 2nd offset position
scale.addMark(_xOffset=2, _mark=2)
📊 Mark Icon Table (_mark)
• 0 : | | 4 : ⁞
• 1 : ¦ | 5 : ⁝
• 2 : ┼ | 6 : ▼ : ▲
• 3 : ≎ | 7 : ▽ : △
addBadge() 🔵 primary 🟣 chainable
Generates a prominent text badge with a dedicated background block. Perfect for communicating state, establishing titles, or flagging status alerts.
scale.addBadge("STRONG BUY", _position=position.top_left, _color=color.green)
📈 INDICATOR METHODS
Sophisticated overlays for visualizing statistical data, volatility, and market structure directly alongside your scale.
addRuler() 🔵 primary 🟣 chainable
Deploys a structural background ruler complete with distinct start, center, and end markers, defining the scale's boundaries for better readability.
// Injects a classic ├ -┼- ┤ style ruler framework
scale.addRuler(_icon=0)
📊 Ruler Icon Table (_icon)
• 0 : ├ -┼- ┤ | 6 : ╟ -╥- ╢
• 1 : ├ -┴- ┤ | 7 : ⥢ -≎- ⥤
• 2 : ├ -┬- ┤ | 8 : ⥏ -≏- ⥑
• 3 : ╞ -╧- ╡ | 9 : | - | - |
• 4 : ╞ -╤- ╡ | 10 : | - ¦ - |
• 5 : ╟ -╨- ╢ | 11 : ⁅ - ¦ - ⁆
addAvg() 🔵 primary 🟣 chainable
Computes and visually embeds a Simple Moving Average (SMA) of the incoming source data, allowing you to compare the current value to its historical mean.
scale.addAvg(_length=14, _markerIcon=3)
📊 Average Icon Table
*Text Icons (_textIcon)*: ⌀, Ø, ∅
*Marker Icons (_markerIcon)*: Utilizes the Standard Marker Set (0-12, refer to addMarker)
addRange() 🔵 primary 🟣 chainable
Tracks and plots the Highest High and Lowest Low over a specified period, visually expressing volatility and market extremities relative to the scale limits.
scale.addRange(_length=50, _showBg=true)
📊 Range Icon Table (_textIcon)
• 0 : L - H | 5 : ▼ : ▲
• 1 : ⇊ - ⇈ | 6 : ▽ : △
• 2 : ↓ - ↑ | 7 : ▾ : ▴
• 3 : ⇣ - ⇡ | 8 : ▿ : ▵
• 4 : ↧ - ↥
addTrend() 🔵 primary 🟣 chainable
Calculates and projects a directional trend indicator (rising, falling, or neutral) derived from the source data's momentum profile.
scale.addTrend(_length=14, _colored=true)
📊 Trend Icon Table (_icon)
• 0 : ◀-|-▶ | 6 : ⟪-|-⟫
• 1 : ◁-|-▷ | 7 : ↓-=-↑
• 2 : <-±-> | 8 : ⇊-=-⇈
• 3 : ‹-±-› | 9 : ↧-±-↥
• 4 : «-±-» | 10 : ⇣-±-⇡
• 5 : ⟨-|-⟩
addAlert() 🔵 primary 🟣 chainable
Flags the exact position where a crossover or crossunder event occurs relative to a critical target level.
Note: This acts as an on-chart visual companion; you must still configure a backend PulseWire alert system for notifications.
scale.addAlert(_target=70, _type="cross", _icon=0)
⚡ ANIMATION & DECORATION
addTimer() 🟡 realtime 🟣 chainable
Embeds an active countdown timer tied to the current bar's close, updating continuously tick-by-tick.
scale.addTimer(_position=position.bottom_left)
addLoader() 🟡 realtime 🟣 chainable
Attaches a kinetic spinning or loading animation that forces visual updates on every incoming tick, conveying active data processing to the user.
// Implements an active circular progression loader
scale.addLoader(_loaderIcon=1)
📊 Loader Icon Table (_loaderIcon)
• 0 : ◜-◝-◞-◟ | 4 : ⨫-⨬
• 1 : ◎-◉ | 5 : ▰▱▱...
• 2 : ⋮-⋰-⋯-⋱ | 6 : ⊶⊷⊶⊷...
• 3 : ≓-≒-≑
addDecoration() 🔵 primary 🟣 chainable
Caps your scale with polished decorative brackets or enclosing corners, framing the data and finalizing the professional aesthetic.
scale.addDecoration(_decor=0)
📊 Decoration Icon Table (_decor)
• 0 : ◤-◥ : ◣-◢ | 5 : ⊢-⊣
• 1 : ⌜-⌝ : ⌞-⌟ | 6 : ◖-◗
• 2 : ⌏-⌎ : ⌍-⌌ | 7 : ⟦-⟧
• 3 : ◜-◝ : ◟-◞ | 8 : ⟪-⟫
• 4 : ⊞-⊟ | 9 : ⟨-⟩
📋 CHANGELOG
✅ Initial release of the Scale UI framework
✅ Implemented multi-element coordinate management
✅ Added dynamic scaling and formatting options
✅ Included comprehensive visual decorators
🙏 RELATED LIBRARIES
Check out ScaleValidator for robust input validation that can be used alongside this framework.
Also check out Motion for animating labels and colors dynamically!
Happy coding! 🚀
Made with ☕ by @cryptolinx Library

MomentumResetsMomentumResets is a compact Pine Script library for detecting momentum reset events using finite-state logic.
You get three different reset models that all return one shared exported signal enum, so integration in your own scripts stays simple and consistent.
Advantages of using this library include:
• Unified signal type : All models return the same `Signal` enum (`bullish`, `bearish`, `none`).
• State-driven logic : Explicit states are more robust than brittle one-bar pattern checks.
• Input validation : Built-in runtime checks catch invalid thresholds and shoulder settings early.
• Flexible strictness : Optional `skipValidation` when you need tolerant behaviour for dynamic or partial inputs.
• Model choice : Stoch, Static Level, and Pivot variants cover different momentum structures.
🟩 RESET MODELS
Stoch Reset
Tracks Stoch around upper/lower thresholds and emits resets when momentum rotates with confirmation conditions.
Use this when you want directional reset events, not just overbought/oversold touches.
Static Level Reset
Uses a two-phase path per side around static thresholds with an optional tolerance buffer.
Use this for "break -> return -> re-break" style momentum structures around fixed levels.
Pivot Reset
Uses shoulder distances and trailed extremes to detect retrace/bounce resets after directional expansion.
Use this for swing-style turns where relative move size matters more than absolute levels.
The models are easier to grasp by seeing them than they are to explain. They all have example visualisations included.
🟩 VALIDATION & ERROR HANDLING
The library includes defensive checks with `runtime.error()` messaging for critical misconfiguration.
Examples of guarded inputs:
• Thresholds cannot be `na`.
• Lower threshold must be below upper threshold.
• Stoch thresholds must stay within 0-100.
• Tolerance must be 0 or greater.
• Shoulder distances must be greater than 0.
• Optional pivot bounds are checked for logical consistency when both are used.
Each error message is prefixed with the library + function name to make debugging easier.
🟩 HOW TO USE
Pine Script libraries contain reusable code for importing into indicators. You do not need to copy any code out of here. Just import the library and call the function you want.
For version 1, import it like this:
import SimpleCryptoLife/MomentumResets/1
Then call one reset function per model/series path each bar, and route the returned `Signal` enum into your entries, exits, filters, or alerts.
For more information on libraries and incorporating them into your scripts, see the Libraries section of the Pine Script User Manual.
🟩 BRING ON THE FUNCTIONS
getStochResetSignal(_stochK, _stochD, _lowerThreshold, _upperThreshold, _skipValidation)
Returns a Stoch momentum reset signal using internal FSM states (neutral, tracking, suppressed).
Parameters:
_stochK (float)
Current Stoch %K value used in state transitions.
_stochD (float)
Current Stoch %D value used for confirmation logic.
_lowerThreshold (float, default 20.0)
Lower Stoch threshold used for setup and reset detection.
_upperThreshold (float, default 80.0)
Upper Stoch threshold used for setup and reset detection.
_skipValidation (bool, default false)
If true, skips guard checks and allows tolerant execution with dynamic/partial inputs.
Returns: Signal (`Signal.bullish`, `Signal.bearish`, or `Signal.none` for this bar).
getStaticLevelResetSignal(_value, _lowerThreshold, _upperThreshold, _tolerance, _skipValidation)
Returns a reset signal when value completes the threshold/tolerance path on either side.
Parameters:
_value (float)
Current series value to evaluate.
_lowerThreshold (float)
Lower static level used by the bullish reset path.
_upperThreshold (float)
Upper static level used by the bearish reset path.
_tolerance (float, default 0.0)
Optional buffer zone around levels before a reset can complete.
_skipValidation (bool, default false)
If true, skips guard checks and allows tolerant execution with dynamic/partial inputs.
Returns: Signal (`Signal.bullish`, `Signal.bearish`, or `Signal.none` for this bar).
getPivotResetSignal(_value, _leftShoulder, _rightShoulder, _bearMinHeight, _bullMaxDepth, _skipValidation)
Returns a reset signal using shoulder-based priming and trailing extremes for pivot-style turns.
Parameters:
_value (float)
Current series value to evaluate.
_leftShoulder (float)
Relative move from anchor required to prime a directional setup.
_rightShoulder (float)
Relative retrace/bounce from the trailed extreme required to trigger a reset.
_bearMinHeight (float, optional)
Optional absolute minimum high required before bearish resets are allowed.
_bullMaxDepth (float, optional)
Optional absolute maximum low required before bullish resets are allowed.
_skipValidation (bool, default false)
If true, skips guard checks and allows tolerant execution with dynamic/partial inputs.
Returns: Signal (`Signal.bullish`, `Signal.bearish`, or `Signal.none` for this bar).
Library

BASCOOL_LibBASCOOL Library v1
Range–Body Structure Analysis Toolkit for Intraday Trading
The BASCOOL Library provides high-quality, reusable Pine Script components for structural conviction analysis based purely on price action. It is designed for intraday traders who rely on volatility-adjusted range expansion and candle-body efficiency to identify strong, weak, or choppy market conditions.
Included Functions
rbm_from_ohlc() – Range–Body Measure (RBM)
A volatility-normalized structure indicator that evaluates:
Range Expansion:
Smooth EMA of (High–Low), normalized by ATR
→ captures strength of movement relative to volatility
Body Efficiency:
Body-to-Range ratio smoothed with EMA
→ measures how much of the candle’s range is “directional”
The RBM output is a smooth structural strength score typically between 0 and 1, where:
High RBM → strong structure, clean movement, trend-friendly conditions
Low RBM → compressed ranges, weak bodies, low-quality structure
Flat RBM → choppy environment, avoid directional trades Library

tp_sl_drawing_lib_v2TP/SL Drawing Library V2
A professional-grade library for creating highly customizable trade management visualizations with extensive styling options and multiple display versions. Perfect for indicators and strategies that require consistent, professional-looking trade level drawings.
Key Features - Extensive Styling Options
Multiple Visual Styles
Version 1 : Traditional multi-label style with left/center/right positioning
Version 2 : Modern streamlined style with single-side labels and tooltips
Version 3 : Advanced style with directional arrows and bar-level indicators
Version 4 : Compact with prices, R:R ratio display, and direction-based label positioning
Comprehensive Customization
Line Styles : Solid, Dashed, Dotted for all levels
Line Thickness : Individual thickness control for each level
Color Schemes : Separate colors for TP1, TP2, TP3, SL, Entry, Buy/Sell signals
Label Positioning : Flexible left/center/right positioning for all information
Information Display : Configurable display of prices, R:R ratios, percentages, and position sizes
Professional Features
Memory Management : Proper cleanup functions prevent memory leaks
Dynamic Line Management : Lines can grow in real-time while trades are open (extend_lines) and shrink to actual trade duration on close (shrink_lines)
Tooltip Integration : Hover information for all trade levels
Bad R/R Detection : Special visualization for poor risk/reward scenarios
Direction-Aware Labels (V4) : Labels automatically position away from the entry line
What's New in V4
Version 4 builds on the compact V2 style and adds:
Price Display : Shows actual price levels on SL, TP, and Entry labels
R:R Ratio on Entry : Entry label displays direction arrow and risk/reward ratio (e.g., "▼ (2R): 78.60")
Label Format : Clean "SL: price" and "TP: price" format with colon separator
Zoom-Stable Labels : All labels use style_none with text.align_left so text stays anchored at the line end regardless of zoom level
Configurable Visibility : Respects the tp_sl_price_pos and tp_sl_rrr_pos parameters — set to "Off" to hide prices or R:R ratio
Real-Time Line Extension : extend_lines() grows all trade lines with each new bar while a trade is active
Usage Example
//@version=6
indicator("My Strategy", overlay = true)
import KlausPeterchen/tp_sl_drawing_lib_v2/1 as tpsl
// Create trade drawings with V4 (compact + prices + direction-aware)
var drawings = tpsl.tradeDrawingsUnion.new()
if entrySignal
tpsl.remove_trade_drawings(4, drawings)
drawings := tpsl.draw_trade_tp_sl(
version = 4,
direction = 1,
ep = entry_price,
tp1 = take_profit,
tp2 = 0.0,
tp3 = 0.0,
sl = stop_loss,
rrr = risk_reward_ratio,
tp1_perc = 0.0,
tp2_perc = 0.0,
tp3_perc = 0.0,
sizeInfo = "",
patternStartBarIdx = bar_index,
tp_sl_line_length = 10,
show_tp1 = true,
show_tp2 = false,
show_tp3 = false,
show_sl = true,
show_ep = true,
show_size_info = false,
tp_sl_label_pos = "Left",
tp_sl_price_pos = "Right",
tp_sl_rrr_pos = "Center",
tp_sl_perc_pos = "Off",
tp_sl_qty_pos = "Off",
tp1_style = "Dashed",
tp2_style = "Dotted",
tp3_style = "Dotted",
sl_style = "Solid",
ep_style = "Solid",
tp1_thickness = 1,
tp2_thickness = 1,
tp3_thickness = 1,
sl_thickness = 1,
ep_thickness = 1,
tp1_color = color.green,
tp2_color = color.green,
tp3_color = color.green,
sl_color = color.red,
ep_color = color.gray,
buy_color = color.rgb(27, 94, 32),
sell_color = color.rgb(128, 25, 34)
)
Main Functions
Core Drawing Functions
draw_trade_tp_sl() - Create complete trade visualization with all styling options
draw_bad_rrr() - Special visualization for poor risk/reward scenarios
remove_trade_drawings() - Clean up all drawings to prevent memory issues
remove_trade_drawings_labels() - Remove only labels while keeping lines
shrink_lines() - Adjust line lengths to match elapsed trade duration on close
extend_lines() - Extend all trade lines and labels to the current bar (call each bar while a trade is open)
Data Types
tradeDrawingsV1 - Traditional multi-label style (20 drawing objects)
tradeDrawingsV2 - Modern streamlined style (10 drawing objects)
tradeDrawingsV3 - Advanced style with directional indicators
tradeDrawingsV4 - Compact with prices and direction-aware positioning (10 drawing objects)
tradeDrawingsUnion - Unified interface for all versions
Version Comparison
Label Positions:
V1 (Traditional) : Left/Center/Right positioning available
V2 (Modern) : Right-side positioning only
V3 (Advanced) : Right-side + Bar-level positioning
V4 (Compact+) : Right-side with direction-aware above/below placement
Price Display:
V1 (Traditional) : Configurable via position parameters
V2 (Modern) : Not shown (tooltip only)
V3 (Advanced) : Not shown (tooltip only)
V4 (Compact+) : Configurable via tp_sl_price_pos ("Off" to hide)
R:R Ratio Display:
V1 (Traditional) : Configurable via position parameters
V2 (Modern) : Always shown on entry
V3 (Advanced) : Always shown on entry
V4 (Compact+) : Configurable via tp_sl_rrr_pos ("Off" to hide)
Direction-Aware Labels:
V1 (Traditional) : No
V2 (Modern) : No
V3 (Advanced) : No
V4 (Compact+) : Yes — labels positioned away from entry
Tooltips:
V1 (Traditional) : No
V2 (Modern) : Yes
V3 (Advanced) : Yes
V4 (Compact+) : Yes
Memory Efficiency (drawing objects per trade):
V1 (Traditional) : 20 objects
V2 (Modern) : 10 objects
V3 (Advanced) : 12 objects
V4 (Compact+) : 10 objects
Note : This library is designed for professional use and provides extensive customization options. Choose the version that best fits your visual style and requirements.
Library

biasHelperbiasHelpers: Core Engine for Bias Analytics against a set of Benchmarks
Overview
The ` biasHelper ` library is a highly optimized backend engine designed specifically for evaluating, tracking, and aggregating bias analytics across timeframes.
Built on strict Model-View-Controller (MVC) software architecture principles, this library encapsulates all complex mathematical processing, state caching, and string formatting. By offloading these responsibilities, it allows front-end indicators to remain exceptionally lightweight, mathematically pure, and dedicated entirely to UI visualization.
This library features built-in anti-repainting guardrails, deterministic pseudo-random evaluations, and dynamic memory allocation through User-Defined Types (UDTs).
---
Core Architecture & Design Philosophy
This library operates using two primary User-Defined Types (UDTs) that track the lifecycle of a trading session:
1. ` SessionInfo `: The primary memory matrix. It tracks OHLC data, prevailing directional bias, Heikin-Ashi extensions, and cumulative hit/close counts.
2. ` SessionLines `: The visual array tracker. It orchestrates the projection of structural support/resistance levels and evaluates live price touches against them.
By maintaining state inside these objects rather than utilizing global arrays, the library ensures O(1) time complexity during bar evaluation, resulting in lightning-fast execution even on dense chart histories.
---
Exported Types (UDTs)
`SessionInfo`
The core data structure for tracking session metrics and bias execution.
* **Price Tracking**: `prevHigh`, `prevLow`, `currentHigh`, `currentLow`, `currentOpen`.
* **Heikin-Ashi Anchors**: `prevHaOpen`, `prevHaClose`.
* **State Trackers**: `pushedUp` (bool), `currentBias` (int: 1 = Bullish, -1 = Bearish, 0 = Neutral).
* **Metric Accumulators**: `bullishCount`, `bearishCount`, `hitHighCount`, `hitLowCount`, `closeHighCount`, `closeLowCount`.
`SessionLines`
The spatial data structure for tracking visual levels and live touches.
* Lines : `highLine`, `lowLine`.
* Touch Booleans : `hitHighLine`, `hitLowLine`.
---
Data & State Management
`updateData(infoObj, isNew, pClose, cOpen, cHigh, cLow)`
The standard market structure logic handler. It evaluates historical structural breaks against the previous close to determine the prevailing directional bias without repainting.
* Parameters : Evaluates state using standard OHLC inputs and strictly anchors to `close ` (`pClose`) to guarantee real-time parity with historical states.
`updateBenchmarkData(infoObj, isNew, pClose, cOpen, cHigh, cLow, bType, tfSeconds)`
A dynamic routing matrix for alternative bias benchmarks.
* Supported `bType` Routing :
* `"MOM"`: Pure Candlestick Momentum (Close vs. Open).
* `"HA"`: Synthetic Heikin-Ashi Momentum evaluated securely within standard chart data.
* `"ABULL"` / `"ABEAR"`: Static directional evaluations (Always Bullish / Always Bearish).
* `"COIN"`: Deterministic pseudo-random generation. Generates a perfect 50/50 randomized output anchored mathematically to the timestamp and previous close, guaranteeing it never repaints or flickers on live ticks.
* `"DTD"`: Day-to-Day alternating parity based on absolute time intervals.
`processLines(linesObj, infoObj, isNew, tRight, lStyle, currHigh, currLow)`
Draws historical support/resistance barriers and evaluates current price action (`currHigh`, `currLow`) to register touches and successful close-throughs.
---
Math & Aggregation
`calcTrueRate(biasCount, hitCount, closeCount)`
Calculates the *True Close-Through Rate* (Success Rate × Close-Through Rate) while safely handling zero-division scenarios. Returns a standardized float coefficient.
`getTotals(infoObj)`
Extracts aggregated cross-directional totals for condensed dashboard views.
* Returns : A tuple ` `.
---
UI Formatting Utilities
`getTablePos(pos)` & `getTableSize(size)`
Translates string-based user inputs (e.g., `"Top Right"`, `"Normal"`) into native Pine Script structural variables (`position.top_right`, `size.normal`).
`formatResult(hit, biasCount)`
Converts raw integers into a cleanly formatted fractional percentage string (e.g., `"45.2%"`).
`formatPercent(value)`
Converts a raw floating-point coefficient into a polished percentage string.
---
Implementation Example
To utilize this library in your indicator, instantiate the UDTs and pass them through the update loops securely:
import TRSTNGLRD/biasHelpers/4 as lib
// 1. Initialize Objects
var lib.SessionInfo sessionData = lib.SessionInfo.new()
var lib.SessionLines sessionLines = lib.SessionLines.new()
// 2. Evaluate State
if isEligibleTimeframe
sessionData.updateData(isNewSession, close , open, high, low)
= sessionLines.processLines(sessionData, isNewSession, rightTime, lineStyle, high, low)
// 3. Extract Formatted Data
= sessionData.getTotals()
string trueRate = lib.formatPercent(lib.calcTrueRate(tBias, tHit, tClose))
Note to Developers
This library adheres strictly to PulseWire's anti-repainting guidelines. When feeding inputs into `updateData` or `updateBenchmarkData`, always utilize the previous bar's close (`close `) for the `pClose` parameter. Live data (`high`, `low`) should exclusively be passed into the `processLines` method to allow real-time touch detection. Library

Letras_Lecaps_Library---
**Letras_Lecaps_Library — Argentine Fixed-Rate Instruments & Dollar Futures Data**
Pine Script library that provides centralized reference data for Argentine Lecaps, Boncaps, and Matba-Rofex Dollar Futures contracts. Designed to be imported by indicators and strategies that need ticker symbols, maturity dates, and redemption prices without hardcoding them.
**What's inside**
The library exports simple accessor functions for three instrument classes:
- **Lecaps** (9 series): BCBA tickers, maturity price per VN100 (Monto_al_Vto), and payment date for each active short-term zero-coupon treasury bill.
- **Boncaps** (6 series): Same structure as Lecaps, covering longer-term capitalization bonds.
- **Dollar Futures** (12 contracts): MATBAROFEX tickers and expiry dates for USD/ARS futures.
Count functions (`lecapCount()`, `boncapCount()`, `futuresCount()`) return the number of active instruments in each category, so consuming scripts can adapt dynamically.
**Data sources**
- Lecaps & Boncaps: IAMC (Instituto Argentino de Mercado de Capitales) periodic report.
- Dollar Futures: A3 Mercados (Matba-Rofex), expiry dates verified against PulseWire contract pages.
**How to use**
```pine
import EcoValores/Letras_Lecaps_Library/1 as lib
// Get the ticker and maturity data for the first Lecap
ticker = lib.lecapTicker1() // "BCBA:S27F6"
matPx = lib.lecapMaturityPrice1() // 125.84
matDt = lib.lecapMaturityDate1() // timestamp for 27/02/2026
```
**Update cycle**
This library reflects a point-in-time snapshot. It should be updated and republished after each public auction or when new IAMC data becomes available. Expired instruments are removed and new ones added, with count functions adjusted accordingly. The last data source date is noted in the script header.
**Related**
This library is the data backend for the **Breakeven Lecaps_Boncaps** indicator, which uses it to calculate and plot breakeven USD exchange rates across the term structure.
---
**Descripción en Español**
Librería Pine Script que centraliza los datos de referencia de Lecaps, Boncaps y contratos de Dólar Futuro de Matba-Rofex. Diseñada para ser importada por indicadores y estrategias que necesitan tickers, fechas de vencimiento y precios de rescate sin codificarlos directamente.
Exporta funciones de acceso para tres clases de instrumentos: Lecaps (9 series, tickers BCBA, precio al vencimiento por VN100 y fecha de pago), Boncaps (6 series, misma estructura), y Dólar Futuro (12 contratos, tickers MATBAROFEX y fecha de expiración). Las funciones de conteo permiten que los scripts consumidores se adapten dinámicamente.
Fuentes de datos: Lecaps y Boncaps del informe periódico del IAMC; Dólar Futuro de A3 Mercados (Matba-Rofex). La librería refleja una foto puntual y debe republicarse tras cada licitación o cuando haya nuevos datos disponibles.
Esta librería es el backend de datos del indicador **Breakeven Lecaps_Boncaps**, que la utiliza para calcular y graficar el tipo de cambio breakeven en dólares a lo largo de la curva.
---
**Disclaimer / Aviso legal**
This library is for informational and educational purposes only. It does not constitute investment advice. Data may be incomplete, delayed, or inaccurate. Verify all tickers and values independently before use. Past performance is not indicative of future results. Consult a licensed financial advisor before making investment decisions.
Esta librería es solo para fines informativos y educativos. No constituye asesoramiento de inversión. Los datos pueden ser incompletos, estar demorados o ser inexactos. Verifique todos los tickers y valores de forma independiente antes de utilizarla. El rendimiento pasado no es indicativo de resultados futuros. Consulte a un asesor financiero matriculado antes de invertir. Library

ScaleValidator🛡️ ScaleValidator Library - Input Validation for PineScript
📢 ABOUT
ScaleValidator is a lightweight utility library that provides robust input validation for PineScript. It ensures your scripts receive valid arguments and throws helpful runtime errors when they don't.
✨ FEATURES
🛡️ Validation Methods
Validate inputs and throw descriptive runtime errors if invalid:
• isValidLocation() — Validate location strings
• isValidPosition() — Validate position strings
• isValidFormat() — Validate format strings
• isValidPOV() — Validate point-of-view (extend) strings
🔍 Helper Methods
Quick boolean checks without throwing errors:
• isLocationAbove() / isLocationBelow() — Check vertical location
• isPositionAbove() / isPositionCenter() / isPositionBelow() — Check position row
• isPositionLeft() / isPositionRight() — Check position column
💡 USAGE EXAMPLE
//@version=6
indicator("Validator Demo", overlay = true)
import cryptolinx/ScaleValidator/1 as v
// Validate inputs before using them
userPosition = input.string(position.top_center, "Position")
if v.isValidPosition(userPosition)
// Safe to use the position
label.new(bar_index, high, "Valid!",
xloc = xloc.bar_index,
style = label.style_label_down,
textcolor = color.white)
// Quick checks without throwing errors
if v.isPositionAbove(userPosition)
// Position is in top row
plotchar(close, char = "▲", location = location.abovebar)
📊 VALID CONSTANTS REFERENCE
Locations
• location.top — Top of pane
• location.bottom — Bottom of pane
• location.abovebar — Above price bar
• location.belowbar — Below price bar
• location.absolute — Absolute position
Positions (3x3 Grid)
• Top Row: top_left, top_center, top_right
• Middle Row: middle_left, middle_center, middle_right
• Bottom Row: bottom_left, bottom_center, bottom_right
Formats
• format.inherit — Inherit from parent
• format.percent — Percentage format
Point of View (Extend)
• extend.both — Extend in both directions
• extend.left — Extend to the left
• extend.right — Extend to the right
🔧 METHOD REFERENCE
Validators (throw runtime error if invalid)
• isValidLocation(string) → bool
• isValidPosition(string) → bool
• isValidFormat(string) → bool
• isValidPOV(string) → bool
Helpers (return bool, no errors)
• isLocationAbove(string) → bool
• isLocationBelow(string) → bool
• isPositionAbove(string) → bool
• isPositionCenter(string) → bool
• isPositionBelow(string) → bool
• isPositionLeft(string) → bool
• isPositionRight(string) → bool
🚀 WHY USE THIS?
• 🛡️ Defensive Programming — Catch invalid inputs early
• 📖 Helpful Errors — Descriptive messages show valid options
• ⚡ Lightweight — No dependencies, minimal overhead
• 🔗 Companion to ScalesDEV — Used internally by the Scale library
📋 CHANGELOG
✅ Added method badges (helper/validator)
✅ Created reference tables for valid constants
✅ Improved parameter descriptions
✅ Formatted return types
🙏 RELATED LIBRARIES
Check out Scales for building beautiful scale visualizations that use this validator!
Battries included! 🔋Happy coding! 🚀 @cryptolinx for the PulseWire community
Library

DafeVisLibDafeVisLib: The Intelligent Visualization & UI Engine
This is not a library of colors and drawing functions. This is an AI-powered artist and data scientist that lives in your code. It automates the complex, time-consuming process of data analysis and visualization, allowing you to focus on what truly matters: your trading ideas.
█ CHAPTER 1: THE PHILOSOPHY - BEYOND PLOTTING, INTO PERCEPTION
For too long, the world of technical indicator development has been bifurcated. On one side, you have the quantitative analyst, obsessed with mathematical purity but often displaying their work in a crude, unintuitive manner. On the other, you have the visual designer, creating beautiful indicators that often lack analytical depth. The result for the end-user is a compromise: either a tool that is powerful but ugly and hard to interpret, or one that is beautiful but analytically shallow.
The DafeVisLib was created to shatter this compromise. Its core philosophy is that great analysis and great visualization are not separate disciplines; they are two sides of the same coin . An indicator should not just present data; it should communicate intelligence. It should automatically understand the nature of the data it is given and render it in the most effective, intuitive, and aesthetically pleasing way possible.
This library is an "Architect." You provide it with the raw materials—a simple data series like an RSI or a moving average—and it handles the entire complex process of analysis, configuration, and rendering. It is the ultimate accelerator for developers, saving hundreds of hours of boilerplate code, and the ultimate upgrade for traders, providing a level of clarity and visual intelligence previously unseen on this platform.
█ CHAPTER 2: THE CORE INNOVATION - THE "ANALYZE, THEN RENDER" PARADIGM
The DafeVisualsLib operates on a revolutionary two-stage pipeline that sets it apart from any other tool. This is not a passive collection of functions; it is an active, intelligent system.
STAGE 1: The analyze() Function (The Data Scientist)
This is the brain. Before a single line is drawn, this function performs a sophisticated statistical analysis on your raw data series to understand its fundamental character. It asks the critical questions that a human analyst would:
What is the Data Type? It automatically detects if your data is a bounded "oscillator" like an RSI, a zero-centric "momentum" indicator like MACD, a "price"-based line like a moving average, or a "volume"-based metric. This is crucial, as an oscillator should be visualized differently than a volume histogram.
What is the Market Regime? It analyzes the data's volatility (using the coefficient of variation) to classify the current environment as a low-volatility "squeeze," a moderate-volatility "trend," or a high-volatility "volatile" state.
Where is the Data in its Cycle? It normalizes the data to a 0-100 scale and calculates its Z-Score to determine if it is currently at a statistical "extreme."
The output of this stage is a MetricAnalysis object—a complete analytical report on the DNA of your data.
STAGE 2: The auto_config() Function (The Artist & Physicist)
This is where the magic happens. This function takes the analytical report from analyze() and uses it to make a series of intelligent, context-aware decisions about how the data should be visualized.
Intelligent Color Logic: It doesn't just use one color. For an "oscillator," it will create a beautiful heatmap gradient. For a "momentum" indicator, it will use a binary bull/bear color scheme.
Neon Physics: It separates the color into a solid c_core and a transparent c_glow. The opacity of the glow is not static; it is dynamically controlled by the detected market regime. In a "volatile" regime, the glow becomes bright and intense. In a "squeeze," it becomes dim and subtle.
Adaptive Style & Width: It automatically adjusts the plot style and line width. A "momentum" indicator will be rendered as an area chart by default. A "volume" series will become columns. A "price" line will be thick and bold in a volatile market and thin and clean in a calm market.
Smart Zones: If it detects that the data is an "oscillator," it will automatically recommend showing overbought/oversold zones and provide the standard 70/30 levels.
The output of this stage is a PlotConfig object—a complete, ready-to-use set of plotting instructions, intelligently tailored to your specific data and the current market conditions.
█ CHAPTER 3: A DEEP DIVE INTO THE DEVELOPER'S TOOLKIT
This library is a gift to Pine Script developers. It is a suite of powerful, high-level functions designed to dramatically simplify your workflow and elevate the final product.
The Theme Engine
Forget hard-coding colors. The get_theme() function provides access to a library of professionally designed, high-contrast color themes ( Neon, Cyber, Matrix, Gold, Ice, Blood, DAFE Signature ). Each Theme object contains a complete, consistent palette for primary, secondary, accent, bull, bear, and neutral colors. This allows you to build indicators that are not only functional but also have a polished, professional aesthetic that is consistent across all your DAFE-powered creations.
The Color Engine
Go beyond simple colors with a powerful suite of advanced color functions. gradient_color() allows for smooth linear interpolation between any two colors. gradient_3() creates a three-point gradient, perfect for heatmaps. adaptive_alpha() calculates the optimal transparency for an element based on a confidence or strength score, making your visuals dynamically react to the data.
Candle Diagnostics
The diagnose_candle() function is a complete microstructure analysis tool in a single call. It returns a detailed breakdown of any candle, including its body vs. wick percentages, and flags for common patterns like Dojis, Hammers, Shooting Stars, and Marubozus. The companion candle_color() function uses this analysis to provide intelligent, health-based candle coloring.
The UI & HUD Toolkit
Building user interfaces with tables can be tedious and complex. This library provides a comprehensive suite of helper functions to make it effortless and beautiful.
ASCII Art Generators: Functions like draw_bar(), draw_gauge(), draw_stars(), and the incredible draw_sparkline() allow you to create rich, data-dense, text-based visualizations directly within your dashboards.
Dashboard Builders: A modular toolkit for creating professional dashboards. create_pane() initializes the table. fill_header(), fill_metric(), fill_status(), and fill_separator() provide a simple, high-level API for populating your dashboard with consistently styled and beautifully formatted information.
Smart Formatting: Utilities like smart_text() (which auto-selects black or white text for optimal contrast) and format_compact() (which abbreviates large numbers to "1.23M" or "456K") handle the small details that create a polished user experience.
█ CHAPTER 4: DEVELOPMENT PHILOSOPHY
The DafeVisLib was born from a desire to democratize elite-level indicator design. For too long, the ability to create beautiful, context-aware, and intuitively designed indicators has been the domain of a select few developers with deep knowledge of both programming and graphic design. This library changes that. It is an open-source tool that encapsulates thousands of hours of research and development into a simple, powerful API.
Our philosophy is that a developer's most valuable asset is their idea. They should be free to focus on inventing new, powerful analytical concepts, without getting bogged down in the tedious, repetitive work of building robust visualization and configuration systems from scratch. This library is our contribution to the Pine Script community—a tool for builders, designed to accelerate innovation and elevate the quality of indicators for everyone.
This library embraces that philosophy. It handles immense complexity on the backend to deliver absolute simplicity and elegance on the frontend, both for the developer who uses it and the trader who benefits from it.
█ DISCLAIMER & IMPORTANT NOTES
THIS IS A LIBRARY FOR DEVELOPERS: This script does nothing on its own. It is a powerful engine that must be imported and used by other indicator developers in their own scripts. It is a tool for building, not a ready-made indicator.
THE ANALYSIS IS A GUIDE: The analyze() function's classification of data and regimes is based on a robust set of heuristics, but it is a statistical interpretation. It provides a powerful baseline for visualization but is not a substitute for a trader's own judgment.
"Simplicity is the ultimate sophistication."
— Leonardo da Vinci
Taking you to school. — Dskyz, Trade with insight. Trade with anticipation. Library

Library

Library

Library

Library

Library

lib_bar_strengthBig bar breakout detection for multi-timeframe trading systems.
Identifies significant ("big") bars where the range exceeds a configurable ATR multiple. Classifies them as Bull Break, Bear Break, Possible Bull, or Possible Bear. Tracks the most recent strong bar's high, low, midpoint, and ATR multiple for use in key signal notes.
**Event types:** 0=None, 1=Bull Break, 2=Bear Break, 3=Possible Bull, 4=Possible Bear
**Exports:** `detect()` — returns event type, high, low, midpoint, ATR multiple, and recent strong bar data.
Used by: TCD - Trade Consistent & Disciplined (indicator) Library

Library

ToolsNotificationLibrary "ToolsNotification"
notify(value, pos, width, height, textColor, alignV, alignH, textSize, backgroundColor, tooltip, fontFamily)
Parameters:
value (string)
pos (string)
width (int)
height (int)
textColor (color)
alignV (string)
alignH (string)
textSize (string)
backgroundColor (color)
tooltip (string)
fontFamily (string) Library

Library

arraysLibrary "arrays"
Supplementary array methods.
method delete(arr, index)
remove int object from array of integers at specific index
Namespace types: array
Parameters:
arr (array) : int array
index (int) : index at which int object need to be removed
Returns: void
method delete(arr, index)
remove float object from array of float at specific index
Namespace types: array
Parameters:
arr (array) : float array
index (int) : index at which float object need to be removed
Returns: float
method delete(arr, index)
remove bool object from array of bool at specific index
Namespace types: array
Parameters:
arr (array) : bool array
index (int) : index at which bool object need to be removed
Returns: bool
method delete(arr, index)
remove string object from array of string at specific index
Namespace types: array
Parameters:
arr (array) : string array
index (int) : index at which string object need to be removed
Returns: string
method delete(arr, index)
remove color object from array of color at specific index
Namespace types: array
Parameters:
arr (array) : color array
index (int) : index at which color object need to be removed
Returns: color
method delete(arr, index)
remove chart.point object from array of chart.point at specific index
Namespace types: array
Parameters:
arr (array) : chart.point array
index (int) : index at which chart.point object need to be removed
Returns: void
method delete(arr, index)
remove line object from array of lines at specific index and deletes the line
Namespace types: array
Parameters:
arr (array) : line array
index (int) : index at which line object need to be removed and deleted
Returns: void
method delete(arr, index)
remove label object from array of labels at specific index and deletes the label
Namespace types: array
Parameters:
arr (array) : label array
index (int) : index at which label object need to be removed and deleted
Returns: void
method delete(arr, index)
remove box object from array of boxes at specific index and deletes the box
Namespace types: array
Parameters:
arr (array) : box array
index (int) : index at which box object need to be removed and deleted
Returns: void
method delete(arr, index)
remove table object from array of tables at specific index and deletes the table
Namespace types: array
Parameters:
arr (array) : table array
index (int) : index at which table object need to be removed and deleted
Returns: void
method delete(arr, index)
remove linefill object from array of linefills at specific index and deletes the linefill
Namespace types: array
Parameters:
arr (array) : linefill array
index (int) : index at which linefill object need to be removed and deleted
Returns: void
method delete(arr, index)
remove polyline object from array of polylines at specific index and deletes the polyline
Namespace types: array
Parameters:
arr (array) : polyline array
index (int) : index at which polyline object need to be removed and deleted
Returns: void
method popr(arr)
remove last int object from array
Namespace types: array
Parameters:
arr (array) : int array
Returns: int
method popr(arr)
remove last float object from array
Namespace types: array
Parameters:
arr (array) : float array
Returns: float
method popr(arr)
remove last bool object from array
Namespace types: array
Parameters:
arr (array) : bool array
Returns: bool
method popr(arr)
remove last string object from array
Namespace types: array
Parameters:
arr (array) : string array
Returns: string
method popr(arr)
remove last color object from array
Namespace types: array
Parameters:
arr (array) : color array
Returns: color
method popr(arr)
remove last chart.point object from array
Namespace types: array
Parameters:
arr (array) : chart.point array
Returns: void
method popr(arr)
remove and delete last line object from array
Namespace types: array
Parameters:
arr (array) : line array
Returns: void
method popr(arr)
remove and delete last label object from array
Namespace types: array
Parameters:
arr (array) : label array
Returns: void
method popr(arr)
remove and delete last box object from array
Namespace types: array
Parameters:
arr (array) : box array
Returns: void
method popr(arr)
remove and delete last table object from array
Namespace types: array
Parameters:
arr (array) : table array
Returns: void
method popr(arr)
remove and delete last linefill object from array
Namespace types: array
Parameters:
arr (array) : linefill array
Returns: void
method popr(arr)
remove and delete last polyline object from array
Namespace types: array
Parameters:
arr (array) : polyline array
Returns: void
method shiftr(arr)
remove first int object from array
Namespace types: array
Parameters:
arr (array) : int array
Returns: int
method shiftr(arr)
remove first float object from array
Namespace types: array
Parameters:
arr (array) : float array
Returns: float
method shiftr(arr)
remove first bool object from array
Namespace types: array
Parameters:
arr (array) : bool array
Returns: bool
method shiftr(arr)
remove first string object from array
Namespace types: array
Parameters:
arr (array) : string array
Returns: string
method shiftr(arr)
remove first color object from array
Namespace types: array
Parameters:
arr (array) : color array
Returns: color
method shiftr(arr)
remove first chart.point object from array
Namespace types: array
Parameters:
arr (array) : chart.point array
Returns: void
method shiftr(arr)
remove and delete first line object from array
Namespace types: array
Parameters:
arr (array) : line array
Returns: void
method shiftr(arr)
remove and delete first label object from array
Namespace types: array
Parameters:
arr (array) : label array
Returns: void
method shiftr(arr)
remove and delete first box object from array
Namespace types: array
Parameters:
arr (array) : box array
Returns: void
method shiftr(arr)
remove and delete first table object from array
Namespace types: array
Parameters:
arr (array) : table array
Returns: void
method shiftr(arr)
remove and delete first linefill object from array
Namespace types: array
Parameters:
arr (array) : linefill array
Returns: void
method shiftr(arr)
remove and delete first polyline object from array
Namespace types: array
Parameters:
arr (array) : polyline array
Returns: void
method push(arr, val, maxItems)
add int to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : int array
val (int) : int object to be pushed
maxItems (int) : max number of items array can hold
Returns: int
method push(arr, val, maxItems)
add float to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : float array
val (float) : float object to be pushed
maxItems (int) : max number of items array can hold
Returns: float
method push(arr, val, maxItems)
add bool to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : bool array
val (bool) : bool object to be pushed
maxItems (int) : max number of items array can hold
Returns: bool
method push(arr, val, maxItems)
add string to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : string array
val (string) : string object to be pushed
maxItems (int) : max number of items array can hold
Returns: string
method push(arr, val, maxItems)
add color to the end of an array with max items cap. Objects are removed from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : color array
val (color) : color object to be pushed
maxItems (int) : max number of items array can hold
Returns: color
method push(arr, val, maxItems)
add chart.point to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : chart.point array
val (chart.point) : chart.point object to be pushed
maxItems (int) : max number of items array can hold
Returns: chart.point
method push(arr, val, maxItems)
add line to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : line array
val (line) : line object to be pushed
maxItems (int) : max number of items array can hold
Returns: line
method push(arr, val, maxItems)
add label to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : label array
val (label) : label object to be pushed
maxItems (int) : max number of items array can hold
Returns: label
method push(arr, val, maxItems)
add box to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : box array
val (box) : box object to be pushed
maxItems (int) : max number of items array can hold
Returns: box
method push(arr, val, maxItems)
add table to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : table array
val (table) : table object to be pushed
maxItems (int) : max number of items array can hold
Returns: table
method push(arr, val, maxItems)
add linefill to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : linefill array
val (linefill) : linefill object to be pushed
maxItems (int) : max number of items array can hold
Returns: linefill
method push(arr, val, maxItems)
add polyline to the end of an array with max items cap. Objects are removed and deleted from start to maintain max items cap
Namespace types: array
Parameters:
arr (array) : polyline array
val (polyline) : polyline object to be pushed
maxItems (int) : max number of items array can hold
Returns: polyline
method unshift(arr, val, maxItems)
add int to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : int array
val (int) : int object to be unshift
maxItems (int) : max number of items array can hold
Returns: int
method unshift(arr, val, maxItems)
add float to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : float array
val (float) : float object to be unshift
maxItems (int) : max number of items array can hold
Returns: float
method unshift(arr, val, maxItems)
add bool to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : bool array
val (bool) : bool object to be unshift
maxItems (int) : max number of items array can hold
Returns: bool
method unshift(arr, val, maxItems)
add string to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : string array
val (string) : string object to be unshift
maxItems (int) : max number of items array can hold
Returns: string
method unshift(arr, val, maxItems)
add color to the beginning of an array with max items cap. Objects are removed from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : color array
val (color) : color object to be unshift
maxItems (int) : max number of items array can hold
Returns: color
method unshift(arr, val, maxItems)
add chart.point to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : chart.point array
val (chart.point) : chart.point object to be unshift
maxItems (int) : max number of items array can hold
Returns: chart.point
method unshift(arr, val, maxItems)
add line to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : line array
val (line) : line object to be unshift
maxItems (int) : max number of items array can hold
Returns: line
method unshift(arr, val, maxItems)
add label to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : label array
val (label) : label object to be unshift
maxItems (int) : max number of items array can hold
Returns: label
method unshift(arr, val, maxItems)
add box to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : box array
val (box) : box object to be unshift
maxItems (int) : max number of items array can hold
Returns: box
method unshift(arr, val, maxItems)
add table to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : table array
val (table) : table object to be unshift
maxItems (int) : max number of items array can hold
Returns: table
method unshift(arr, val, maxItems)
add linefill to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : linefill array
val (linefill) : linefill object to be unshift
maxItems (int) : max number of items array can hold
Returns: linefill
method unshift(arr, val, maxItems)
add polyline to the beginning of an array with max items cap. Objects are removed and deleted from end to maintain max items cap
Namespace types: array
Parameters:
arr (array) : polyline array
val (polyline) : polyline object to be unshift
maxItems (int) : max number of items array can hold
Returns: polyline
method isEmpty(arr)
checks if an int array is either null or empty
Namespace types: array
Parameters:
arr (array) : int array
Returns: bool
method isEmpty(arr)
checks if a float array is either null or empty
Namespace types: array
Parameters:
arr (array) : float array
Returns: bool
method isEmpty(arr)
checks if a string array is either null or empty
Namespace types: array
Parameters:
arr (array) : string array
Returns: bool
method isEmpty(arr)
checks if a bool array is either null or empty
Namespace types: array
Parameters:
arr (array) : bool array
Returns: bool
method isEmpty(arr)
checks if a color array is either null or empty
Namespace types: array
Parameters:
arr (array) : color array
Returns: bool
method isEmpty(arr)
checks if a chart.point array is either null or empty
Namespace types: array
Parameters:
arr (array) : chart.point array
Returns: bool
method isEmpty(arr)
checks if a line array is either null or empty
Namespace types: array
Parameters:
arr (array) : line array
Returns: bool
method isEmpty(arr)
checks if a label array is either null or empty
Namespace types: array
Parameters:
arr (array) : label array
Returns: bool
method isEmpty(arr)
checks if a box array is either null or empty
Namespace types: array
Parameters:
arr (array) : box array
Returns: bool
method isEmpty(arr)
checks if a linefill array is either null or empty
Namespace types: array
Parameters:
arr (array) : linefill array
Returns: bool
method isEmpty(arr)
checks if a polyline array is either null or empty
Namespace types: array
Parameters:
arr (array) : polyline array
Returns: bool
method isEmpty(arr)
checks if a table array is either null or empty
Namespace types: array
Parameters:
arr (array) : table array
Returns: bool
method isNotEmpty(arr)
checks if an int array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : int array
Returns: bool
method isNotEmpty(arr)
checks if a float array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : float array
Returns: bool
method isNotEmpty(arr)
checks if a string array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : string array
Returns: bool
method isNotEmpty(arr)
checks if a bool array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : bool array
Returns: bool
method isNotEmpty(arr)
checks if a color array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : color array
Returns: bool
method isNotEmpty(arr)
checks if a chart.point array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : chart.point array
Returns: bool
method isNotEmpty(arr)
checks if a line array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : line array
Returns: bool
method isNotEmpty(arr)
checks if a label array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : label array
Returns: bool
method isNotEmpty(arr)
checks if a box array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : box array
Returns: bool
method isNotEmpty(arr)
checks if a linefill array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : linefill array
Returns: bool
method isNotEmpty(arr)
checks if a polyline array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : polyline array
Returns: bool
method isNotEmpty(arr)
checks if a table array is not null and has at least one item
Namespace types: array
Parameters:
arr (array) : table array
Returns: bool
method flush(arr)
remove all int objects in an array
Namespace types: array
Parameters:
arr (array) : int array
Returns: int
method flush(arr)
remove all float objects in an array
Namespace types: array
Parameters:
arr (array) : float array
Returns: float
method flush(arr)
remove all bool objects in an array
Namespace types: array
Parameters:
arr (array) : bool array
Returns: bool
method flush(arr)
remove all string objects in an array
Namespace types: array
Parameters:
arr (array) : string array
Returns: string
method flush(arr)
remove all color objects in an array
Namespace types: array
Parameters:
arr (array) : color array
Returns: color
method flush(arr)
remove all chart.point objects in an array
Namespace types: array
Parameters:
arr (array) : chart.point array
Returns: chart.point
method flush(arr)
remove and delete all line objects in an array
Namespace types: array
Parameters:
arr (array) : line array
Returns: line
method flush(arr)
remove and delete all label objects in an array
Namespace types: array
Parameters:
arr (array) : label array
Returns: label
method flush(arr)
remove and delete all box objects in an array
Namespace types: array
Parameters:
arr (array) : box array
Returns: box
method flush(arr)
remove and delete all table objects in an array
Namespace types: array
Parameters:
arr (array) : table array
Returns: table
method flush(arr)
remove and delete all linefill objects in an array
Namespace types: array
Parameters:
arr (array) : linefill array
Returns: linefill
method flush(arr)
remove and delete all polyline objects in an array
Namespace types: array
Parameters:
arr (array) : polyline array
Returns: polyline Library

LineWrapperLibrary "LineWrapper"
Wrapper Type for Line. Useful when you want to store the line details without drawing them. Can also be used in scenarios where you collect lines to be drawn and draw together towards the end.
method draw(this)
draws line as per the wrapper object contents
Namespace types: Line
Parameters:
this (Line) : (series Line) Line object.
Returns: current Line object
method draw(this)
draws lines as per the wrapper object array
Namespace types: array
Parameters:
this (array) : (series array) Array of Line object.
Returns: current Array of Line objects
method update(this)
updates or redraws line as per the wrapper object contents
Namespace types: Line
Parameters:
this (Line) : (series Line) Line object.
Returns: current Line object
method update(this)
updates or redraws lines as per the wrapper object array
Namespace types: array
Parameters:
this (array) : (series array) Array of Line object.
Returns: current Array of Line objects
method delete(this)
Deletes the underlying line drawing object
Namespace types: Line
Parameters:
this (Line) : (series Line) Line object.
Returns: Current Line object
method get_price(this, bar)
get line price based on bar
Namespace types: Line
Parameters:
this (Line) : (series Line) Line object.
bar (int) : (series/int) bar at which line price need to be calculated
Returns: line price at given bar.
Line
Line Wrapper object
Fields:
p1 (chart.point)
p2 (chart.point)
xloc (series string) : (series string) See description of x1 argument. Possible values: xloc.bar_index and xloc.bar_time. Default is xloc.bar_index.
extend (series string) : (series string) If extend=extend.none, draws segment starting at point (x1, y1) and ending at point (x2, y2). If extend is equal to extend.right or extend.left, draws a ray starting at point (x1, y1) or (x2, y2), respectively. If extend=extend.both, draws a straight line that goes through these points. Default value is extend.none.
color (series color) : (series color) Line color.
style (series string) : (series string) Line style. Possible values: line.style_solid, line.style_dotted, line.style_dashed, line.style_arrow_left, line.style_arrow_right, line.style_arrow_both.
width (series int) : (series int) Line width in pixels.
obj (series line) : line object Library
