Поиск скриптов по запросу "科创50指数历史波动率及最大回撤数据"
50-Minute Opening Range BreakoutThis is a test of the opening range with Bearish/Bullish confirmation
50-Line Oscillator // (\_/)
// ( •.•)
// (")_(")
25-Line Oscillator
Description:
The 25-Line Oscillator is a sophisticated technical analysis tool designed to visualize market trends through the use of multiple Simple Moving Averages (SMAs). This indicator computes a series of 26 SMAs, incrementally increasing the base length, providing traders with a comprehensive view of price dynamics.
Features:
Customizable Base Length: Adjust the base length of the SMAs according to trading preferences, enhancing versatility for different market conditions.
Rainbow Effect: The indicator employs a visually appealing rainbow color scheme to differentiate between the various trend lines, making it easy to identify crossovers and momentum shifts.
Crossovers Detection: The script includes logic to detect crossover events between consecutive trend lines, which can serve as signals for potential entry or exit points in trading.
Clear Visualization: Suitable for both novice and seasoned traders, the plots enable quick interpretation of trends and market behavior.
How to Use:
Add the indicator to your chart and customize the base length as desired.
Observe the rainbow-colored lines for trend direction.
Look for crossover events between the SMAs as potential trading signals.
Application: This indicator is particularly useful for swing traders and trend followers who aim to capitalize on market momentum and identify reversals. By monitoring the behavior of multiple SMAs, traders can gain insights into the strength and direction of price movements over various time frames.
AK Simple Moving Average 50 days Simple Moving average suitable for Intraday on 1Hr,30Min.15Min Time frames
1. When candle crossing above SMA Line - Go for Long Entries
2. When candle crossing below SMA Line - Go for short Entries
50 SMA / 200 EMA / 128EMA Moving Average CrossFound success using 50SMA vs 200EMA.
128 EMA also charted for it's BTC relevance.
50/100/200 Moving Averages (Pine Script For Copy)by fresca
SCRIPT LANGUAGE
Copy script below and adjust based on your preferences.
-function (change function from "sma" to "ema", "wma" and more)
-length (25 Day, 150 Day or add more averages to the three in this script.)
-color, (red, yellow, etc. or use color hex codes i.e. #FEDA15, #FFAD8F, etc.)
-transparency (set to desired level 1-100)
Or add more options.
RESOURCES
Color hex codes site: www.canva.com
Trading View Pine Script Editor Reference Guide: www.tradingview.com
Taint's Multi Time Frame MA50-100-200 SMA with two 200 EMA's all with the ability choose a time frame for each.
MCL RSI Conflux v2.5 — Multi-Timeframe Momentum & Z-Score Full Description
Overview
The MCL RSI Conflux v2.5 is a multi-timeframe momentum model that integrates daily, weekly, and monthly RSI values into a unified composite. It extends the classical RSI framework with adaptive overbought/oversold thresholds and statistical normalization (Z-score confluence).
This combination allows traders to visualize cross-timeframe alignment, identify synchronized momentum shifts, and detect exhaustion zones with higher statistical confidence.
Methodology
The script extracts RSI data from three major time horizons:
Daily RSI (short-term momentum)
Weekly RSI (intermediate trend)
Monthly RSI (macro bias)
Each RSI is optionally smoothed, weighted, and aggregated into a Composite RSI.
A Z-score transformation then measures how far each RSI deviates from its historical mean, revealing when momentum strength is statistically extreme or aligned across timeframes.
Key Features
Multi-Timeframe RSI Engine – Computes RSI across D/W/M intervals with individual weighting controls.
Adaptive Overbought/Oversold Bands – Automatically adjusts OB/OS thresholds based on rolling volatility (standard deviation of daily RSI).
Composite RSI Score – Weighted consensus RSI that represents total market momentum.
Z-Score Confluence Analysis – Identifies when all three timeframes are statistically synchronized.
Z-Composite Histogram – Displays aggregated Z-score strength around the midline (50).
Divergence Detection – Flags confirmed pivot-based bull and bear divergences on the daily RSI.
Dynamic Gradient Background – Shifts from red to green based on composite momentum regime.
Customizable Control Panel – Displays RSI values, Z-scores, state, and adaptive bands for each timeframe.
Integrated Alerts – For crossovers, risk-on/off thresholds, alignment, and Z-confluence events.
Interpretation
All RSI values above 50: multi-timeframe bullish alignment.
All RSI values below 50: multi-timeframe bearish alignment.
Composite RSI > 60: risk-on environment; momentum expansion.
Composite RSI < 45: risk-off environment; momentum contraction.
Adaptive OB/OS hits: potential exhaustion or mean reversion setup.
Green Z-ribbon: all Z-scores positive and aligned (statistical confirmation).
Red Z-ribbon: all Z-scores negative and aligned (broad market weakness).
Divergences: short-term warning signals against the prevailing momentum bias.
Practical Application
Use the Composite RSI as a global momentum gauge for position bias.
Trade only in the direction of higher-timeframe alignment (avoid countertrend RSI).
Combine Z-ribbon confirmation with Composite RSI crosses to filter noise.
Use divergence labels and adaptive thresholds for risk reduction or exit timing.
Ideal for swing traders and macro momentum models seeking trend synchronization filters.
Recommended Settings
Market Mode k-Band Lookback Use Case
Stocks / ETFs Adaptive 0.85 200 Medium-term rotation filter
Crypto Adaptive 1.00 150 Volatility-responsive swing filter
Commodities Fixed 70/30 100 Mean reversion model
Alerts Included
Daily RSI crossed above/below Weekly RSI
Composite RSI > Risk-On threshold
Composite RSI < Risk-Off threshold
All RSI aligned above/below 50
Z-Score Conformity (All positive or all negative)
Overbought/Oversold triggers
Author’s Note
This indicator was designed for research and systematic confluence analysis within Mongoose Capital Labs.
It is not financial advice and should be used in combination with independent risk assessment, volume confirmation, and higher-timeframe context.
0DTE Options - Iron Condor & ButterflyTo help options traders:
Plan and structure Iron Condor or Butterfly spreads in “Setup Mode.”
Track live trades, including P&L, breach risk, and strike distances, in “Live Mode.”
Visualize the trade on the price chart with profit zones, breakeven lines, strike markers, and alerts.
Evaluate market conditions using IV Rank, ATR-based range modeling, and modeled Delta approximation.
Essentially, it turns your TradingView chart into an options risk graph + planning terminal.
⚙️ Core Modes of Operation
🧱 1. Setup Mode
Used for planning new trades. It automatically suggests strikes based on:
ATR (volatility proxy)
IV Rank
Target Delta
Chosen risk tier (High / Mid / Low / Delta)
You can:
Preview recommended short and long strikes.
See estimated credit, width, and risk/reward ratios in a setup table.
Auto-feed these calculated strikes into the Live Mode to track them later.
Example Use:
Before market open, choose Setup Mode → Mid Risk Tier → see what strike widths and credits make sense for the day.
📈 2. Live Mode
Used to track real trades you’ve already opened.
You can:
Paste your real trade data (strikes, credits, etc.) into the 📋 paste field.
Or auto-feed from Setup Mode (if “Auto-Feed” is enabled).
The indicator then plots:
Short/long strikes
Breakevens
Profit/loss zone
Real-time breach detection and delta drift
Alerts when price nears your strikes or exits your safe zone.
Example Use:
After opening an Iron Condor on SPX, paste in 626,628,620,618,1.20,1, and the chart visually shows your safe range and warning zones.
🧮 Built-In Calculations
1. IV Rank (Volatility Environment)
Uses a 20-day log return volatility model to calculate IV Rank (percentile of volatility over the last 252 bars).
You can use this automatically or manually override it if you have data from your broker.
→ High IV Rank (>50) = better for selling Iron Condors (more premium).
2. ATR (Average True Range)
Measures short-term volatility to estimate expected daily price movement.
Used in Setup Mode to model distance between strikes.
3. Strike Calculations (Setup Mode)
Based on risk tier:
High Risk → wide wings, high credit, high potential drawdown
Mid Risk → balanced setup
Low Risk → narrow wings, safer but less credit
Delta Mode → based purely on target delta (e.g., 0.20)
Uses ATR × multiplier to determine how far short strikes should be from current price.
4. Credit Estimation
Based on strike width × IV Rank multiplier:
IV > 50 → 30% of width
IV 30–50 → 25%
IV < 30 → 20%
5. Profit & Loss Modeling
The indicator computes:
Max Profit:
Iron Condor → credit × 100 × contracts
Butterfly → (wing width − debit) × 100 × contracts
Max Loss:
Iron Condor → width − credit
Butterfly → debit × 100 × contracts
Breakevens:
Iron Condor → short strikes ± credit
Butterfly → body ± debit
Current P&L: Approximated by where the underlying is relative to the short/long strikes.
6. Delta Modeling
Estimates each short strike’s modeled delta based on how far it is from current price.
Displays total delta balance to show directional bias.
If Delta drifts too high → market imbalance → consider rolling or adjusting.
7. Breach Detection System
Automatically classifies your trade as:
🟢 In Range: Price between short strikes (safe zone).
🟠 Near Breach: Price close to short strike (risk zone).
🔴 Breached: Price outside long strike (stop or adjust zone).
This dynamically changes color in your profit box and info label.
🎨 Visual Components
Element Meaning Color
Red Line Put side strikes 🔻 Red
Green Line Call side strikes 🔺 Green
Yellow Dotted Lines Breakevens 🟡 Yellow
Green Box Profit zone 🟩 Light green
Orange Box Adjustment zone (near breach) 🟧 Orange
Red Box Breach zone 🟥 Red
White Line Current price ⚪ White
Optional labels display strike details and distances (e.g., “📉 Short Put: 620 – 5 pts away”).
📊 Setup Table (Setup Mode Only)
Displays a grid comparing all risk tiers:
Tier Short Call Short Put Width Est. Credit R:R
High 632 614 4.0 $1.20 0.43
Mid 630 616 3.0 $0.90 0.43
Low 628 618 2.0 $0.60 0.43
Highlighted row = selected risk tier.
This lets you compare how wide/narrow each setup is before committing to a trade.
🧾 Info Box (Live Mode)
Displays real-time stats such as:
🔶 IRON CONDOR | 1 Contract
📊 Calls: 626 / 628 | Puts: 620 / 618
💵 Credit: $1.20 | 💰 Profit: $120 | 🔴 Loss: $180
⬆️ BE: 627.2 | ⬇️ BE: 618.8
📍 Current: $623 | 💵 P&L: +$35.00 (+29.1%)
📏 To Short Call: 3 | To Short Put: 3
📊 Delta: 0.05 | IV Rank: 56% (FAVORABLE)
🔴 BREACH STATUS: In Range
🚨 Alerts
The indicator generates TradingView alerts for:
⚠️ Approaching Call Zone → nearing short call
⚠️ Approaching Put Zone → nearing short put
🛑 Stop Loss Triggered → current P&L exceeds loss threshold
🟠 Near Breach → price entering adjustment zone
🔴 Breached → price outside protection (long strikes)
These alerts can be used with TradingView notifications or webhooks.
🧠 How to Use It Step-by-Step
A. Planning (Setup Mode)
Set mode to “Setup.”
Adjust:
Risk Tier (High / Mid / Low / Delta)
Target Delta (0.15–0.30 recommended)
Strike Interval (e.g., 1.0 or 5.0)
Check Setup Table → see suggested strikes & credits.
Optionally toggle Auto-Feed → Live to send to live mode later.
B. Executing (Broker)
Confirm and enter your trade in your brokerage (use the strikes shown).
Record your strikes, net credit/debit, and number of contracts.
C. Tracking (Live Mode)
Switch to “Live” mode.
Paste your strikes in the 📋 Paste Data field:
Iron Condor Example: 626,628,620,618,1.20,1
Butterfly Example: 600,620,640,2.50,2
The chart updates:
Lines = your strikes
Boxes = profit/risk zones
Labels = strike info, distance to price
Info box = P&L, delta, IV rank, breach status
Set alerts for automatic notifications.
D. Managing the Trade
When the chart turns orange or red, you’re approaching or breaching a strike.
Use this signal to roll, hedge, or close your trade.
Monitor Gamma Risk: warning appears when price nears short strikes (explosive delta risk).
📌 Summary
Feature Description
Mode Switching Plan (Setup) or Track (Live)
IV Rank & ATR Modeling Estimates volatility environment
Auto Strike Planning Suggests strikes based on risk/delta
Visual Range Map Profit, breakeven, and adjustment zones
Real-Time Alerts Warns when nearing or breaching strikes
Trade Info Box Displays live risk, reward, delta, IV, and P&L
Setup Table Compares setups across risk tiers
Fully Configurable Works for Iron Condors or Butterflies
Iron Condor & Butterfly VisualizerIt helps you visualize and manage your option spread by:
Plotting strike prices and breakeven lines directly on the chart.
Showing profit/loss zones, adjustment zones, and alerts when price nears critical levels.
Calculating risk/reward, probability of profit, theta decay, IV condition, and trade score.
🎯 2. Inputs & Configuration
You input your trade details as a comma-separated string:
For an Iron Condor
ShortCall, LongCall, ShortPut, LongPut, Credit, Contracts, Target%
Example: 626,628,620,618,1.20,1,30
For a Butterfly Spread
LowerWing, Body, UpperWing, Debit, Contracts, Target%
Example: 600,620,640,2.50,2,50
The indicator automatically parses this and knows which strategy type you selected.
You can also control:
Visuals (profit zones, breakevens, labels)
Risk (stop loss %, adjustment zones)
Account/risk sizing
Market conditions (IV Rank, current IV, DTE)
⚙️ 3. Data Parsing & Strategy Recognition
The code reads your pasted string, splits it by commas, and determines:
Which strikes are short vs long (or wings/body for Butterfly)
Whether the strategy is credit (Iron Condor) or debit (Butterfly)
Calculates net credit/debit, contract size, and profit target
📈 4. Profit/Loss Calculations
It dynamically calculates:
Max Profit
Iron Condor: net credit × 100 × contracts
Butterfly: (wing width − debit) × 100 × contracts
Max Loss
Iron Condor: difference between strikes minus credit
Butterfly: debit × 100 × contracts
Breakeven points
Iron Condor: short strikes ± net credit
Butterfly: body ± debit
Current P&L relative to the live price (close).
⚖️ 5. Risk & Position Sizing
It checks:
Stop-loss trigger (% of max loss)
Adjustment alert if price nears short strikes
Recommended contract size based on account size and % risk per trade
Actual % of account at risk
⏱️ 6. Time Decay & IV Analysis
If you input days to expiration, it shows:
Theta (approx daily time decay)
Decay progress bar (% of 30-day cycle)
IV condition:
Green: favorable (>50 IV Rank)
Yellow: neutral (30–50)
Red: poor (<30)
🧮 7. Trade Scoring
It gives a Trade Score (0–100) based on:
IV Rank (favorable market)
Risk/Reward ratio
Probability of profit
Default 20 baseline points
This helps gauge whether the setup is statistically attractive.
🧠 8. Visualizations
When the indicator runs, it draws on your chart:
Lines
Red = short strikes
Orange dashed = long strikes
Yellow dotted = breakeven levels
Boxes
Green = profit zone
Orange shaded = adjustment zones (approaching danger)
Labels (optional)
Strike labels (call/put prices)
Info box summarizing:
Profit, loss, risk/reward
Breakevens, theta, target, gamma risk flag
🚨 9. Alerts
The script triggers TradingView alerts when:
Price nears call or put adjustment zones
Profit target is hit
Stop loss is hit
These help you manage the trade without constant monitoring.
🧭 10. In Practice
You’d:
Copy the option strikes and trade details from your broker or analyzer.
Paste them into 📋 PASTE YOUR TRADE DATA HERE.
The indicator plots:
Profit/loss region
Adjustment warnings
Key metrics
Alerts if your trade is in danger or near target.
Multi SMA + Golden/Death + Heatmap + BB**Multi SMA (50/100/200) + Golden/Death + Candle Heatmap + BB**
A practical trend toolkit that blends classic 50/100/200 SMAs with clear crossover labels, special 🚀 Golden / 💀 Death Cross markers, and a readable candle heatmap based on a dynamic regression midline and volatility bands. Optional Bollinger Bands are included for context.
* See trend direction at a glance with SMAs.
* Get minimal, de-cluttered labels on important crosses (50↔100, 50↔200, 100↔200).
* Highlight big regime shifts with special Golden/Death tags.
* Read momentum and volatility with the candle heatmap.
* Add Bollinger Bands if you want classic mean-reversion context.
Designed to be lightweight, non-repainting on confirmed bars, and flexible across timeframes.
# What This Indicator Does (plain English)
* **Tracks trend** using **SMA 50/100/200** and lets you optionally compute each SMA on a higher or different timeframe (HTF-safe, no lookahead).
* **Prints labels** when SMAs cross each other (up or down). You can force signals only after bar close to avoid repaint.
* **Marks Golden/Death Crosses** (50 over/under 200) with special labels so major regime changes stand out.
* **Colors candles** with a **heatmap** built from a regression midline and volatility bands—greenish above, reddish below, with a smooth gradient.
* **Optionally shows Bollinger Bands** (basis SMA + stdev bands) and fills the area between them.
* **Includes alert conditions** for Golden and Death Cross so you can automate notifications.
---
# Settings — Simple Explanations
## Source
* **Source**: Price source used to calculate SMAs and Bollinger basis. Default: `close`.
## SMA 50
* **Show 50**: Turn the SMA(50) line on/off.
* **Length 50**: How many bars to average. Lower = faster but noisier.
* **Color 50** / **Width 50**: Visual style.
* **Timeframe 50**: Optional alternate timeframe for SMA(50). Leave empty to use the chart timeframe.
## SMA 100
* **Show 100**: Turn the SMA(100) line on/off.
* **Length 100**: Bars used for the mid-term trend.
* **Color 100** / **Width 100**: Visual style.
* **Timeframe 100**: Optional alternate timeframe for SMA(100).
## SMA 200
* **Show 200**: Turn the SMA(200) line on/off.
* **Length 200**: Bars used for the long-term trend.
* **Color 200** / **Width 200**: Visual style.
* **Timeframe 200**: Optional alternate timeframe for SMA(200).
## Signals (crossover labels)
* **Show crossover signals**: Prints triangle labels on SMA crosses (50↔100, 50↔200, 100↔200).
* **Wait for bar close (confirmed)**: If ON, signals only appear after the candle closes (reduces repaint).
* **Min bars between same-pair signals**: Minimum spacing to avoid duplicate labels from the same SMA pair too often.
* **Trend filter (buy: 50>100>200, sell: 50<100<200)**: Only show bullish labels when SMAs are stacked bullish (50 above 100 above 200), and only show bearish labels when stacked bearish.
### Label Offset
* **Offset mode**: Choose how to push labels away from price:
* **Percent**: Offset is a % of price.
* **ATR x**: Offset is ATR(14) × multiplier.
* **Percent of price (%)**: Used when mode = Percent.
* **ATR multiplier (for ‘ATR x’)**: Used when mode = ATR x.
### Label Colors
* **Bull color** / **Bear color**: Background of triangle labels.
* **Bull label text color** / **Bear label text color**: Text color inside the triangles.
## Golden / Death Cross
* **Show 🚀 Golden Cross (50↑200)**: Show a special “Golden” label when SMA50 crosses above SMA200.
* **Golden label color** / **Golden text color**: Styling for Golden label.
* **Show 💀 Death Cross (50↓200)**: Show a special “Death” label when SMA50 crosses below SMA200.
* **Death label color** / **Death text color**: Styling for Death label.
## Candle Heatmap
* **Enable heatmap candle colors**: Turns the heatmap on/off.
* **Length**: Lookback for the regression midline and volatility measure.
* **Deviation Multiplier**: Band width around the midline (bigger = wider).
* **Volatility basis**:
* **RMA Range** (smoothed high-low range)
* **Stdev** (standard deviation of close)
* **Upper/Middle/Lower color**: Gradient colors for the heatmap.
* **Heatmap transparency (0..100)**: 0 = solid, 100 = invisible.
* **Force override base candles**: Repaint base candles so heatmap stays visible even if your chart has custom coloring.
## Bollinger Bands (optional)
* **Show Bollinger Bands**: Toggle the overlay on/off.
* **Length**: Basis SMA length.
* **StdDev Multiplier**: Distance of bands from the basis in standard deviations.
* **Basis color** / **Band color**: Line colors for basis and bands.
* **Bands fill transparency**: Opacity of the fill between upper/lower bands.
---
# Features & How It Works
## 1) HTF-Safe SMAs
Each SMA can be calculated on the chart timeframe or a higher/different timeframe you choose. The script pulls HTF values **without lookahead** (non-repainting on confirmed bars).
## 2) Crossover Labels (Three Pairs)
* **50↔100**, **50↔200**, **100↔200**:
* **Triangle Up** label when the first SMA crosses **above** the second.
* **Triangle Down** label when it crosses **below**.
* Optional **Trend Filter** ensures only signals aligned with the overall stack (50>100>200 for bullish, 50<100<200 for bearish).
* **Debounce** spacing avoids repeated labels for the same pair too close together.
## 3) Golden / Death Cross Highlights
* **🚀 Golden Cross**: SMA50 crosses **above** SMA200 (often a longer-term bullish regime shift).
* **💀 Death Cross**: SMA50 crosses **below** SMA200 (often a longer-term bearish regime shift).
* Separate styling so they stand out from regular cross labels.
## 4) Candle Heatmap
* Builds a **regression midline** with **volatility bands**; colors candles by their position inside that channel.
* Smooth gradient: lower side → reddish, mid → yellowish, upper side → greenish.
* Helps you see momentum and “where price sits” relative to a dynamic channel.
## 5) Bollinger Bands (Optional)
* Classic **basis SMA** ± **StdDev** bands.
* Light visual context for mean-reversion and volatility expansion.
## 6) Alerts
* **Golden Cross**: `🚀 GOLDEN CROSS: SMA 50 crossed ABOVE SMA 200`
* **Death Cross**: `💀 DEATH CROSS: SMA 50 crossed BELOW SMA 200`
Add these to your alerts to get notified automatically.
---
# Tips & Notes
* For fewer false positives, keep **“Wait for bar close”** ON, especially on lower timeframes.
* Use the **Trend Filter** to align signals with the broader stack and cut noise.
* For HTF context, set **Timeframe 50/100/200** to higher frames (e.g., H1/H4/D) while you trade on a lower frame.
* Heatmap “Length” and “Deviation Multiplier” control smoothness and channel width—tune for your asset’s volatility.
RSI Overbought/Oversold + Divergence Indicator (new)//@version=5
indicator('CryptoSignalScanner - RSI Overbought/Oversold + Divergence Indicator (new)',
//---------------------------------------------------------------------------------------------------------------------------------
//--- Define Colors ---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------
vWhite = #FFFFFF
vViolet = #C77DF3
vIndigo = #8A2BE2
vBlue = #009CDF
vGreen = #5EBD3E
vYellow = #FFB900
vRed = #E23838
longColor = color.green
shortColor = color.red
textColor = color.white
bullishColor = color.rgb(38,166,154,0) //Used in the display table
bearishColor = color.rgb(239,83,79,0) //Used in the display table
nomatchColor = color.silver //Used in the display table
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Functions--------------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
TF2txt(TF) =>
switch TF
"S" => "RSI 1s:"
"5S" => "RSI 5s:"
"10S" => "RSI 10s:"
"15S" => "RSI 15s:"
"30S" => "RSI 30s"
"1" => "RSI 1m:"
"3" => "RSI 3m:"
"5" => "RSI 5m:"
"15" => "RSI 15m:"
"30" => "RSI 30m"
"45" => "RSI 45m"
"60" => "RSI 1h:"
"120" => "RSI 2h:"
"180" => "RSI 3h:"
"240" => "RSI 4h:"
"480" => "RSI 8h:"
"D" => "RSI 1D:"
"1D" => "RSI 1D:"
"2D" => "RSI 2D:"
"3D" => "RSI 2D:"
"3D" => "RSI 3W:"
"W" => "RSI 1W:"
"1W" => "RSI 1W:"
"M" => "RSI 1M:"
"1M" => "RSI 1M:"
"3M" => "RSI 3M:"
"6M" => "RSI 6M:"
"12M" => "RSI 12M:"
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Show/Hide Settings ----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiShowInput = input(true, title='Show RSI', group='Show/Hide Settings')
maShowInput = input(false, title='Show MA', group='Show/Hide Settings')
showRSIMAInput = input(true, title='Show RSIMA Cloud', group='Show/Hide Settings')
rsiBandShowInput = input(true, title='Show Oversold/Overbought Lines', group='Show/Hide Settings')
rsiBandExtShowInput = input(true, title='Show Oversold/Overbought Extended Lines', group='Show/Hide Settings')
rsiHighlightShowInput = input(true, title='Show Oversold/Overbought Highlight Lines', group='Show/Hide Settings')
DivergenceShowInput = input(true, title='Show RSI Divergence Labels', group='Show/Hide Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Table Settings --------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiShowTable = input(true, title='Show RSI Table Information box', group="RSI Table Settings")
rsiTablePosition = input.string(title='Location', defval='middle_right', options= , group="RSI Table Settings", inline='1')
rsiTextSize = input.string(title=' Size', defval='small', options= , group="RSI Table Settings", inline='1')
rsiShowTF1 = input(true, title='Show TimeFrame1', group="RSI Table Settings", inline='tf1')
rsiTF1 = input.timeframe("15", title=" Time", group="RSI Table Settings", inline='tf1')
rsiShowTF2 = input(true, title='Show TimeFrame2', group="RSI Table Settings", inline='tf2')
rsiTF2 = input.timeframe("60", title=" Time", group="RSI Table Settings", inline='tf2')
rsiShowTF3 = input(true, title='Show TimeFrame3', group="RSI Table Settings", inline='tf3')
rsiTF3 = input.timeframe("240", title=" Time", group="RSI Table Settings", inline='tf3')
rsiShowTF4 = input(true, title='Show TimeFrame4', group="RSI Table Settings", inline='tf4')
rsiTF4 = input.timeframe("D", title=" Time", group="RSI Table Settings", inline='tf4')
rsiShowHist = input(true, title='Show RSI Historical Columns', group="RSI Table Settings", tooltip='Show the information of the 2 previous closed candles')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- RSI Input Settings ----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiSourceInput = input.source(close, 'Source', group='RSI Settings')
rsiLengthInput = input.int(14, minval=1, title='RSI Length', group='RSI Settings', tooltip='Here we set the RSI lenght')
rsiColorInput = input.color(#26a69a, title="RSI Color", group='RSI Settings')
rsimaColorInput = input.color(#ef534f, title="RSIMA Color", group='RSI Settings')
rsiBandColorInput = input.color(#787B86, title="RSI Band Color", group='RSI Settings')
rsiUpperBandExtInput = input.int(title='RSI Overbought Extended Line', defval=80, minval=50, maxval=100, group='RSI Settings')
rsiUpperBandInput = input.int(title='RSI Overbought Line', defval=70, minval=50, maxval=100, group='RSI Settings')
rsiLowerBandInput = input.int(title='RSI Oversold Line', defval=30, minval=0, maxval=50, group='RSI Settings')
rsiLowerBandExtInput = input.int(title='RSI Oversold Extended Line', defval=20, minval=0, maxval=50, group='RSI Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- MA Input Settings -----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
maTypeInput = input.string("EMA", title="MA Type", options= , group="MA Settings")
maLengthInput = input.int(14, title="MA Length", group="MA Settings")
maColorInput = input.color(color.yellow, title="MA Color", group='MA Settings') //#7E57C2
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Divergence Input Settings ---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
lbrInput = input(title="Pivot Lookback Right", defval=2, group='RSI Divergence Settings')
lblInput = input(title="Pivot Lookback Left", defval=2, group='RSI Divergence Settings')
lbRangeMaxInput = input(title="Max of Lookback Range", defval=10, group='RSI Divergence Settings')
lbRangeMinInput = input(title="Min of Lookback Range", defval=2, group='RSI Divergence Settings')
plotBullInput = input(title="Plot Bullish", defval=true, group='RSI Divergence Settings')
plotHiddenBullInput = input(title="Plot Hidden Bullish", defval=true, group='RSI Divergence Settings')
plotBearInput = input(title="Plot Bearish", defval=true, group='RSI Divergence Settings')
plotHiddenBearInput = input(title="Plot Hidden Bearish", defval=true, group='RSI Divergence Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- RSI Calculation -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsi = ta.rsi(rsiSourceInput, rsiLengthInput)
rsiprevious = rsi
= request.security(syminfo.tickerid, rsiTF1, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, rsiTF2, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, rsiTF3, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, rsiTF4, [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- MA Calculation -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
ma(source, length, type) =>
switch type
"SMA" => ta.sma(source, length)
"Bollinger Bands" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
rsiMA = ma(rsi, maLengthInput, maTypeInput)
rsiMAPrevious = rsiMA
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Stoch RSI Settings + Calculation --------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
showStochRSI = input(false, title="Show Stochastic RSI", group='Stochastic RSI Settings')
smoothK = input.int(title="Stochastic K", defval=3, minval=1, maxval=10, group='Stochastic RSI Settings')
smoothD = input.int(title="Stochastic D", defval=4, minval=1, maxval=10, group='Stochastic RSI Settings')
lengthRSI = input.int(title="Stochastic RSI Lenght", defval=14, minval=1, group='Stochastic RSI Settings')
lengthStoch = input.int(title="Stochastic Lenght", defval=14, minval=1, group='Stochastic RSI Settings')
colorK = input.color(color.rgb(41,98,255,0), title="K Color", group='Stochastic RSI Settings', inline="1")
colorD = input.color(color.rgb(205,109,0,0), title="D Color", group='Stochastic RSI Settings', inline="1")
StochRSI = ta.rsi(rsiSourceInput, lengthRSI)
k = ta.sma(ta.stoch(StochRSI, StochRSI, StochRSI, lengthStoch), smoothK) //Blue Line
d = ta.sma(k, smoothD) //Red Line
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Divergence Settings ------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
bearColor = color.red
bullColor = color.green
hiddenBullColor = color.new(color.green, 50)
hiddenBearColor = color.new(color.red, 50)
//textColor = color.white
noneColor = color.new(color.white, 100)
osc = rsi
plFound = na(ta.pivotlow(osc, lblInput, lbrInput)) ? false : true
phFound = na(ta.pivothigh(osc, lblInput, lbrInput)) ? false : true
_inRange(cond) =>
bars = ta.barssince(cond == true)
lbRangeMinInput <= bars and bars <= lbRangeMaxInput
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Define Plot & Line Colors ---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiColor = rsi >= rsiMA ? rsiColorInput : rsimaColorInput
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Plot Lines ------------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Create a horizontal line at a specific price level
myLine = line.new(bar_index , 75, bar_index, 75, color = color.rgb(187, 14, 14), width = 2)
bottom = line.new(bar_index , 50, bar_index, 50, color = color.rgb(223, 226, 28), width = 2)
mymainLine = line.new(bar_index , 60, bar_index, 60, color = color.rgb(13, 154, 10), width = 3)
hline(50, title='RSI Baseline', color=color.new(rsiBandColorInput, 50), linestyle=hline.style_solid, editable=false)
hline(rsiBandExtShowInput ? rsiUpperBandExtInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
hline(rsiBandShowInput ? rsiUpperBandInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
hline(rsiBandShowInput ? rsiLowerBandInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
hline(rsiBandExtShowInput ? rsiLowerBandExtInput : na, title='RSI Upper Band', color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
bgcolor(rsiHighlightShowInput ? rsi >= rsiUpperBandExtInput ? color.new(rsiColorInput, 70) : na : na, title="Show Extended Oversold Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi >= rsiUpperBandInput ? rsi < rsiUpperBandExtInput ? color.new(#64ffda, 90) : na : na: na, title="Show Overbought Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi <= rsiLowerBandInput ? rsi > rsiLowerBandExtInput ? color.new(#F43E32, 90) : na : na : na, title="Show Extended Oversold Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi <= rsiLowerBandInput ? color.new(rsimaColorInput, 70) : na : na, title="Show Oversold Highlight", editable=false)
maPlot = plot(maShowInput ? rsiMA : na, title='MA', color=color.new(maColorInput,0), linewidth=1)
rsiMAPlot = plot(showRSIMAInput ? rsiMA : na, title="RSI EMA", color=color.new(rsimaColorInput,0), editable=false, display=display.none)
rsiPlot = plot(rsiShowInput ? rsi : na, title='RSI', color=color.new(rsiColor,0), linewidth=1)
fill(rsiPlot, rsiMAPlot, color=color.new(rsiColor, 60), title="RSIMA Cloud")
plot(showStochRSI ? k : na, title='Stochastic K', color=colorK, linewidth=1)
plot(showStochRSI ? d : na, title='Stochastic D', color=colorD, linewidth=1)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Plot Divergence -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Regular Bullish
// Osc: Higher Low
oscHL = osc > ta.valuewhen(plFound, osc , 1) and _inRange(plFound )
// Price: Lower Low
priceLL = low < ta.valuewhen(plFound, low , 1)
bullCond = plotBullInput and priceLL and oscHL and plFound
plot(
plFound ? osc : na,
offset=-lbrInput,
title="Regular Bullish",
linewidth=2,
color=(bullCond ? bullColor : noneColor)
)
plotshape(
DivergenceShowInput ? bullCond ? osc : na : na,
offset=-lbrInput,
title="Regular Bullish Label",
text=" Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor
)
//------------------------------------------------------------------------------
// Hidden Bullish
// Osc: Lower Low
oscLL = osc < ta.valuewhen(plFound, osc , 1) and _inRange(plFound )
// Price: Higher Low
priceHL = low > ta.valuewhen(plFound, low , 1)
hiddenBullCond = plotHiddenBullInput and priceHL and oscLL and plFound
plot(
plFound ? osc : na,
offset=-lbrInput,
title="Hidden Bullish",
linewidth=2,
color=(hiddenBullCond ? hiddenBullColor : noneColor)
)
plotshape(
DivergenceShowInput ? hiddenBullCond ? osc : na : na,
offset=-lbrInput,
title="Hidden Bullish Label",
text=" H Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor
)
//------------------------------------------------------------------------------
// Regular Bearish
// Osc: Lower High
oscLH = osc < ta.valuewhen(phFound, osc , 1) and _inRange(phFound )
// Price: Higher High
priceHH = high > ta.valuewhen(phFound, high , 1)
bearCond = plotBearInput and priceHH and oscLH and phFound
plot(
phFound ? osc : na,
offset=-lbrInput,
title="Regular Bearish",
linewidth=2,
color=(bearCond ? bearColor : noneColor)
)
plotshape(
DivergenceShowInput ? bearCond ? osc : na : na,
offset=-lbrInput,
title="Regular Bearish Label",
text=" Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor
)
//------------------------------------------------------------------------------
// Hidden Bearish
// Osc: Higher High
oscHH = osc > ta.valuewhen(phFound, osc , 1) and _inRange(phFound )
// Price: Lower High
priceLH = high < ta.valuewhen(phFound, high , 1)
hiddenBearCond = plotHiddenBearInput and priceLH and oscHH and phFound
plot(
phFound ? osc : na,
offset=-lbrInput,
title="Hidden Bearish",
linewidth=2,
color=(hiddenBearCond ? hiddenBearColor : noneColor)
)
plotshape(
DivergenceShowInput ? hiddenBearCond ? osc : na : na,
offset=-lbrInput,
title="Hidden Bearish Label",
text=" H Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor
)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Check RSI Lineup ------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
bullTF = rsi > rsi and rsi > rsi
bearTF = rsi < rsi and rsi < rsi
bullTF1 = rsi1 > rsi1_1 and rsi1_1 > rsi1_2
bearTF1 = rsi1 < rsi1_1 and rsi1_1 < rsi1_2
bullTF2 = rsi2 > rsi2_1 and rsi2_1 > rsi2_2
bearTF2 = rsi2 < rsi2_1 and rsi2_1 < rsi2_2
bullTF3 = rsi3 > rsi3_1 and rsi3_1 > rsi3_2
bearTF3 = rsi3 < rsi3_1 and rsi3_1 < rsi3_2
bullTF4 = rsi4 > rsi4_1 and rsi4_1 > rsi4_2
bearTF4 = rsi4 < rsi4_1 and rsi4_1 < rsi4_2
bbTxt(bull,bear) =>
bull ? "BULLISH" : bear ? "BEARISCH" : 'NO LINEUP'
bbColor(bull,bear) =>
bull ? bullishColor : bear ? bearishColor : nomatchColor
newTC(tBox, col, row, txt, width, txtColor, bgColor, txtHA, txtSize) =>
table.cell(table_id=tBox,column=col, row=row, text=txt, width=width,text_color=txtColor,bgcolor=bgColor, text_halign=txtHA, text_size=txtSize)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Define RSI Table Setting ----------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
width_c0 = 0
width_c1 = 0
if rsiShowTable
var tBox = table.new(position=rsiTablePosition, columns=5, rows=6, bgcolor=color.rgb(18,22,33,50), frame_color=color.black, frame_width=1, border_color=color.black, border_width=1)
newTC(tBox, 0,1,"RSI Current",width_c0,color.orange,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,1,str.format(" {0,number,#.##} ", rsi),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,1,bbTxt(bullTF, bearTF),width_c0,vWhite,bbColor(bullTF, bearTF),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,1,str.format(" {0,number,#.##} ", rsi ),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,1,str.format(" {0,number,#.##} ", rsi ),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF1
newTC(tBox, 0,2,TF2txt(rsiTF1),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,2,str.format(" {0,number,#.##} ", rsi1),width_c0,vWhite,rsi1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,2,bbTxt(bullTF1, bearTF1),width_c0,vWhite,bbColor(bullTF1,bearTF1),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,2,str.format(" {0,number,#.##} ", rsi1_1),width_c0,vWhite,rsi1_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,2,str.format(" {0,number,#.##} ", rsi1_2),width_c0,vWhite,rsi1_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF2
newTC(tBox, 0,3,TF2txt(rsiTF2),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,3,str.format(" {0,number,#.##} ", rsi2),width_c0,vWhite,rsi2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,3,bbTxt(bullTF2, bearTF2),width_c0,vWhite,bbColor(bullTF2,bearTF2),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,3,str.format(" {0,number,#.##} ", rsi2_1),width_c0,vWhite,rsi2_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,3,str.format(" {0,number,#.##} ", rsi2_2),width_c0,vWhite,rsi2_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF3
newTC(tBox, 0,4,TF2txt(rsiTF3),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,4,str.format(" {0,number,#.##} ", rsi3),width_c0,vWhite,rsi3 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,4,bbTxt(bullTF3, bearTF3),width_c0,vWhite,bbColor(bullTF3,bearTF3),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,4,str.format(" {0,number,#.##} ", rsi3_1),width_c0,vWhite,rsi3_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,4,str.format(" {0,number,#.##} ", rsi3_2),width_c0,vWhite,rsi3_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
if rsiShowTF4
newTC(tBox, 0,5,TF2txt(rsiTF4),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
newTC(tBox, 1,5,str.format(" {0,number,#.##} ", rsi4),width_c0,vWhite,rsi4 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 4,5,bbTxt(bullTF4, bearTF4),width_c0,vWhite,bbColor(bullTF4,bearTF4),'center',rsiTextSize)
if rsiShowHist
newTC(tBox, 2,5,str.format(" {0,number,#.##} ", rsi4_1),width_c0,vWhite,rsi4_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
newTC(tBox, 3,5,str.format(" {0,number,#.##} ", rsi4_2),width_c0,vWhite,rsi4_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
//------------------------------------------------------
//--- Alerts -------------------------------------------
//------------------------------------------------------
Breadth Indicators NYSE Percent Above Moving AverageBreadth Indicators NYSE - transmits the processed data from the Barchart provider
NYSE - Breadth Indicators
S&P 500 - Breadth Indicators
DOW - Breadth Indicators
RUSSEL 1000 - Breadth Indicators
RUSSEL 2000 - Breadth Indicators
RUSSEL 3000 - Breadth Indicators
Moving Average - 5, 20, 50, 100, 150, 200
The "Percentage above 50-day SMA" indicator measures the percentage of stocks in the index trading above their 50-day moving average. It is a useful tool for assessing the general state of the market and identifying overbought and oversold conditions.
One way to use the "Percentage above 50-day SMA" indicator in a trading strategy is to combine it with a long-term moving average to determine whether the trend is bullish or bearish. Another way to use it is to combine it with a short-term moving average to identify pullbacks and rebounds within the overall trend.
The purpose of using the "Percentage above 50-day SMA" indicator is to participate in a larger trend with a better risk-reward ratio. By using this indicator to identify pullbacks and bounces, you can reduce the risk of entering trades at the wrong time.
Bull Signal Recap:
150-day EMA of $SPXA50R crosses above 52.5 and remains above 47.50 to set the bullish tone.
5-day EMA of $SPXA50R moves below 40 to signal a pullback
5-day EMA of $SPXA50R moves above 50 to signal an upturn
Bear Signal Recap:
150-day EMA of $SPXA50R crosses below 47.50 and remains below 52.50 to set the bearish tone.
5-day EMA of $SPXA50R moves above 60 to signal a bounce
5-day EMA of $SPXA50R moves below 50 to signal a downturn
Tweaking
There are numerous ways to tweak a trading system, but chartists should avoid over-optimizing the indicator settings. In other words, don't attempt to find the perfect moving average period or crossover level. Perfection is unattainable when developing a system or trading the markets. It is important to keep the system logical and focus tweaks on other aspects, such as the actual price chart of the underlying security.
What do levels above and below 50% signify in the long-term moving average?
A move above 52.5% is deemed bullish, and below 47.5% is deemed bearish. These levels help to reduce whipsaws by using buffers for bullish and bearish thresholds.
How does the short-term moving average work to identify pullbacks or bounces?
When using a 5-day EMA, a move below 40 signals a pullback, and a move above 60 signals a bounce.
How is the reversal of pullback or bounce identified?
A move back above 50 after a pullback or below 50 after a bounce signals that the respective trend may be resuming.
How can you ensure that the uptrend has resumed?
It’s important to wait for the surge above 50 to ensure the uptrend has resumed, signaling improved breadth.
Can the system be tweaked to optimize indicator settings?
While there are various ways to tweak the system, seeking perfection through over-optimizing settings is advised against. It's crucial to keep the system logical and focus tweaks on the price chart of the underlying security.
RUSSIAN \ Русская версия.
Индикатор "Процент выше 50-дневной скользящей средней" измеряет процент акций, торгующихся в индексе выше их 50-дневной скользящей средней. Это полезный инструмент для оценки общего состояния рынка и выявления условий перекупленности и перепроданности.
Один из способов использования индикатора "Процент выше 50-дневной скользящей средней" в торговой стратегии - это объединить его с долгосрочной скользящей средней, чтобы определить, является ли тренд бычьим или медвежьим. Другой способ использовать его - объединить с краткосрочной скользящей средней, чтобы выявить откаты и отскоки в рамках общего тренда.
Цель использования индикатора "Процент выше 50-дневной скользящей средней" - участвовать в более широком тренде с лучшим соотношением риска и прибыли. Используя этот индикатор для выявления откатов и отскоков, вы можете снизить риск входа в сделки в неподходящее время.
Краткое описание бычьего сигнала:
150-дневная ЕМА на уровне $SPXA50R пересекает отметку 52,5 и остается выше 47,50, что задает бычий настрой.
5-дневная ЕМА на уровне $SPXA50R опускается ниже 40, сигнализируя об откате
5-дневная ЕМА на уровне $SPXA50R поднимается выше 50, сигнализируя о росте
Обзор медвежьих сигналов:
150-дневная ЕМА на уровне $SPXA50R пересекает уровень ниже 47,50 и остается ниже 52,50, что указывает на медвежий настрой.
5-дневная ЕМА на уровне $SPXA50R поднимается выше 60, сигнализируя о отскоке
5-дневная ЕМА на уровне $SPXA50 опускается ниже 50, что сигнализирует о спаде
Корректировка
Существует множество способов настроить торговую систему, но графологам следует избегать чрезмерной оптимизации настроек индикатора. Другими словами, не пытайтесь найти идеальный период скользящей средней или уровень пересечения. Совершенство недостижимо при разработке системы или торговле на рынках. Важно поддерживать логику системы и уделять особое внимание другим аспектам, таким как график фактической цены базовой ценной бумаги.
Что означают уровни выше и ниже 50% в долгосрочной скользящей средней?
Движение выше 52,5% считается бычьим, а ниже 47,5% - медвежьим. Эти уровни помогают снизить риски, используя буферы для бычьих и медвежьих порогов.
Как краткосрочная скользящая средняя помогает идентифицировать откаты или отскоки?
При использовании 5-дневной ЕМА движение ниже 40 указывает на откат, а движение выше 60 указывает на отскок.
Как определяется разворот отката или отскока?
Движение выше 50 после отката или ниже 50 после отскока сигнализирует о возможном возобновлении соответствующего тренда.
Как вы можете гарантировать, что восходящий тренд возобновился?
Важно дождаться скачка выше 50, чтобы убедиться в возобновлении восходящего тренда, сигнализирующего о расширении диапазона.
Можно ли настроить систему для оптимизации настроек индикатора?
Хотя существуют различные способы настройки системы, не рекомендуется стремиться к совершенству с помощью чрезмерной оптимизации настроек. Крайне важно сохранить логичность системы и сфокусировать изменения на ценовом графике базовой ценной бумаги.
Parameter Free RSI [InvestorUnknown]The Parameter Free RSI (PF-RSI) is an innovative adaptation of the traditional Relative Strength Index (RSI), a widely used momentum oscillator that measures the speed and change of price movements. Unlike the standard RSI, which relies on a fixed lookback period (typically 14), the PF-RSI dynamically adjusts its calculation length based on real-time market conditions. By incorporating volatility and the RSI's deviation from its midpoint (50), this indicator aims to provide a more responsive and adaptable tool for identifying overbought/oversold conditions, trend shifts, and momentum changes. This adaptability makes it particularly valuable for traders navigating diverse market environments, from trending to ranging conditions.
PF-RSI offers a suite of customizable features, including dynamic length variants, smoothing options, visualization tools, and alert conditions.
Key Features
1. Dynamic RSI Length Calculation
The cornerstone of the PF-RSI is its ability to adjust the RSI calculation period dynamically, eliminating the need for a static parameter. The length is computed using two primary factors:
Volatility: Measured via the standard deviation of past RSI values.
Distance from Midpoint: The absolute deviation of the RSI from 50, reflecting the strength of bullish or bearish momentum.
The indicator offers three variants for calculating this dynamic length, allowing users to tailor its responsiveness:
Variant I (Aggressive): Increases the length dramatically based on volatility and a nonlinear scaling of the distance from 50. Ideal for traders seeking highly sensitive signals in fast-moving markets.
Variant II (Moderate): Combines volatility with a scaled distance from 50, using a less aggressive adjustment. Strikes a balance between responsiveness and stability, suitable for most trading scenarios.
Variant III (Conservative): Applies a linear combination of volatility and raw distance from 50. Offers a stable, less reactive length adjustment for traders prioritizing consistency.
// Function that returns a dynamic RSI length based on past RSI values
// The idea is to make the RSI length adaptive using volatility (stdev) and distance from the RSI midpoint (50)
// Different "variant" options control how aggressively the length changes
parameter_free_length(free_rsi, variant) =>
len = switch variant
// Variant I: Most aggressive adaptation
// Uses standard deviation scaled by a nonlinear factor of distance from 50
// Also adds another distance-based term to increase length more dramatically
"I" => math.ceil(
ta.stdev(free_rsi, math.ceil(free_rsi)) *
math.pow(1 + (math.ceil(math.abs(50 - (free_rsi - 50))) / 100), 2)
) +
(
math.ceil(math.abs(free_rsi - 50)) *
(1 + (math.ceil(math.abs(50 - (free_rsi - 50))) / 100))
)
// Variant II: Moderate adaptation
// Adds the standard deviation and a distance-based scaling term (less nonlinear)
"II" => math.ceil(
ta.stdev(free_rsi, math.ceil(free_rsi)) +
(
math.ceil(math.abs(free_rsi - 50)) *
(1 + (math.ceil(math.abs(50 - (free_rsi - 50))) / 100))
)
)
// Variant III: Least aggressive adaptation
// Simply adds standard deviation and raw distance from 50 (linear scaling)
"III" => math.ceil(
ta.stdev(free_rsi, math.ceil(free_rsi)) +
math.ceil(math.abs(free_rsi - 50))
)
2. Smoothing Options
To refine the dynamic RSI and reduce noise, the PF-RSI provides smoothing capabilities:
Smoothing Toggle: Enable or disable smoothing of the dynamic length used for RSI.
Smoothing MA Type for RSI MA: Choose between SMA and EMA
Smoothing Length Options for RSI MA:
Full: Uses the entire calculated dynamic length.
Half: Applies half of the dynamic length for smoother output.
SQRT: Uses the square root of the dynamic length, offering a compromise between responsiveness and smoothness.
The smoothed RSI is complemented by a separate moving average (MA) of the RSI itself, further enhancing signal clarity.
3. Visualization Tools
The PF-RSI includes visualization options to help traders interpret market conditions at a glance.
Plots:
Dynamic RSI: Displayed as a white line, showing the adaptive RSI value.
RSI Moving Average: Plotted in yellow, providing a smoothed reference for trend and momentum analysis.
Dynamic Length: A secondary plot (in faint white) showing how the calculation period evolves over time.
Histogram: Represents the RSI’s position relative to 50, with color gradients.
Fill Area: The space between the RSI and its MA is filled with a gradient (green for RSI > MA, red for RSI < MA), highlighting momentum shifts.
Customizable bar colors on the price chart reflect trend and momentum:
Trend (Raw RSI): Green (RSI > 50), Red (RSI < 50).
Trend (RSI MA): Green (MA > 50), Red (MA < 50).
Trend (Raw RSI) + Momentum: Adds momentum shading (lighter green/red when RSI and MA diverge).
Trend (RSI MA) + Momentum: Similar, but based on the MA’s trend.
Momentum: Green (RSI > MA), Red (RSI < MA).
Off: Disables bar coloring.
Intrabar Updating: Optional real-time updates within each bar for enhanced responsiveness.
4. Alerts
The PF-RSI supports customizable alerts to keep traders informed of key events.
Trend Alerts:
Raw RSI: Triggers when the RSI crosses above (uptrend) or below (downtrend) 50.
RSI MA: Triggers when the moving average crosses 50.
Off: Disables trend alerts.
Momentum Alerts:
Triggers when the RSI crosses its moving average, indicating rising (RSI > MA) or declining (RSI < MA) momentum.
Alerts are fired once per bar close, with descriptive messages including the ticker symbol (e.g., " Uptrend on: AAPL").
How It Works
The PF-RSI operates in a multi-step process:
Initialization
On the first run, it calculates a standard RSI with a 14-period length to seed the dynamic calculation.
Dynamic Length Computation
Once seeded, the indicator switches to a dynamic length based on the selected variant, factoring in volatility and distance from 50.
If smoothing is enabled, the length is further refined using an SMA.
RSI Calculation
The adaptive RSI is computed using the dynamic length, ensuring it reflects current market conditions.
Moving Average
A separate MA (SMA or EMA) is applied to the RSI, with a length derived from the dynamic length (Full, Half, or SQRT).
Visualization and Alerts
The results are plotted, and alerts are triggered based on user settings.
This adaptive approach minimizes lag in fast markets and reduces false signals in choppy conditions, offering a significant edge over fixed-period RSI implementations.
Why Use PF-RSI?
The Parameter Free RSI stands out by eliminating the guesswork of selecting an RSI period. Its dynamic length adjusts to market volatility and momentum, providing timely signals without manual tweaking.
Pinescript - Common Label & Line Array Functions Library by RRBPinescript - Common Label & Line Array Functions Library by RagingRocketBull 2021
Version 1.0
This script provides a library of common array functions for arrays of label and line objects with live testing of all functions.
Using this library you can easily create, update, delete, join label/line object arrays, and get/set properties of individual label/line object array items.
You can find the full list of supported label/line array functions below.
There are several libraries:
- Common String Functions Library
- Standard Array Functions Library
- Common Fixed Type Array Functions Library
- Common Label & Line Array Functions Library
- Common Variable Type Array Functions Library
Features:
- 30 array functions in categories create/update/delete/join/get/set with support for both label/line objects (45+ including all implementations)
- Create, Update label/line object arrays from list/array params
- GET/SET properties of individual label/line array items by index
- Join label/line objects/arrays into a single string for output
- Supports User Input of x,y coords of 5 different types: abs/rel/rel%/inc/inc% list/array, auto transforms x,y input into list/array based on type, base and xloc, translates rel into abs bar indexes
- Supports User Input of lists with shortened names of string properties, auto expands all standard string properties to their full names for use in functions
- Live Output for all/selected functions based on User Input. Test any function for possible errors you may encounter before using in script.
- Output filters: hide all excluded and show only allowed functions using a list of function names
- Output Panel customization options: set custom style, color, text size, and line spacing
Usage:
- select create function - create label/line arrays from lists or arrays (optional). Doesn't affect the update functions. The only change in output should be function name regardless of the selected implementation.
- specify num_objects for both label/line arrays (default is 7)
- specify common anchor point settings x,y base/type for both label/line arrays and GET/SET items in Common Settings
- fill lists with items to use as inputs for create label/line array functions in Create Label/Line Arrays section
- specify label/line array item index and properties to SET in corresponding sections
- select label/line SET function to see the changes applied live
Code Structure:
- translate x,y depending on x,y type, base and xloc as specified in UI (required for all functions)
- expand all shortened standard property names to full names (required for create/update* from arrays and set* functions, not needed for create/update* from lists) to prevent errors in label.new and line.new
- create param arrays from string lists (required for create/update* from arrays and set* functions, not needed for create/update* from lists)
- create label/line array from string lists (property names are auto expanded) or param arrays (requires already expanded properties)
- update entire label/line array or
- get/set label/line array item properties by index
Transforming/Expanding Input values:
- for this script to work on any chart regardless of price/scale, all x*,y* are specified as % increase relative to x0,y0 base levels by default, but user can enter abs x,price values specific for that chart if necessary.
- all lists can be empty, contain 1 or several items, have the same/different lengths. Array Length = min(min(len(list*)), mum_objects) is used to create label/line objects. Missing list items are replaced with default property values.
- when a list contains only 1 item it is duplicated (label name/tooltip is also auto incremented) to match the calculated Array Length
- since this script processes user input, all x,y values must be translated to abs bar indexes before passing them to functions. Your script may provide all data internally and doesn't require this step.
- at first int x, float y arrays are created from user string lists, transformed as described below and returned as x,y arrays.
- translated x,y arrays can then be passed to create from arrays function or can be converted back to x,y string lists for the create from lists function if necessary.
- all translation logic is separated from create/update/set functions for the following reasons:
- to avoid redundant code/dependency on ext functions/reduce local scopes and to be able to translate everything only once in one place - should be faster
- to simplify internal logic of all functions
- because your script may provide all data internally without user input and won't need the translation step
- there are 5 types available for both x,y: abs, rel, rel%, inc, inc%. In addition to that, x can be: bar index or time, y is always price.
- abs - absolute bar index/time from start bar0 (x) or price (y) from 0, is >= 0
- rel - relative bar index/time from cur bar n (x) or price from y0 base level, is >= 0
- rel% - relative % increase of bar index/time (x) or price (y) from corresponding base level (x0 or y0), can be <=> 0
- inc - relative increment (step) for each new level of bar index/time (x) or price (y) from corresponding base level (x0 or y0), can be <=> 0
- inc% - relative % increment (% step) for each new level of bar index/time (x) or price (y) from corresponding base level (x0 or y0), can be <=> 0
- x base level >= 0
- y base level can be 0 (empty) or open, close, high, low of cur bar
- single item x1_list = "50" translates into:
- for x type abs: "50, 50, 50 ..." num_objects times regardless of xloc => x = 50
- for x type rel: "50, 50, 50 ... " num_objects times => x = x_base + 50
- for x type rel%: "50%, 50%, 50% ... " num_objects times => x_base * (1 + 0.5)
- for x type inc: "0, 50, 100 ... " num_objects times => x_base + 50 * i
- for x type inc%: "0%, 50%, 100% ... " num_objects times => x_base * (1 + 0.5 * i)
- when xloc = xloc.bar_index each rel*/inc* value in the above list is then subtracted from n: n - x to convert rel to abs bar index, values of abs type are not affected
- x1_list = "0, 50, 100, ..." of type rel is the same as "50" of type inc
- x1_list = "50, 50, 50, ..." of type abs/rel/rel% produces a sequence of the same values and can be shortened to just "50"
- single item y1_list = "2" translates into (ragardless of yloc):
- for y type abs: "2, 2, 2 ..." num_objects times => y = 2
- for y type rel: "2, 2, 2 ... " num_objects times => y = y_base + 2
- for y type rel%: "2%, 2%, 2% ... " num_objects times => y = y_base * (1 + 0.02)
- for y type inc: "0, 2, 4 ... " num_objects times => y = y_base + 2 * i
- for y type inc%: "0%, 2%, 4% ... " num_objects times => y = y_base * (1 + 0.02 * i)
- when yloc != yloc.price all calculated values above are simply ignored
- y1_list = "0, 2, 4" of type rel% is the same as "2" with type inc%
- y1_list = "2, 2, 2" of type abs/rel/rel% produces a sequence of the same values and can be shortened to just "2"
- you can enter shortened property names in lists. To lookup supported shortened names use corresponding dropdowns in Set Label/Line Array Item Properties sections
- all shortened standard property names must be expanded to full names (required for create/update* from arrays and set* functions, not needed for create/update* from lists) to prevent errors in label.new and line.new
- examples of shortened property names that can be used in lists: bar_index, large, solid, label_right, white, left, left, price
- expanded to their corresponding full names: xloc.bar_index, size.large, line.style_solid, label.style_label_right, color.white, text.align_left, extend.left, yloc.price
- all expanding logic is separated from create/update* from arrays and set* functions for the same reasons as above, and because param arrays already have different types, implying the use of final values.
- all expanding logic is included in the create/update* from lists functions because it seemed more natural to process string lists from user input directly inside the function, since they are already strings.
Creating Label/Line Objects:
- use study max_lines_count and max_labels_count params to increase the max number of label/line objects to 500 (+3) if necessary. Default number of label/line objects is 50 (+3)
- all functions use standard param sequence from methods in reference, except style always comes before colors.
- standard label/line.get* functions only return a few properties, you can't read style, color, width etc.
- label.new(na, na, "") will still create a label with x = n-301, y = NaN, text = "" because max default scope for a var is 300 bars back.
- there are 2 types of color na, label color requires color(na) instead of color_na to prevent error. text_color and line_color can be color_na
- for line to be visible both x1, x2 ends must be visible on screen, also when y1 == y2 => abs(x1 - x2) >= 2 bars => line is visible
- xloc.bar_index line uses abs x1, x2 indexes and can only be within 0 and n ends, where n <= 5000 bars (free accounts) or 10000 bars (paid accounts) limit, can't be plotted into the future
- xloc.bar_time line uses abs x1, x2 times, can't go past bar0 time but can continue past cur bar time into the future, doesn't have a length limit in bars.
- xloc.bar_time line with length = exact number of bars can be plotted only within bar0 and cur bar, can't be plotted into the future reliably because of future gaps due to sessions on some charts
- xloc.bar_index line can't be created on bar 0 with fixed length value because there's only 1 bar of horiz length
- it can be created on cur bar using fixed length x < n <= 5000 or
- created on bar0 using na and then assigned final x* values on cur bar using set_x*
- created on bar0 using n - fixed_length x and then updated on cur bar using set_x*, where n <= 5000
- default orientation of lines (for style_arrow* and extend) is from left to right (from bar 50 to bar 0), it reverses when x1 and x2 are swapped
- price is a function, not a line object property
Variable Type Arrays:
- you can't create an if/function that returns var type value/array - compiler uses strict types and doesn't allow that
- however you can assign array of any type to another array of any type creating an arr pointer of invalid type that must be reassigned to a matching array type before used in any expression to prevent error
- create_any_array2 uses this loophole to return an int_arr pointer of a var type array
- this works for all array types defined with/without var keyword and doesn't work for string arrays defined with var keyword for some reason
- you can't do this with var type vars, only var type arrays because arrays are pointers passed by reference, while vars are actual values passed by value.
- you can only pass a var type value/array param to a function if all functions inside support every type - otherwise error
- alternatively values of every type must be passed simultaneously and processed separately by corresponding if branches/functions supporting these particular types returning a common single type result
- get_var_types solves this problem by generating a list of dummy values of every possible type including the source type, tricking the compiler into allowing a single valid branch to execute without error, while ignoring all dummy results
Notes:
- uses Pinescript v3 Compatibility Framework
- uses Common String Functions Library, Common Fixed Type Array Functions Library, Common Variable Type Array Functions Library
- has to be a separate script to reduce the number of local scopes/compiled file size, can't be merged with another library.
- lets you live test all label/line array functions for errors. If you see an error - change params in UI
- if you see "Loop too long" error - hide/unhide or reattach the script
- if you see "Chart references too many candles" error - change x type or value between abs/rel*. This can happen on charts with 5000+ bars when a rel bar index x is passed to label.new or line.new instead of abs bar index n - x
- create/update_label/line_array* use string lists, while create/update_label/line_array_from_arrays* use array params to create label/line arrays. "from_lists" is dropped to shorten the names of the most commonly used functions.
- create_label/line_array2,4 are preferable, 5,6 are listed for pure demonstration purposes only - don't use them, they don't improve anything but dramatically increase local scopes/compiled file size
- for this reason you would mainly be using create/update_label/line_array2,4 for list params or create/update_label/line_array_from_arrays2 for array params
- all update functions are executed after each create as proof of work and can be disabled. Only create functions are required. Use update functions when necessary - when list/array params are changed by your script.
- both lists and array item properties use the same x,y_type, x,y_base from common settings
- doesn't use pagination, a single str contains all output
- why is this so complicated? What are all these functions for?
- this script merges standard label/line object methods with standard array functions to create a powerful set of label/line object array functions to simplify manipulation of these arrays.
- this library also extends the functionality of Common Variable Type Array Functions Library providing support for label/line types in var type array functions (any_to_str6, join_any_array5)
- creating arrays from either lists or arrays adds a level of flexibility that comes with complexity. It's very likely that in your script you'd have to deal with both string lists as input, and arrays internally, once everything is converted.
- processing user input, allowing customization and targeting for any chart adds a whole new layer of complexity, all inputs must be translated and expanded before used in functions.
- different function implementations can increase/reduce local scopes and compiled file size. Select a version that best suits your needs. Creating complex scripts often requires rewriting your code multiple times to fit the limits, every line matters.
P.S. Don't rely too much on labels, for too often they are fables.
List of functions*:
* - functions from other libraries are not listed
1. Join Functions
Labels
- join_label_object(label_, d1, d2)
- join_label_array(arr, d1, d2)
- join_label_array2(arr, d1, d2, d3)
Lines
- join_line_object(line_, d1, d2)
- join_line_array(arr, d1, d2)
- join_line_array2(arr, d1, d2, d3)
Any Type
- any_to_str6(arr, index, type)
- join_any_array4(arr, d1, d2, type)
- join_any_array5(arr, d, type)
2. GET/SET Functions
Labels
- label_array_get_text(arr, index)
- label_array_get_xy(arr, index)
- label_array_get_fields(arr, index)
- label_array_set_text(arr, index, str)
- label_array_set_xy(arr, index, x, y)
- label_array_set_fields(arr, index, x, y, str)
- label_array_set_all_fields(arr, index, x, y, str, xloc, yloc, label_style, label_color, text_color, text_size, text_align, tooltip)
- label_array_set_all_fields2(arr, index, x, y, str, xloc, yloc, label_style, label_color, text_color, text_size, text_align, tooltip)
Lines
- line_array_get_price(arr, index, bar)
- line_array_get_xy(arr, index)
- line_array_get_fields(arr, index)
- line_array_set_text(arr, index, width)
- line_array_set_xy(arr, index, x1, y1, x2, y2)
- line_array_set_fields(arr, index, x1, y1, x2, y2, width)
- line_array_set_all_fields(arr, index, x1, y1, x2, y2, xloc, extend, line_style, line_color, width)
- line_array_set_all_fields2(arr, index, x1, y1, x2, y2, xloc, extend, line_style, line_color, width)
3. Create/Update/Delete Functions
Labels
- delete_label_array(label_arr)
- create_label_array(list1, list2, list3, list4, list5, d)
- create_label_array2(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array3(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array4(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array5(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array6(x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- update_label_array2(label_arr, x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- update_label_array4(label_arr, x_list, y_list, str_list, xloc_list, yloc_list, style_list, color1_list, color2_list, size_list, align_list, tooltip_list, d)
- create_label_array_from_arrays2(x_arr, y_arr, str_arr, xloc_arr, yloc_arr, style_arr, color1_arr, color2_arr, size_arr, align_arr, tooltip_arr, d)
- create_label_array_from_arrays4(x_arr, y_arr, str_arr, xloc_arr, yloc_arr, style_arr, color1_arr, color2_arr, size_arr, align_arr, tooltip_arr, d)
- update_label_array_from_arrays2(label_arr, x_arr, y_arr, str_arr, xloc_arr, yloc_arr, style_arr, color1_arr, color2_arr, size_arr, align_arr, tooltip_arr, d)
Lines
- delete_line_array(line_arr)
- create_line_array(list1, list2, list3, list4, list5, list6, d)
- create_line_array2(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array3(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array4(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array5(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array6(x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- update_line_array2(line_arr, x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- update_line_array4(line_arr, x1_list, y1_list, x2_list, y2_list, xloc_list, extend_list, style_list, color_list, width_list, d)
- create_line_array_from_arrays2(x1_arr, y1_arr, x2_arr, y2_arr, xloc_arr, extend_arr, style_arr, color_arr, width_arr, d)
- update_line_array_from_arrays2(line_arr, x1_arr, y1_arr, x2_arr, y2_arr, xloc_arr, extend_arr, style_arr, color_arr, width_arr, d)






















