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).
Indicateurs et stratégies
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
Multi-Period SMA - flack0xA comprehensive moving average indicator featuring 7 fully customizable SMA periods designed for multi-timeframe trend analysis. Perfect for traders who want to visualize multiple moving average periods simultaneously without cluttering their charts with separate indicators.Key Features:
7 Independent SMAs with default periods: 2, 3, 9, 27, 81, 243, 2187
Individual Customization - Each SMA has its own period, color, line width, and visibility controls
Smart Defaults - Shorter SMAs use thinner lines, longer SMAs use thicker lines for visual hierarchy
Overlay Design - Properly overlays on price data without Y-axis attachment issues
Alert System - Built-in crossover alerts for key SMA levels (9 and 27 period)
Plot_4_Key_LevelsBollinger Bands (upper & lower)
- computes 12-bar Bollinger Bands on the chart’s current timeframe, with a 3σ (standard-deviation) multiplier.
- computes vwap
- computes VWMA(HL2, 36)—a smoothed, volume-weighted average price—plotted as a line.
Trajectory Channel (VWAP Highs/Lows) [Euler-Inspired]VPWA higha nd low Euler trajectory inspired script
Adaptive FoS LibraryThis library provides Adaptive Functions that I use in my scripts. For calculations, I use the max_bars_back function with a fixed length of 200 bars to prevent errors when a script tries to access data beyond its available history. This is a key difference from most other adaptive libraries — if you don’t need it, you don’t have to use it.
Some of the adaptive length functions are normalized. In addition to the adaptive length functions, this library includes various methods for calculating moving averages, normalized differences between fast and slow MA's, as well as several normalized oscillators.
XAUUSD/SPX Slope IndicatorThe XAUUSD/SPX Slope Indicator for TradingView calculates the slope of the XAUUSD (Gold) to SPX (S&P 500) ratio using linear regression over a customizable lookback period (default 20 bars). It plots the slope to show whether Gold is outperforming or underperforming the S&P 500, with a positive slope indicating Gold's strength and a negative slope favoring stocks. A zero line and color-coded background (green for positive, red for negative) enhance readability, making it a useful tool for analyzing relative market trends. Ensure your platform supports XAUUSD and SPX symbols.
RSI SMA ColorRSI 14 with SMA 21 Color. A momentum oscillator that measures the speed and change of price movements. It ranges from 0 to 100 and is typically used to identify overbought or oversold conditions in a market. An RSI above 70 may indicate that an asset is overbought, while an RSI below 30 may suggest it is oversold.
ETFs Sector PerformanceDisplays a table of the Top 8 performing ETFs over a selected period (1M / 2M / 3M / 6M) to quickly identify industry strength.
Pre-Set Universe (39 ETFs)
ITA — iShares U.S. Aerospace & Defense ETF
DBA — Invesco DB Agriculture Fund
BOTZ — Global X Robotics & Artificial Intelligence ETF
JETS — U.S. Global Jets ETF
XLB — Materials Select Sector SPDR Fund
XBI — SPDR S&P Biotech ETF
PKB — Invesco Dynamic Building & Construction ETF
ICLN — iShares Global Clean Energy ETF
SKYY — First Trust Cloud Computing ETF
DBC — Invesco DB Commodity Index Tracking Fund
XLY — Consumer Discretionary Select Sector SPDR Fund
XLP — Consumer Staples Select Sector SPDR Fund
BLOK — Amplify Transformational Data Sharing ETF
KARS — KraneShares Electric Vehicles & Future Mobility ETF
XLE — Energy Select Sector SPDR Fund
ESPO — VanEck Video Gaming and eSports ETF
XLF — Financial Select Sector SPDR Fund
PBJ — Invesco Dynamic Food & Beverage ETF
ITB — iShares U.S. Home Construction ETF
XLI — Industrial Select Sector SPDR Fund
PAVE — Global X U.S. Infrastructure Development ETF
PEJ — Invesco Dynamic Leisure & Entertainment ETF
LIT — Global X Lithium & Battery Tech ETF
IHI — iShares U.S. Medical Devices ETF
XME — SPDR S&P Metals & Mining ETF
FCG — First Trust Natural Gas ETF
URA — Global X Uranium ETF
PPH — VanEck Pharmaceutical ETF
QTUM — Defiance Quantum Computing & Machine Learning ETF
IYR — iShares U.S. Real Estate ETF
XRT — SPDR S&P Retail ETF
SOXX — iShares Semiconductor ETF
BOAT — SonicShares Global Shipping ETF
IGV — iShares Expanded Tech-Software Sector ETF
TAN — Invesco Solar ETF
SLX — VanEck Steel ETF
IYZ — iShares U.S. Telecommunications ETF
IYT — iShares U.S. Transportation ETF
XLU — Utilities Select Sector SPDR Fund
Bot Analyzer📌 Script Name: Bot Analyzer
This TradingView Pine Script v5 indicator creates a dashboard table on the chart that helps you analyze any asset for running a martingale grid bot on futures.
🔧 User Inputs
TP % (tpPct): Take Profit percentage.
SO step % (soStepPct): Step size between safety orders.
SO n (soCount): Number of safety orders.
M mult (martMult): Martingale multiplier (how much each next order increases in size).
Lev (leverage): Leverage used in futures.
BB len / BB mult: Bollinger Bands settings for measuring channel width.
ATR len: ATR period for volatility.
HV days: Lookback window (days) for Historical Volatility calculation.
📐 Calculations
ATR % (atrPct): Normalized ATR relative to price.
Bollinger Band width % (bbPct): Market channel width as percentage of basis.
Historical Volatility (hvAnn): Annualized volatility, calculated from daily log returns.
Dynamic Step % (dynStepPct): Step size for safety orders, automatically adjusted from ATR and clamped between 0.3% and 5%.
Covered Move % (coveredPct): Total percentage move the bot can withstand before last safety order.
Martingale Size Factor (sizeFactor): Total position size multiplier after all safety orders, based on martingale multiplier.
Risk Score (riskLabel): Simple risk estimate:
Low if risk < 30
Mid if risk < 60
High if risk ≥ 60
📊 Output (Table on Chart)
At the top-right of the chart, the script draws a table with 9 rows:
Metric Value
BB % Bollinger Band width in %
HV % Historical Volatility (annualized %)
TP % Take profit setting
SO step % Safety order step size
SO n Number of safety orders
M mult Martingale multiplier
Dyn step % Dynamic step based on ATR
Size x Total position size factor (e.g., 4.5x)
Risk Risk label (Low / Mid / High)
⚙️ Use Case
Helps choose coins for a martingale bot:
If BB% is wide and HV% is high → the asset is volatile enough.
If Risk shows "High" → parameters are aggressive, you may need to adjust step size, SO count, or leverage.
The dashboard lets you compare assets quickly without switching between multiple indicators.
TRAPPER TRENDLINES — RSIBuilds dynamic RSI trendlines by connecting the two most recent confirmed RSI swing points (highs→highs for resistance, lows→lows for support). Includes optional channel shading for the 30–70 zone, an RSI moving average, clean break alerts, and simple bullish/bearish divergence alerts versus price.
How it works
RSI pivots: A point on RSI is a swing high/low only if it is the most extreme value compared with a set number of bars on the left and the right (the Pivot Lookback).
RSI trendlines:
Resistance connects the last two confirmed RSI swing highs.
Support connects the last two confirmed RSI swing lows.
Lines can be Full Extend (update into the future) or Pivot Only.
Channel block: Optional fill of the 30–70 range for fast visual context.
Alerts:
Breaks of RSI support/resistance trendlines.
Basic bullish/bearish RSI divergences versus price pivots.
Inputs
RSI
RSI Length: Default 14 (standard).
Pivot Lookback: Bars to the left/right required to confirm an RSI swing.
Overbought / Oversold: 70 / 30 by default.
Line Extension: Full Extend or Pivot Only.
Visuals
Show RSI Moving Average / Signal Length: Optional smoothing line on RSI.
RSI/Signal colors: Customize plot colors.
Show 30–70 Channel Block: Toggle the middle-zone fill.
Tint pane background when RSI in channel: Optional subtle background when RSI is between OB/OS.
Divergences & Alerts
Enable RSI TL Break Alerts: Alert conditions for RSI line breaks.
Enable Divergence Alerts: Bullish/Bearish divergence alerts versus price.
Pairing with price for confluence/divergence
For accurate confluence and clearer divergences, align this RSI tool with your price trendline tool (for example, TRAPPER TRENDLINES — PRICE):
Set RSI Pivot Lookback equal to the Pivot Left/Right size used on price.
Example: Price uses Pivot Left = 50 and Pivot Right = 50 → set RSI Pivot Lookback = 50.
Keep RSI Length = 14 and OB/OS = 70/30 unless you have a specific edge.
Interpretation:
Confluence: Price reacts at its trendline while RSI reacts at its own line in the same direction.
Divergence: Price makes a higher high while RSI makes a lower high (bearish), or price makes a lower low while RSI makes a higher low (bullish), using matched pivot windows.
Suggested settings
Higher timeframes (4H / 1D / 1W): Pivot Lookback = 50; optional RSI MA length 14; channel block ON.
Intraday (15m / 30m / 1H): Pivot Lookback = 30; optional RSI MA length 14.
Always mirror your price pivot size to this RSI Pivot Lookback for consistent swings.
Reading the signals
RSI trendline touch/hold: Momentum reacting at structure; look for confluence with price levels.
RSI Trendline Break Up / Down: Momentum shift; consider price structure and retests.
Bullish/Bearish Divergence: Confirm only when pivots are matched and the new swing is confirmed.
Notes & limitations
Pivots require future bars to confirm by design; trendlines update as new swings confirm.
Divergence logic compares RSI pivots to price pivots with the same lookback; mismatched windows can produce false positives.
No strategy entries/exits or performance claims are provided. This is an analytical tool.
Alerts (titles/messages)
RSI: Trendline Break Up — “RSI broke falling resistance line.”
RSI: Trendline Break Down — “RSI broke rising support line.”
RSI: Bullish Divergence — “Bullish RSI divergence confirmed.”
RSI: Bearish Divergence — “Bearish RSI divergence confirmed.”
Quick start
Add the indicator to a separate pane.
Set Pivot Lookback to match your price tool’s pivot size (e.g., 50).
Optionally toggle the RSI MA and Channel Block for clarity.
Enable alerts if you want notifications on RSI line breaks and divergences.
Use with TRAPPER TRENDLINES — PRICE or any price-based trendline tool for confluence/divergence analysis.
Compliance
This script is for educational purposes only and does not constitute financial advice. Trading involves risk. Past performance does not guarantee future results. No performance claims are made.
Zenova1. Key Levels (Daily Reference Levels)
Previous Day High
Previous Day Low
Midpoint = (High + Low) ÷ 2
These are plotted with clouds:
Green fill above Mid (High → Mid).
Red fill below Mid (Mid → Low).
Midpoint is shown as a yellow cross line.
Only today’s levels are shown (current day only).
2. Indicators
RSI (14)
Z-Score (lookback = 75 by default, configurable)
Z-Score Moving Average (SMA of Z-Score, same length as Z-Score lookback)
3. Daily Flags
Two internal “flags” are used to confirm reversal conditions:
hadOBAbove → set when RSI ≥ 70 and price is above Midline.
hadOSBelow → set when RSI ≤ 30 and price is below Midline.
These flags reset at the start of each new trading day.
4. Sell Reversal (Short Entry Signal)
A Sell Reversal is triggered when:
RSI previously went overbought (≥ 70) above the Midline.
RSI crosses below 50.
Current open price is above Midline.
Z-Score < Z-Score MA.
✅ If true → plot SELL REVERSAL (red triangle above bar).
5. Buy Reversal (Long Entry Signal)
A Buy Reversal is triggered when:
RSI previously went oversold (≤ 30) below the Midline.
RSI crosses above 50.
Current open price is below Midline.
Z-Score > Z-Score MA.
✅ If true → plot BUY REVERSAL (green triangle below bar).
6. Notes
Only one signal per OB/OS event (flags reset daily).
Works intraday, signals based on previous day levels.
No PSAR or IFZ in this version — this is the clean base.
TRAPPER TRENDLINES — PRICEDraws dynamic trendlines on price by connecting the two most recent confirmed swing points (highs to highs for resistance, lows to lows for support). Swings are defined with a symmetric left/right pivot window. Old anchors are ignored so lines stay attached to current structure. Optional break alerts are included.
How it works (plain language)
Pivots: A bar is a swing high (or low) only if it’s the most extreme point compared with a set number of bars on the left and the right.
Lines:
Support connects the last two confirmed swing lows.
Resistance connects the last two confirmed swing highs.
Lines can be extended right only or both left & right (toggle).
Recency filter: Only swings within the last N bars are kept. This avoids anchoring to very old pivots far from current price.
Alerts: Optional alerts fire when price closes above resistance or below support.
Inputs
Auto Settings
Auto pivot size by chart timeframe: When ON, the script picks a pivot size suitable for the current timeframe (you can scale it with Auto pivot multiplier). When OFF, the manual left/right inputs are used.
Auto pivot multiplier: Scales the auto pivot size (e.g., 1.5 makes pivots stricter).
Manual Pivots
Pivot Left / Pivot Right: Bars to the left/right required to confirm a swing. Example: Left=50 & Right=50 keeps only major swings.
Recency Filter
Use last N bars for pivots: Swings older than this window are discarded so trendlines stay relevant to current price.
Style
Support/Resistance color: Line colors.
Extend Left & Right: When ON, both endpoints extend; when OFF, lines extend to the right only.
Alerts
Enable Break Alerts: When ON, alert conditions are exposed:
Price: Break Up — close above resistance.
Price: Break Down — close below support.
Suggested settings
Higher timeframes (4H / 1D / 1W):
Manual: Pivot Left = 50, Pivot Right = 50, Use last N bars = 400–800.
Or enable Auto with Auto pivot multiplier = 1.0–1.5.
Intraday (15m / 30m / 1H):
Manual: Pivot Left = 30, Pivot Right = 30, Use last N bars = 300–500.
Or enable Auto with multiplier ≈ 1.0–1.2.
Pairing with RSI for confluence/divergence
This tool is designed to pair with a companion TRAPPER TRENDLINES — RSI (or any RSI trendline script):
To mirror swings, set RSI Pivot Lookback equal to the price Pivot Left/Right you use here.
Example: Price = 50/50 → RSI Pivot Lookback = 50.
Keep RSI at Length 14 with 70/30 channel for clarity.
Confluence: Price holds/rejects at a trendline while RSI trendline agrees.
Divergence: Price prints a higher high (resistance line rising) while RSI prints a lower high (RSI resistance line falling), or vice-versa for lows. Matching pivot windows makes these relationships clear and reduces false signals.
Reading the signals
Trendline touch/hold: Potential reaction area; wait for follow-through.
Break Up / Break Down (alerts): Close beyond the line. Consider retest behavior, higher-timeframe context, and volume/RSI confirmation.
Notes & limitations
Pivots require future bars to confirm (by design). Lines update as pivots confirm.
“Use last N bars” purposely ignores very old swings. Increase this value if you need legacy structure.
Lines are based on two most recent confirmed pivots per side; rapidly changing markets can replace anchors as new swings confirm.
This is a visual/analytical tool. No strategy entries/exits or performance claims are provided.
Compliance
This script is for educational purposes only and does not constitute financial advice. Trading involves risk. Past results do not guarantee future outcomes. No promises of profit, accuracy, or performance are made.
Alerts (titles/messages)
Price: Break Up — “Price broke above resistance trendline.”
Price: Break Down — “Price broke below support trendline.”
Quick start
Add the indicator to your chart.
Choose Auto or set Pivot Left/Right manually.
Set Use last N bars for how far back to consider swings.
Toggle Extend Left & Right to your preference.
(Optional) Add your RSI trendline indicator and match Pivot Lookback with your price pivot size for clean confluence/divergence.
Enable alerts if you want notifications on breaks.
Simplified Market ForecastSimplified Market Forecast Indicator
This indicator pairs nicely with the Contrarian 100 MA and can be located here:
Overview
The "Simplified Market Forecast" (SMF) indicator is a streamlined technical analysis tool designed for traders to identify potential buy and sell opportunities based on a momentum-based oscillator. By analyzing price movements relative to a defined lookback period, SMF generates clear buy and sell signals when the oscillator crosses customizable threshold levels. This indicator is versatile, suitable for various markets (e.g., forex, stocks, cryptocurrencies), and optimized for daily timeframes, though it can be adapted to other timeframes with proper testing. Its intuitive design and visual cues make it accessible for both novice and experienced traders.
How It Works
The SMF indicator calculates a momentum oscillator based on the price’s position within a specified range over a user-defined lookback period. It then smooths this value to reduce noise and plots the result as a line in a separate lower pane. Buy and sell signals are generated when the smoothed oscillator crosses above a user-defined buy level or below a user-defined sell level, respectively. These signals are visualized as triangles either on the main chart or in the lower pane, with a table displaying the current ticker and oscillator value for quick reference.
Key Components
Momentum Oscillator: The indicator measures the price’s position relative to the highest high and lowest low over a specified period, normalized to a 0–100 scale.
Signal Generation: Buy signals occur when the oscillator crosses above the buy level (default: 15), indicating potential oversold conditions. Sell signals occur when the oscillator crosses below the sell level (default: 85), suggesting potential overbought conditions.
Visual Aids: The indicator includes customizable horizontal lines for buy and sell levels, shaded zones for clarity, and a table showing the ticker and current oscillator value.
Mathematical Concepts
Oscillator Calculation: The indicator uses the following formula to compute the raw oscillator value:
c1I = close - lowest(low, medLen)
c2I = highest(high, medLen) - lowest(low, medLen)
fastK_I = (c1I / c2I) * 100
The result is smoothed using a 5-period Simple Moving Average (SMA) to produce the final oscillator value (inter).
Signal Logic:
A buy signal is triggered when the smoothed oscillator crosses above the buy level (ta.crossover(inter, buyLevel)).
A sell signal is triggered when the smoothed oscillator crosses below the sell level (ta.crossunder(inter, sellLevel)).
Entry and Exit Rules
Buy Signal (Blue Triangle): Triggered when the oscillator crosses above the buy level (default: 15), indicating a potential oversold condition and a buying opportunity. The signal appears as a blue triangle either below the price bar (if plotted on the main chart) or at the bottom of the lower pane.
Sell Signal (White Triangle): Triggered when the oscillator crosses below the sell level (default: 85), indicating a potential overbought condition and a selling opportunity. The signal appears as a white triangle either above the price bar (if plotted on the main chart) or at the top of the lower pane.
Exit Rules: Traders can exit positions when an opposite signal occurs (e.g., exit a buy on a sell signal) or based on additional technical analysis tools (e.g., support/resistance, trendlines). Always apply proper risk management.
Recommended Usage
The SMF indicator is optimized for the daily timeframe but can be adapted to other timeframes (e.g., 1H, 4H) with careful testing. It performs best in markets with clear momentum shifts, such as trending or range-bound conditions. Traders should:
Backtest the indicator on their chosen asset and timeframe to validate signal reliability.
Combine with other indicators (e.g., moving averages, support/resistance) or price action for confirmation.
Adjust the lookback period and buy/sell levels to suit market volatility and trading style.
Customization Options
Intermediate Length: Adjust the lookback period for the oscillator calculation (default: 31 bars).
Buy/Sell Levels: Customize the threshold levels for buy (default: 15) and sell (default: 85) signals.
Colors: Modify the colors of the oscillator line, buy/sell signals, and threshold lines.
Signal Display: Toggle whether signals appear on the main chart or in the lower pane.
Visual Aids: The indicator includes dotted horizontal lines at the buy (green) and sell (red) levels, with shaded zones between 0–buy level (green) and sell level–100 (red) for clarity.
Ticker Table: A table in the top-right corner displays the current ticker and oscillator value (in percentage), with customizable colors.
Why Use This Indicator?
The "Simplified Market Forecast" indicator provides a straightforward, momentum-based approach to identifying potential reversals in overbought or oversold markets. Its clear signals, customizable settings, and visual aids make it easy to integrate into various trading strategies. Whether you’re a swing trader or a day trader, SMF offers a reliable tool to enhance decision-making and improve market timing.
Tips for Users
Test the indicator thoroughly on your chosen asset and timeframe to optimize settings.
Use in conjunction with other technical tools for stronger trade confirmation.
Adjust the buy and sell levels based on market conditions (e.g., lower levels for less volatile markets).
Monitor the ticker table for real-time oscillator values to gauge market momentum.
Happy trading with the Simplified Market Forecast indicator!