DevSignalLibraryDevSignalLibrary: A Stable Library for Market Structure Analysis
This is a modified and fully standalone version of a popular public library for calculating non-repainting structural points (Zig Zag).
Core Purpose
This library was created to ensure the long-term stability and independence of indicators from external scripts. It solves the problem where a primary indicator might stop working because the original library's author changes their username or deletes the script.
The library exports one main function, signalLib(), which is the core engine for identifying significant swing highs and lows on the chart.
Features and Modifications
Full Autonomy: The library's code can be imported into any of your indicators, making them completely self-contained.
Pine Script v6 Compatibility: The code has been fully refactored and adapted for the latest version of Pine Script, ensuring it functions correctly.
Preserved Logic: The fundamental calculation algorithm has been kept unchanged to preserve its effectiveness.
Credits and Original Source
This code is an adaptation of the public signalLib library, which was created by Yash Gode and published by user RezzoRedPriest.
This modification was made by user Dev0880 for the purpose of ensuring stability and compatibility in personal projects.
Indikator dan strategi
Custom Strategy Builder [CLAMENZA] i changed this indicator to make the market session lines thicker and font bigger as well.
RS Rating vs SPX🇷🇺 Описание на русском языке
📈 RS Rating vs SPX — Относительная сила акции против S&P 500
Этот индикатор рассчитывает рейтинг относительной силы (RS Rating) акции или инструмента по методике, аналогичной Investor’s Business Daily (IBD). Он показывает, насколько хорошо актив показывает себя по сравнению с рынком в целом, используя S&P 500 (SPX) как бенчмарк.
🔍 Как это работает?
Сравнение с рынком:
Индикатор вычисляет темпы роста (ROC) актива за 3, 6, 9 и 12 месяцев — и вычитает из них темпы роста S&P 500 за те же периоды. Это даёт относительную производительность.
Взвешенный рейтинг:
Результаты комбинируются по формуле:
40% (3 мес) + 20% (6 мес) + 20% (9 мес) + 20% (12 мес) — чтобы учесть как краткосрочную динамику, так и долгосрочный тренд.
Нормализация 1–99:
Полученное значение нормализуется по истории за последние N периодов (по умолчанию — 250), чтобы присвоить активу рейтинг от 1 до 99, где:
90–99 — исключительная сила (лучшие 10%)
70–89 — сильные лидеры
30–69 — средние показатели
1–29 — слабые, отстающие от рынка
Визуализация:
Рейтинг отображается в виде цветного квадратного окна, которое можно разместить в любом углу графика (настраивается в параметрах). Цвет подсказывает силу:
🟢 Зелёный — сильный (≥70)
🟠 Оранжевый — средний (30–69)
🔴 Красный — слабый (<30)
🛠️ Для кого это?
Для инвесторов по методике IBD, ищущих сильные акции.
Для свинг-трейдеров, которые хотят входить в активы, обгоняющие рынок.
Для анализа относительной силы — не абсолютной доходности, а именно превосходства над индексом.
⚙️ Настройки
Lookback Period — период нормализации (по умолчанию 250 баров).
Approx. Visible Bars Back — оценка видимой ширины графика (для позиционирования слева).
Position — выбор расположения индикатора на графике (9 вариантов).
🇬🇧 Description in English
📈 RS Rating vs SPX — Relative Strength of Stock vs S&P 500
This indicator calculates the Relative Strength (RS) Rating of a stock or instrument using a methodology similar to Investor’s Business Daily (IBD). It measures how well the asset is performing relative to the overall market, using the S&P 500 (SPX) as the benchmark.
🔍 How it works:
Market Comparison:
The indicator calculates the Rate-of-Change (ROC) of the asset over 3, 6, 9, and 12 months — then subtracts the ROC of the S&P 500 over the same periods. This gives the relative performance vs the market.
Weighted Score:
Results are combined using the formula:
40% (3mo) + 20% (6mo) + 20% (9mo) + 20% (12mo) — balancing short-term momentum and long-term trend.
Normalized 1–99 Scale:
The score is normalized against its own history over the last N bars (default: 250) to assign a rating from 1 to 99, where:
90–99 — exceptional strength (top 10%)
70–89 — strong leaders
30–69 — average performers
1–29 — weak, underperforming the market
Visual Display:
The rating is shown in a color-coded box, which can be positioned in any corner of the chart (configurable in settings). Color indicates strength:
🟢 Green — strong (≥70)
🟠 Orange — moderate (30–69)
🔴 Red — weak (<30)
🛠️ Who is it for?
IBD-style investors looking for market-leading stocks.
Swing traders who want to enter assets outperforming the broader market.
Anyone analyzing relative strength — not absolute returns, but performance relative to SPX.
⚙️ Settings
Lookback Period — normalization window (default: 250 bars).
Approx. Visible Bars Back — estimated chart width for left-edge positioning.
Position — choose where to display the box (9 options: Top Left, Bottom Right, etc.).
Confluence Engine Confluence Engine is a practical, non-repainting decision aid that scores market conditions from −100…+100 by combining six proven modules: Trend, Momentum, Volatility, Volume, Structure, and an HTF confirmation. It’s designed for crypto, forex, indices, and stocks, and it fires entries only on confirmed bar closes.
What’s inside
Trend: EMA 20/50/200 alignment plus a Supertrend/KAMA toggle (you choose the baseline).
Momentum: RSI + MACD with confirmed-pivot divergence detection.
Volatility: ATR% and Bollinger Band width vs its average to favor expansion over chop.
Volume: OBV-style cumulative flow slope + volume surge vs SMA×multiplier.
Market Structure: Confirmed pivots, BOS (break of structure) and CHOCH (change of character).
HTF Filter: Closed higher-timeframe context via request.security(..., barmerge.gaps_on, barmerge.lookahead_off).
Why it does not repaint
Signals are computed and plotted on closed bars only.
Pivots/divergences use confirmed pivot points (no forward look).
HTF series are fetched with lookahead_off and use the last closed HTF bar in realtime.
No future bar references are used for entries or alerts.
How to use (3 steps)
Pick a timeframe pair: use a 4–6× HTF multiplier (5m→30m, 15m→1h, 1h→4h, 4h→1D, 1D→1W).
Trade with the HTF: take longs only when the HTF filter is bullish; shorts only when bearish.
Prefer expansion: act when BB width > its average and ATR% is elevated; skip most signals in compression.
Suggested presets (start here)
Crypto (BTC/ETH): 15m→1h, 1h→4h. stLen=10, stMult=3.0, bbLen=20, surgeMul=1.8–2.2, thresholds +40 / −40 (intraday can try +35 / −35).
Forex majors: 15m→1h, 1h→4h. stLen=10–14, stMult=2.5–3.0, surgeMul=1.5–1.8, thresholds +35 / −35 (swing: +45 / −45).
US equities (liquid): 5m→30m/1h, 15m→1h/2h. stMult=3.0–3.5, surgeMul=1.6–2.0, thresholds +45 / −45 to reduce chop.
Indices (ES/NQ): 5m→30m, 15m→1h. Defaults are fine; start at +40 / −40.
Gold/Oil: 15m→1h, 1h→4h. Thresholds +35 / −35, surgeMul=1.6–1.9.
Inputs (plain English)
Use Supertrend (off = KAMA): choose the trend baseline.
EMA Fast/Mid/Slow: 20/50/200 by default for classic stack.
RSI/MACD + divergence pivots: momentum and exhaustion context.
ATR Length & BB Length: volatility regime detection.
Volume SMA & Surge Multiplier: defines “meaningful” volume spikes.
Pivot left/right & “Confirm BOS/CHOCH on Close”: structure strictness.
Enable HTF & Higher Timeframe: confirms the lower timeframe direction.
Thresholds (+long / −short): when the score crosses these, you get signals.
Signals & alerts (IDs preserved)
Entry shapes plot at bar close when the score crosses thresholds.
Alerts you can enable:
CONFLUENCE LONG — long entry signal
CONFLUENCE SHORT — short entry signal
BULLISH BIAS — score turned positive
BEARISH BIAS — score turned negative
Best practices
Focus on signals with HTF agreement and volatility expansion; require volume participation (surge or rising OBV slope) for higher quality.
Raise thresholds (+45/−45 or +50/−50) to reduce whipsaws in choppy sessions.
Lower thresholds (+35/−35) only if you also require volatility/volume filters.
Performance & scope
Works across crypto/FX/equities/indices; no broker data or special feeds required.
No repainting by design; signals/alerts are computed on closed bars.
As with any tool, results vary by regime; always combine with risk management.
Disclosure
This script is for educational purposes only and is not financial advice. Trading involves risk. Test on historical data and paper trade before using live.
Volume > 20-day Avg (xMult)It’s an indicator that changes color and triggers an alert when volume exceeds the 20-day average. By default, the threshold is set to 1.2× the 20-day average (i.e., 120%), and the value is user-configurable.
Simple RS RatingРусский:
Этот индикатор отображает упрощенный рейтинг RS (Relative Strength Rating) на графике. Рейтинг RS вычисляется на основе относительной производительности актива по сравнению с рынком в целом за различные периоды времени (3, 6, 9 и 12 месяцев). Значение нормализуется в диапазон от 1 до 99, где более высокие значения указывают на более сильную относительную performance. Индикатор отображает текущее значение рейтинга в виде цветной метки в выбранном углу графика. Зеленый цвет означает высокий рейтинг (≥70), оранжевый - средний (30-69), красный - низкий (≤30). Это простой визуальный инструмент для быстрой оценки относительной силы актива.
English:
This indicator displays a simplified RS (Relative Strength Rating) on the chart. The RS Rating is calculated based on the asset's relative performance compared to the overall market over different time periods (3, 6, 9, and 12 months). The value is normalized to a range from 1 to 99, where higher values indicate stronger relative performance. The indicator shows the current rating value as a colored label in the selected corner of the chart. Green color indicates a high rating (≥70), orange indicates medium (30-69), and red indicates a low rating (≤30). This is a simple visual tool for quickly assessing an asset's relative strength.
VIX RSI/USDVIX/USD/DXY into rsi in one
Blue diamond=calls
White diamond = puts
yes there's some false signals due to volatility but mainly rsi for vix/usd
Tradable Tickers -
SP:SPX AMEX:SPY NASDAQ:QQQ
🎮 Liquidity Checklist – EFI + CMF + Centered MFIWhat it is
A confirmation dashboard combining EFI (Elder Force Index), CMF (Chaikin Money Flow), and MFI (Money Flow Index).
Provides a checklist table with / conditions, glow plots, and theme/override system. Intended as confirmation tool, not a standalone signal generator.
Why combine these three?
EFI (Force): captures impulse of price change × volume strength of push. CMF (Flow): measures accumulation/distribution capital inflow or outflow.
MFI (Liquidity/Momentum): RSI with volume liquidity stretch or balance.
Aligning force + flow + liquidity avoids weak setups and highlights agreement.
How it works
EFI: EMA of ( Close × Volume). Positive = buying pressure; Negative = selling pressure.
CMF: Money Flow Multiplier × Volume, averaged relative to total volume. Above 0 = inflow; Below 0 = outflow.
MFI: built-in 0 100 oscillator.
On chart: plotted centered as (MFI 50). In table: shown as real 0 100 value.
Checklist logic
Long bias: EFI > 0; CMF > 0; MFI > 35.
Short bias: EFI < 0; CMF < 0; MFI < 65.
Between 35 65, MFI may allow both long and short (neutral liquidity zone).
What s original here
Centered MFI plotting so all indicators share a zero baseline.
Dashboard checklist table with live indicator values.
Theme engine with custom color overrides (separate plot vs. table).
Normalization toggle for EFI/CMF readability on high-volume tickers.
Inputs & settings
Lengths: EFI (13), CMF (20), MFI (14).
Themes: Arcade, Feng Shui, Samurai, Irish, Cyberpunk.
Override plot colors option; table stays theme-based.
Normalize EFI/CMF (default OFF). ON scales EFI/CMF to 100 +100 for visual balance with MFI. Logic uses raw values.
How to read
Chart: EFI & CMF as glowing columns; MFI as centered line; reference lines at 0, +15 ( 65), 15
(35).
Table: / for each condition and live values; READY row lights when all align.
Suggested use
Use as confirmation filter:
1) Define trade idea (structure, catalyst).
2) Check EFI and CMF align with bias.
3) Confirm MFI not stretched (avoid longs >65, shorts <35).
4) Look for READY tick when all three align.
Works across timeframes; many prefer 15m 1H for intraday.
Limitations
Not a trading system on its own.
CMF may be na when High == Low.
Normalization affects visuals only, not logic. Always backtest and manage risk.
Credits
EFI by Alexander Elder. CMF by Marc Chaikin.
MFI standard oscillator.
Centered-MFI plotting, checklist UI, themes, normalization: NICK789.
Disclaimer
Educational use only; not financial advice.
No guarantees of accuracy or profitability.
Markets involve risk; past performance does not guarantee results.
HA Color Change Alerts (fixed v3)📌 Heikin Ashi Color Change Alerts
This indicator notifies you whenever a Heikin Ashi candle changes color (from red → green or green → red).
🔎 Features
Automatic Heikin Ashi calculation
Uses TradingView’s built-in Heikin Ashi source, so you don’t need to switch your chart to HA candles.
Signals on chart
Plots ▲ (green triangle) when HA changes from red → green and ▼ (red triangle) when HA changes from green → red.
Customizable alerts
You can set TradingView alerts for:
“Heikin Ashi Turned GREEN”
“Heikin Ashi Turned RED”
Options
Show/Hide the Heikin Ashi candles on top of your normal chart.
Choose whether alerts trigger only after bar close, or intrabar as soon as the color flips.
Show or hide the signal markers.
🔔 Use cases
Trend following: enter when HA flips to green, exit when it flips back to red.
Early reversal spotting: get notified when the candle momentum shifts.
Works on any symbol and timeframe.
Kerzen-Zähler über/unter EMADieses Skript zeigt die Anzahl an Zeitperioden ober/unterhalb eines individuellen EMAs an.
Absolute Volume (in Millions & Crores)Absolute volume value = Volume * close price
it will help you to understand the actual money flow happened during the period
自定义均线系统A customizable Moving Average indicator that lets you freely choose the period values you want, and automatically plots them on the candlestick chart. This flexibility helps traders quickly adjust their analysis style, compare different trends, and fine-tune strategies without switching between multiple fixed indicators.
XAUUSD/SPX Slope with MACDThe XAUUSD/SPX Slope with MACD Indicator tracks the slope of the XAUUSD (Gold) to SPX (S&P 500) ratio using linear regression over a customizable lookback period (default 20 bars), plotted as a blue line to show Gold’s relative performance against stocks. A MACD overlay (fast: 12, slow: 26, signal: 9, scaled by 5) is applied to the slope, with a green MACD line, red signal line, and green/red histogram to highlight momentum. A positive slope indicates Gold outperforming SPX, while MACD trends provide additional context. A zero line and background coloring (green for positive slope, red for negative) aid interpretation. Ensure XAUUSD and SPX symbols are supported by your platform.
Usage Notes:
Interpretation:
Slope (Blue): Positive values indicate Gold outperforming SPX; negative values show SPX outperforming.
MACD Components: The green MACD line, red signal line, and histogram (green for positive, red for negative) reflect momentum in the slope. Crossovers or histogram shifts can be analyzed manually for potential trend changes.
Customization: Adjust lookback, macd_fast, macd_slow, or macd_signal to tune sensitivity. The MACD scale is fixed at 5 for clarity.
Symbol Check: Verify "XAUUSD" and "SPX" match your platform’s tickers (e.g., "GOLD" or "SP500").
CVD Spaghetti - Multi-Exchange (Perpetuals)CVD Spaghetti – Multi-Exchange (Perpetuals) is designed to track and visualize Cumulative Volume Delta (CVD) across multiple cryptocurrency perpetual futures exchanges in one consolidated view. This indicator provides traders with a clearer perspective on buying and selling pressure by monitoring how order flow develops on different venues simultaneously.
What it does
The script calculates the CVD for each enabled exchange and plots them as separate lines on a single chart, creating a “spaghetti” style visualization. This allows traders to identify relative strength or weakness between major exchanges, which can often hint at institutional positioning, liquidity shifts, and potential market imbalances.
Why it’s useful
Order flow and liquidity dynamics can differ significantly between exchanges. By aggregating and comparing these flows, traders can:
Detect which venue is leading during trend development.
Spot divergences between exchanges, which may indicate inefficiencies or arbitrage-driven movements.
Gauge overall sentiment strength by comparing multiple sources instead of relying on a single dataset.
Technical details
Anchor Period Reset: The cumulative calculation resets based on the user-defined Anchor Period (default: daily), keeping data relevant for the chosen trading horizon.
Dynamic Resolution: The script automatically selects an appropriate lower timeframe for data requests based on the chart timeframe to maintain responsiveness and accuracy.
Normalization: Not all exchanges report volume in the same way—some use quote currency (USD), others in contracts or ticks. To ensure comparability, this indicator normalizes volumes where necessary:
Bybit USD and OKX contracts are divided by price to approximate base-coin terms.
Single-contract venues (e.g., Deribit) are normalized similarly.
Exchanges already reporting in the base currency remain unchanged.
Multi-Exchange Coverage: Supports major venues including Binance, Bybit, OKX, Bitget, Coinbase, and optional secondary exchanges like Blofin, Whitebit, and Deribit.
Visual Aids:
Zero baseline for directional reference.
Vertical session markers at each reset point.
Optional exchange labels positioned dynamically on the last bar for quick identification.
How traders might use it
Trend confirmation: Strong synchronized CVD across all major exchanges supports continuation; fragmentation may suggest weakening conviction.
Cross-exchange divergence: When one exchange’s CVD diverges from others, it can signal localized liquidity shocks or large player activity.
High-frequency strategies: On lower timeframes, the spaghetti view can highlight which venue is absorbing or providing liquidity fastest, aiding short-term decision-making.
ADR(20)% - Qullamagi (corner value) v6This indicator displays the 20-bar Average Daily Range (ADR) either as a percentage of price or in raw dollar terms, shown in a clean corner box on the chart.
Switch between % ADR and $ ADR with a single checkbox.
Place the output box in any chart corner.
Useful for volatility assessment, stop-loss sizing, and stock selection.
Inspired by the trading approach of Kristjan Qullamägi (Qullamaggie), who uses ADR(20) both to filter high-momentum stocks and to size risk (stops should generally be ≤ 1×ADR).
Recovery StrategyDescription:
The Recovery Strategy is a long-only trading system designed to capitalize on significant price drops from recent highs. It enters a position when the price falls 10% or more from the highest high over a 6-month lookback period and adds positions on further 2% drops, up to a maximum of 5 positions. Each trade is held for 6 months before exiting, regardless of profit or loss. The strategy uses margin to amplify position sizes, with a default leverage of 5:1 (20% margin requirement). All key parameters are customizable via inputs, allowing flexibility for different assets and timeframes. Visual markers indicate recent highs for reference.
How It Works:
Entry: Buys when the closing price drops 10% or more from the recent high (highest high in the lookback period, default 126 bars ~6 months). If already in a position, additional buys occur on further 2% drops (e.g., 12%, 14%, 16%, 18%), up to 5 positions (pyramiding).
Exit: Each trade exits after its own holding period (default 126 bars ~6 months), regardless of profit or loss. No stop loss or take-profit is used.
Margin: Uses leverage to control larger positions (default 20% margin, 5:1 leverage). The order size is a percentage of equity (default 100%), adjustable via inputs.
Visualization: Displays blue markers (without text) at new recent highs to highlight reference levels.
Inputs:
Lookback Period for High Peak (bars): Number of bars to look back for the recent high (default: 126, ~6 months on daily charts).
Initial Drop Percentage to Buy (%): Percentage drop from recent high to trigger the first buy (default: 10.0%).
Additional Drop Percentage to Buy (%): Further drop percentage to add positions (default: 2.0%).
Holding Period (bars): Number of bars to hold each position before selling (default: 126, ~6 months).
Order Size (% of Equity): Percentage of equity used per trade (default: 100%).
Margin for Long Positions (%): Percentage of position value covered by equity (default: 20%, equivalent to 5:1 leverage).
Usage:
Timeframe: Designed for daily charts (126 bars ~6 months). Adjust Lookback Period and Holding Period for other timeframes (e.g., 1008 hours for hourly charts, assuming 8 trading hours/day).
Assets: Suitable for stocks, ETFs, or other assets with significant price volatility. Test thoroughly on your chosen asset.
Settings: Customize inputs in the strategy settings to match your risk tolerance and market conditions. For example, lower Margin for Long Positions (e.g., to 10% for 10:1 leverage) to increase position sizes, but beware of higher risk.
Backtesting: Use TradingView’s Strategy Tester to evaluate performance. Check the “List of Trades” for skipped trades due to insufficient equity or margin requirements.
Risks and Considerations:
No Stop Loss: The strategy holds trades for the full 6 months without a stop loss, exposing it to significant drawdowns in prolonged downtrends.
Margin Risk: Leverage (default 5:1) amplifies both profits and losses. Ensure sufficient equity to cover margin requirements to avoid skipped trades or simulated margin calls.
Pyramiding: Up to 5 positions can be open simultaneously, increasing exposure. Adjust pyramiding in the code if fewer positions are desired (e.g., change to pyramiding=3).
Market Conditions: Performance depends on price drops and recoveries. Test on historical data to assess effectiveness in your market.
Broker Emulator: TradingView’s paper trading simulates margin but does not execute real margin trading. Results may differ in live trading due to broker-specific margin rules.
How to Use:
Add the strategy to your chart in TradingView.
Adjust input parameters in the settings panel to suit your asset, timeframe, and risk preferences.
Run a backtest in the Strategy Tester to evaluate performance.
Monitor open positions and margin levels in the Trading Panel to manage risk.
For live trading, consult your broker’s margin requirements and leverage policies, as TradingView’s simulation may not match real-world conditions.
Disclaimer:
This strategy is for educational purposes only and does not constitute financial advice. Trading involves significant risk, especially with leverage and no stop loss. Always backtest thoroughly and consult a financial advisor before using any strategy in live trading.
WSW - DMA Dickson Moving Average (DMA) is a specialized technical indicator designed to create a fast-responding moving average with minimal lag, blending the strengths of two other well-known moving averages: the Hull Moving Average (HMA) and John Ehlers’ Zero Lag Indicator. It was developed by Nathan Dickson, who aimed to create a moving average that reacts quickly to price changes, similar to the proprietary Jurik Moving Average (JMA), but without the associated costs. Below is a detailed explanation of the DMA, its construction, purpose, and use in trading.
عكفة الماكد المتقدمة - أبو فارس ©// 🔒 عكفة الماكد المتقدمة © 2025
// 💡 فكرة وإبداع: المهندس أبو الياس
// 🛠️ تطوير وتنفيذ: أبو فارس
// 📜 جميع الحقوق الفكرية محفوظة - لا يُسمح بالنسخ أو التعديل أو إعادة التوزيع
// 🚫 أي محاولة للعبث بهذا الكود أو انتهاك الحقوق الفكرية مرفوضة قانونياً
// 📧 للاستفسارات والتراخيص: يرجى التواصل مع المطور أبو فارس
// 🔒 Advanced MACD Curve © 2025
// 💡 Idea & Creativity: Engineer Abu Elias
// 🛠️ Development & Implementation: Abu Fares
// 📜 All intellectual rights reserved - Copying, modifying, or redistributing is not permitted
// 🚫 Any attempt to tamper with this code or violate intellectual property rights is legally prohibited
// 📧 For inquiries and licensing: Please contact the developer, Abu Fares
tvunitLibrary "tvunit"
method assert(this, description, passed, bar)
Adds a test result to the test suite.
Namespace types: TestSuite
Parameters:
this (TestSuite) : The (TestSuite) instance.
description (string) : A description of the test.
passed (bool) : Whether the test passed or result.
bar (int) : The bar index at which the test was run.
Returns: Whether the assertion passed or result.
method assertWindow(this, runTests, description, bars, passed, stopOnFirstFailure)
Adds a test result to the test suite.
Namespace types: TestSuite
Parameters:
this (TestSuite) : The (TestSuite) instance.
runTests (bool) : Whether to run the tests.
description (string) : A description of the test.
bars (int) : The number of bars to test.
passed (bool) : A series of boolean values indicating whether each bar passed.
stopOnFirstFailure (bool) : Whether to stop on the first test failure.
Returns: Whether the assertion ran or not
method totalTests(this)
Returns the total number of tests in the test suite.
Namespace types: TestSuite
Parameters:
this (TestSuite) : The (TestSuite) instance.
Returns: The total number of tests.
method totalTests(this)
Returns the total number of tests in the test suite.
Namespace types: TestSession
Parameters:
this (TestSession) : The (TestSuite) instance.
Returns: The total number of tests.
method passedTests(this)
Returns the total number of passed tests in the test suite.
Namespace types: TestSuite
Parameters:
this (TestSuite) : The (TestSuite) instance.
Returns: The total number of passed tests.
method passedTests(this)
Returns the total number of passed tests in the test suite.
Namespace types: TestSession
Parameters:
this (TestSession) : The (TestSuite) instance.
Returns: The total number of passed tests.
method failedTests(this)
Returns the total number of result tests in the test suite.
Namespace types: TestSuite
Parameters:
this (TestSuite) : The (TestSuite) instance.
Returns: The total number of result tests.
method failedTests(this)
Returns the total number of result tests in the test suite.
Namespace types: TestSession
Parameters:
this (TestSession) : The (TestSuite) instance.
Returns: The total number of result tests.
newTestSession()
Creates a new test session instance.
Returns: A new (TestSession) instance.
method addNewTestSuite(this, name, description)
Creates a new test suite instance.
Namespace types: TestSession
Parameters:
this (TestSession) : The (TestSession) instance.
name (string) : The name of the test suite.
description (string) : (optional) A description of the test suite.
Returns: A new (TestSuite) instance.
method add(this, suite)
Creates a new test suite instance.
Namespace types: TestSession
Parameters:
this (TestSession) : The (TestSession) instance.
suite (TestSuite) : The (TestSuite) instance to add.
Returns: The (TestSession) instance.
method totalSuites(this)
Returns the total number of sessions in the test session.
Namespace types: TestSession
Parameters:
this (TestSession) : The (TestSession) instance.
Returns: The total number of sessions.
method report(this, show, showOnlyFailedTest)
Generates a report of the test session summary that is suitable for logging.
Namespace types: TestSession
Parameters:
this (TestSession) : The (TestSession) instance.
show (bool) : Optional: Whether to show the report or not. default: true
showOnlyFailedTest (bool) : Optional: Whether to show only result tests or not. default: false
Returns: A formatted string report of the test suite summary.
method reportGui(this, show, pages, pageSize)
Generates a report of the test suite summary for the GUI.
Namespace types: TestSession
Parameters:
this (TestSession) : The (TestSession) instance.
show (bool) : Optional: Whether to show the report or not. default: true
pages (int) : Optional: The number of pages to show (columns). default: 4
pageSize (int) : Optional: The number of results to show per page (rows), excluding the header. default: 5
approxEqual(a, b, tolerance)
Checks if two floating-point numbers are approximately equal within a specified tolerance.
Parameters:
a (float) : The first floating-point number.
b (float) : The second floating-point number.
tolerance (float) : The tolerance within which the two numbers are considered equal. Default is 1e-6.
Returns: True if the numbers are approximately equal, false otherwise. If both are na, returns true.
TestResult
Fields:
description (series string)
passed (series bool)
bar (series int)
TestSuite
Fields:
isEnabled (series bool)
name (series string)
description (series string)
tests (array)
TestSession
Fields:
suites (array)
RTC EMA/SMA Combo IndicatorRTC Combo indicator with 20 EMA, 50 EMA and 200 SMA
Primarily used for Market Structure purpose
MA20 & MA50 RisingMA20 & MA50 Rising Scanner
Detects when both the 20-period and 50-period simple moving averages turn upward on the most recent bar. Designed as a lightweight screener column for TradingView’s watchlists.
Overview
This indicator plots a binary flag (0 or 1) per symbol, where
- 1 means SMA(20) > SMA(20) and SMA(50) > SMA(50)
- 0 means one or both moving averages did not rise
Add it as a custom column in your watchlist to instantly surface stocks with both short- and medium-term trend acceleration.
How It Works
- Calculates ma20 = simple moving average of the last 20 closes
- Calculates ma50 = simple moving average of the last 50 closes
- Compares each with its prior value (ma20 and ma50 )
- Sets flag to 1 only when both are higher than yesterday’s values
When you filter your watchlist for flag == 1, you see only symbols whose 20- and 50-period SMAs both rose on the latest bar.
Ajay Auto Pre-Market Gap + 3PM Signal (NIFTY/BANKNIFTY/SENSEX)Auto Pre-Market Gap + 3PM Signal (NIFTY/BANKNIFTY/SENSEX)
Big Candle Alert (Body Only + Strict Breakout)Beta script for assessing candle breakout strength relative to previous candles (thanks Chat GPT). Use in accordance with volume heat map