ScalpMaster Pro AIScalpMaster Pro AI is a precision-built AI-powered trading indicator designed for scalpers and intraday traders. It combines multiple high-probability strategies like:
Göstergeler ve stratejiler
Hedgefond Manager LONG&Short Script-Beschreibung: BTCUSDT.P Long/Short Event Marker (OI + CVD Analyse)
Dieses Script identifiziert und markiert signifikante Long- und Short-Aktivitäten auf Basis von Preisbewegung, Open Interest (OI) und kumulativem Volumen Delta (CVD). Die Logik kombiniert Orderflow-Analyse mit Open Interest Dynamik, um zu erkennen, ob Positionen aggressiv eröffnet oder geschlossen werden – ein wertvolles Signal für diskretionäre Trader und systematische Strategien.
🔍 Hauptfunktionen:
Preis + OI Events: Erkennt, ob Longs oder Shorts geöffnet oder geschlossen werden (durch Vergleich von Preisrichtung und OI-Veränderung).
OI + CVD Events: Präzisere Differenzierung aggressiver Käufer vs. Verkäufer durch Korrelation von Open Interest und CVD-Verhalten.
Visualisierung im Chart: Klar beschriftete Zonen im Chart zeigen, wo Akkumulation, Distribution oder Liquidationen stattfinden – inklusive Preisniveaus.
Intraday bis Swing einsetzbar: Funktioniert auf mehreren Zeitebenen, ideal für 15M 30 M1H, 4H, 1D Setups.
📈 Beispiel-Interpretation:
📉 Longs schließen bei steigenden Preisen: Zeichen für Distribution → potenzielle Short-Möglichkeit.
📈 Shorts öffnen bei fallenden Preisen: Bestätigung für Downtrend-Fortsetzung → Trendfolge.
⚙️ Anwendung:
Unterstützt taktisches Entry-Management an Schlüssel-Liquiditätszonen.
Kompatibel mit manuellem oder algorithmischem Trading.
Optimal in Kombination mit Market Structure, S/R und Volumenprofil-Tools.
ATR (14) Watermark📈 ATR (14) Watermark – Volatility Snapshot on Your Chart
This lightweight overlay displays the ATR (14) value and its percentage of the current price directly on your chart — along with a visual cue (🔴🟡🟢) to indicate volatility levels.
🔧 Features:
ATR (14) value and percentage of current price
🔴 High, 🟡 Medium, 🟢 Low volatility indicator
Adjustable vertical & horizontal positioning
Fully configurable text size and color
Clean, unobtrusive table watermark overlay
This tool is perfect for traders who want to quickly assess volatility without crowding the chart with lines or indicators.
TTT Premium / DiscountThis is just another FVG plotter from ICT. Better one to come soon. TV wants me to add more text on how this works.
langjiezhutuzhibiao🔔 Simple. Accurate. Reliable.
This script provides clear BUY/SELL signals directly on the chart without clutter. Designed for traders who prefer clean visuals and decisive entries/exits, it filters out noise and focuses on what truly matters: timing.
🚀 Key Features
Auto-generated BUY/SELL labels at key turning points
Minimalist chart – no messy lines, just actionable signals
Works across markets: US stocks, crypto, Hong Kong, A-shares
Integrates with momentum tools like MACD and RSI for enhanced accuracy
🔐 Source code is fully encrypted.
Users can apply it, but cannot view or edit the code
Only authorized users will receive access
📩 To request access or get the full Langjie Trading System
(including: Trend Channel + Energy Terrain + Buy/Sell Signal Tools), contact:
👉 WeChat: +8617700633126
👉 Email: realoverlogic@gmail.com
👉 Telegram: @ZeoZhu250
📌 本脚本为「浪姐团队」独家研制的趋势识别系统,专注买卖点提示,不显示任何干扰信息,适合注重简洁信号操作的交易者使用。
🚦【核心功能】
自动捕捉关键买入/卖出信号,精准标注于K线图中;
避免多余线段与图形干扰,仅提供最核心的决策提示;
适配各类交易标的:美股、A股、港股、币圈通用;
结合底部动能指标(MACD、浪姐RSI),信号更具参考价值。
🔐 本脚本源码加密不可见,仅限授权用户使用
微信: +8617700633126
Standard Deviation ExpectationStandard Deviation Expectation
- First off I want to thank and give credit to #Stockmarketupdate for introducing this idea to me while stumbling across his script for plotting the standard deviation above each candle/price.
Applying Standard Deviation Expectation can aide traders with insight to price projection, expectation, as well as, give hint to price exhaustion.
This indicator helps you identify dynamic support and resistance levels based on price volatility — specifically using standard deviation — on your chosen time frame or a higher time frame (multi-time frame).
It calculates a range around recent price action that adapts based on how volatile the market is.
It plots three lines:
Resistance line (upper boundary)
Support line (lower boundary)
Mid-line (middle of support and resistance)
It colors the area between support and resistance green or red depending on whether the current price is above or below the mid-line.
It alerts you when price crosses the mid-line either upward or downward.
Explanation of Components
Standard deviation is a statistical measure that tells you how much prices vary from the average.
This script calculates Standard Dev. on a selected price source (usually close price) over a specified length (default 8 bars).
Then it multiplies this by a “multiplier” (default 1.75) to set how wide the expected range should be.
More volatility → wider range; less volatility → tighter range.
2. Multi-Timeframe (MTF) Input
You can select a different timeframe (like 1H, 4H, daily) to base calculations on, even if you’re viewing a lower timeframe chart (like 15 min).
This helps smooth out noise and get more meaningful levels from higher timeframes.
3. Calculating Deviation High and Low
Based on whether the higher timeframe candle is bearish or bullish, the indicator adjusts the expected high and low by adding or subtracting the standard deviation.
This creates a dynamic “band” or range around the price on the higher timeframe.
4. Support and Resistance Lines
It calculates the highest deviation high and the lowest deviation low over a look-back period.
Then it smooths these extremes using an Exponential Moving Average (EMA) to avoid choppy lines.
The result is two smooth, adaptive lines — resistance and support.
5. Mid-line
Simply the average of the support and resistance lines.
Acts as a pivot or equilibrium point between support and resistance.
6. Offset
Allows you to shift the lines forwards by a number of bars, which can help with visual alignment or back-testing.
7. Color Fill
The space between support and resistance is filled with a transparent green color if price is above the midline, red if below.
This gives a quick visual cue of bullish or bearish bias.
8. Alerts on Midline Cross
The indicator generates alert conditions when price crosses the midline:
Crosses above → possible bullish sign
Crosses below → possible bearish sign
You can set alerts in Trading-view using these to get notified.
*Don’t rely solely on this indicator. Use it alongside price action and other indicators.
Play with the multiplier and length inputs to see what fits your trading style and the asset’s volatility.
The multi-time frame option is powerful — try using daily or 4H on a 15-min chart to get smoother levels.
Use alerts for mid-line crosses to help you catch potential trade setups without staring at the screen constantly. *
Disclaimer: The information contained in this script does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, back-test, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
This script was produced for educational purposes!
Enjoy!
Ai BTC Signal Sell & Whales / liquidation - Strategy [Ai Whales]Dear trader,
Professional analysts participated in the development and artificial intelligence was introduced to adapt Sell signals to the modern, constantly changing and highly volatile BTCUSD market, as well as taking into account the presence and actions of large institutional players - the so-called "sales whales". This strategy is an analogue and continuation of another script for buying Bitcoin (Ai BTC Signals Buy & Whales / Liquidation - Strategy ), only this script shows only signals for selling / manipulations and liquidating traders who opened short positions. The strategy allows you to instantly evaluate any configuration that you set in the indicator and see the results reflected in professional performance indicators corresponding to the strategy you have chosen.
The indicator displays several signals on the chart:
1) Sell signal (not buy signals)
2) Take profit line and price
3) Stop loss line and price
4) Manipulations and liquidations observed in the market
5) Whale activity - sell with small, medium and large volumes
The indicator does not repaint, since it is based on displaying signals only after the candle closes, so the calculations are correct and not distorted.
Recommended pair: BTCUSD ; BTCUSDT ; BTCUSDTP etc. The indicator can show R / R - 0.5:1 1:1 1:2 1:3 1:4
Recommended timeframes for use: from 4 hours to 1 week, ideally - 1 day. However, you can experiment with other close timeframes.
Possible trading modes: spot or futures.
Some methods used in the calculations of the indicator:
- statistical patterns that have the ability to repeat in the future. Bitcoin cycles in different market phases, which also have the ability to repeat and are included in the indicator,
- miner capitulation and hash rate are also taken into account by the indicator,
- candle volumes and their deltas are taken into account in the calculations,
- as well as other bases such as RSI and its divergence, EMA crossing of various configurations, etc.
**How the strategy calculates positions:**
The position is opened at the Sell signal level and is fixed at the level of the thick blue line, which serves as the main target of the take profit. Pyramiding (adding to positions) can be enabled in the settings.
The size of each position is adjusted through the settings. It is important that each signal creates its own take profit lines. When pyramiding is enabled, all positions are eventually closed at the nearest take profit level generated by any of the pyramiding signals. This approach minimizes potential losses if the price does not reach the initially set maximum take profit levels; the strategy closes positions at the nearest available take profit level. This conservative method of the strategy reduces risk, although ideally each position in the pyramid should be closed at an individual take profit level, which will lead to even better results with deep backtesting.
The strategy includes alerts that can be customized depending on the capabilities of your platform. Alerts are triggered on the chart when Sell or Whale signals are detected.
**Settings overview:**
- Inside the strategy: default platform settings.
- Inside the indicator there are several filters:
1) allows traders to choose display modes
2) enter positions based on the market phase - rising or falling
3) can also choose whether to trade after manipulations and liquidations
4) can also choose whether to trade after whale activity (small, medium or large number of selling whales).
You can manually adjust the take profit and stop loss levels with simple method selections, making them flexible yet user-friendly. The indicator offers three main styles:
- "Universal" (standard levels)
- "Aggressive"
- "Conservative"
**Results and caveats:**
Deep backtesting from the first day of Bitcoin listing on various exchanges under certain conditions (no liquidations, certain settings) showed a maximum drawdown of about 4-15%, with the final return approaching more than 7000% and a WinRate of 95-100%. However, it is important to understand that such impressive past results do not guarantee future results.
If you are serious about your investments, remember that geopolitical events, institutional shifts, or other unforeseen factors can significantly affect the price of Bitcoin or even its existence. Unfortunately, the AI has not yet learned to fully take these macroeconomic conditions into account in its adaptive mechanisms.
Trade wisely and use this powerful tool responsibly.
Best wishes,
Demand & Supply Zones with all zonesi classifies the candles into low probability and high probability zones which are used to identify the big players money in the charts
MaYA Maths V4This tool is built by using cosmic vibration numbers and incorporating the same alongwith moving averages, stochastics and rsi.
A SINGLE TOOL THAT HELPS YOU TO CHOOSE YOUR TRADING STYLE AND DISHA IS THE TOOL WHICH CAN BE APPLIED ON ALL TIME FRAMES
GUIDE TO COSMIC MATH TOOL
• Options Strategy
• This tool works on the vibration of number “3”.
• This tool is a option buying strategy
• It works best on M3 time frame with index options
• Choose the nearest strike price based on the close of first M3 candle on the spot (both CE and PE)
• Ensure that the close on the options M3 candle, both CE and PE are as near to each other as possible. One will need to adjust either one of the strike prices to achieve the same.
• Close of price above BULLS line on one of the strikes must be complimented by a close below BEARS line on the opposite strike. If this does not happen at the same time candle, wait for this condition to be met.
• Check if there is a valid Buy signal preceding or on the time candle that closes above BULLS line.
• Once above condition is met, take the trade at the BULLS line. Targets are defined.
• Ideal stoploss is 7% from BULLS line.
• Breakout Level Strategy :
o This tool works best with M5 timeframe (alternatively M3).
o Best suitable to understand the direction of the financial asset.
o If price is between white and green line, the inference is rangebound with bearish bias. If price breaks below green line, bearish view can be taken. Check for the Sell signal and take trades in futures or corresponding options.
o If price is between white and red line, the inference is rangebound with bullish bias. If price breaks above red line, bullish view can be taken. Check for Buy signal and take trades in futures or corresponding options.
o Targets are defined by grey lines.
• STORSI – Confirmation Indicator
o STORSI is to be used only as a confirmation indicator.
o It is used in combination with Options Strategy & Breakout Level Strategy.
o This can be used on any time frame.
o Example below shows the position of price with respect to STORSI and confirmation of trades.
• DISHA
o This is a tool, which gives real time buy and sell signals, with background paint to understand the general trend of the market.
o For BUY
Green Background
Yellow Candle
Preceding Buy Signals
Buy at Market at close of yellow candle
SL – Red Line
Look for 1:2 risk reward ratio or until you get a SELL signal
o For SELL
Red Background
White Candle
Preceding Sell Signals
Sell at market at close of white candle
SL – Green Line
Look for 1:2 risk reward ratio or until you get a BUY signal
o This tool can be used on all time frames. M2 timeframe suits best for Options trading (intraday). M5 for Futures trading (intraday). M15 for Futures and Stocks (Swing Trading). Daily timeframe for Positional trading.
Blaxks WatermarkPaging watermark for clear chart users, this allows one to input text to remind themselves of their plans, rule to be innovative during their trading sessions.
RSI‑MA Near‑Level AlertRSI‑MA Near‑Level Alert — Publication Description
Overview
RSI‑MA Near‑Level Alert plots a smoothed Relative Strength Index (RSI) line and sends automatic alerts whenever that line comes within a user‑defined distance of two key thresholds (default = 70 for overbought, 30 for oversold). It is designed for traders who want an early warning—before a classic 70/30 cross—so they can tighten stops, scale out, or prepare reversal setups.
How It Works
RSI Calculation – Uses the standard RSI (default length 14).
Smoothing – Applies a moving‑average (default Simple 10) to reduce noise.
Proximity Logic – On every bar, the script measures the absolute distance between the smoothed RSI line and each threshold.
If the distance ≤ the Proximity setting (default 1 point), the condition flips to true.
Built‑in Alert Triggers – Two alertcondition() calls are embedded:
“RSI MA near UPPER level”
“RSI MA near LOWER level”
Select either one (or both) from the TradingView alert dialog and choose your delivery method (popup, e‑mail, SMS, webhook).
Inputs
Input Default Purpose
RSI Length 14 Core momentum look‑back.
Smoothing MA Length 10 Length of the MA applied to RSI.
Upper Level 70 Overbought line.
Lower Level 30 Oversold line.
Alert Proximity (points) 1.0 How close (in RSI points) the MA must get to trigger.
All inputs are fully editable after you add the script to a chart.
Typical Use‑Cases
Pre‑emptive Exits – Get notified when momentum is stalling near 70 or 30 so you can lock in gains before a reversal.
Reversal Hunting – Combine the alert with price‑action patterns (pin bars, engulfing candles) for higher‑probability fades.
Breakout Confirmation – Increase Upper Level to 80 / Lower Level to 20 and lower Proximity to 0.5 for more aggressive trend‑following alerts.
Step‑by‑Step Alert Setup
Add the script to your chart.
Click the alarm‑clock‑plus icon (or press Alt + A).
In “Condition,” select RSI‑MA Near‑Level Alert.
Choose either RSI MA near UPPER level or RSI MA near LOWER level.
Pick Once Per Bar Close for confirmed signals or Once Per Bar for real‑time.
Select your preferred notification methods and click Create.
(Repeat for the opposite threshold.)
Customization Tips
Change Smoothing Type – Replace ta.sma() with ta.ema(), ta.rma(), etc., directly in the code if you prefer another MA.
Track Multiple Assets – Apply the indicator to each symbol in a multi‑chart layout and set independent alerts.
Narrow Range Play – Set Upper = 60, Lower = 40 and Proximity = 0.5 to monitor a quiet‑momentum band.
Disclaimer
This script is provided for educational purposes only. It does not constitute financial advice, and past performance is not indicative of future results. Always back‑test and validate on demo data before risking live capital. The author assumes no liability for trading losses or platform malfunctions.
TYSON / Risk EndThis indicator is specific to Risk End
The indicator highlights
1- Showing entry signals at reversals and after the completion of the candlesticks
2- Helps the trader to determine the immediate direction of the candles
3- Helps the trader to determine the safest entry areas (where the stop loss is small compared to the take profit) Ratio 3-1
Description
1- You can wait for the entry signal to appear (whether it is a buy or sell)
If the signal is consistent with your personal analysis, you can enter and commit to the goals and stop the loss
2- The indicator appears as an information panel on the right of the screen - showing you the general status of the indicator at every moment
3- When the buy or sell signal appears "This suggests that the accumulation process or the sideways trend has begun to end"
Here the seller or buyer will prevail by moving the candles
Settings
1- The default settings for buy and sell signals cannot be controlled
2- The indicator user can enable and disable some or all strategies
3- You can go into the settings and set the capital and specify the contract size and the dashboard will display
A study of the profit or loss that occurred during a specific previous period
This gives the trader a real-time study of the previous market movement
Recommendation
1- Remember that financial markets and trading are full of risks, so be careful in managing your capital and managing risks when executing any deal
2- You can rely on indicator signals, but the most important thing is commitment and then capital management
Comments
1- The free indicator works on the currency pair (EUR USD) ONLY
2- There is a paid version of the indicator that works on all Pairs, Commodities and Indices And it has many features
3- You can analyze the results on all pairs, commodities and indices on the free version.
(You can contact technical support)
For more information
warning
This indicator should not be relied upon only in trading (It only helps the trader to see the chart more clearly)
1- This indicator of buying and selling should not be relied upon only in trading (It only helps the trader to see sell signals , buy signals, momentum and liquidity)
Notes
1- The indicator is subject to continuous updating. “You will be notified in the event of any update.”
Asian and London Session Highs/LowsSession High/Low Range Indicator (SPX500 & NAS100)
This indicator plots the high and low price levels for two key trading sessions:
Asian Session: Draws horizontal lines marking the high and low between 01:00 and 10:00 EEST.
London Session: Draws horizontal lines marking the high and low between 10:00 and 16:30 EEST.
Designed specifically for SPX500 and NAS100, this tool helps traders identify key intraday support and resistance zones during the 16:30 – 17:30 EEST US trading window.
Additional Features:
Session range lines are automatically drawn and can be extended across the chart for clearer visual reference.
Useful for breakout, reversal, and range-trading strategies.
Trading Assistant Dingue [TAD] OscillatorsTAD Oscillators – Companion Indicator for Trading Assistant Dingue
TAD Oscillators is a complementary indicator built to work seamlessly with the Trading Assistant Dingue. They’re designed to be used together but can also function independently.
Because the Trading Assistant overlays directly on the chart, there’s no room to display the 8 built-in oscillators over the candles. This separate indicator solves that by plotting all those oscillators in a clean, dedicated panel below the chart.
It uses the exact same settings as the Trading Assistant, so you don’t need to re-enter parameters or wonder what values you're working with. This makes it much easier to tweak and build your own strategy. If you can't see your RSI or MACD, how can you optimize them?
🔧 Key Features
Auto-syncs with Trading Assistant Dingue settings
Plot one or multiple oscillators at once
Add reference levels (e.g., 80/20 for RSI, 0 for ROC or MACD)
Simple visual structure for easy tuning
Works standalone or as a Trading Assistant companion
📊 Included Oscillators
Each oscillator can be turned on/off individually and customized.
By Default, the RSI and STOCH are displayed with lines at 80 and 20:
RSI 1 & 2
Custom length for RSI and its moving average. Default display includes 80 and 20 reference lines.
Stochastic 1 & 2
Full control over K and D values, with individual moving averages. More common than RSI for many traders.
Volume
A custom-built indicator based on raw volume and a moving average. Line at 0 helps visualize direction shifts.
MACD 1 & 2
Standard MACD with full custom settings. Includes line at 0. Useful for divergence and momentum analysis.
ROC (Rate of Change) 1 & 2 + Average
A slightly adjusted ROC formula. You get two separate inputs and a third line that averages both.
ADX & DMI
Choose to display the three ADX versions and their DMI+ and DMI– components. Great for tracking trend strength.
Mayer Multiple
Less common, but helpful for identifying over-extended markets. Sourced from TradingView.
OBV (On Balance Volume)
Plots OBV with a zero line for quick confirmation of trend with volume.
These oscillators are built into the Trading Assistant, but can’t be displayed over price candles. That’s what this indicator solves. Use this tool to fine-tune your setup, confirm signals, or develop your own trading strategy visually and clearly.
Note: TAD Oscillators is completely free. Trading Assistant Dingue is a paid indicator, but you don’t need it to use this one.
🔍 Search “Trading Assistant Dingue” to try it free.
MTF 5 Big Candles [RanaAlgo]Overview
This Pine Script indicator displays multiple timeframe (MTF) candlesticks from 5 different timeframes on your current chart. It helps traders quickly assess higher timeframe price action without switching charts.
Key Features
5 Customizable Timeframes
Displays candles from user-selected timeframes (e.g., 15m, 30m, 1H, 4H, Daily).
Each candle is offset to avoid clutter.
Visual Customization
Adjustable spacing, width, and colors for bullish/bearish candles.
Option to show/hide wicks, OHLC labels, and price guide lines.
Clear Price Reference
Dotted guide lines extend from the current price to the MTF candles for easy comparison.
OHLC labels (optional) show exact price levels.
and u can also check the remainig time of candles ..
Usefulness
✅ Multi-Timeframe Analysis – Compare trends across different timeframes at a glance.
✅ Avoid Chart Switching – See higher timeframe structure while trading lower TFs.
✅ Identify Key Levels – Spot support/resistance from higher timeframe candles.
✅ Customizable Layout – Adjust spacing and styling to fit your trading style.
Best For
Swing & position traders analyzing multiple timeframes.
Day traders looking for confluence from higher TFs.
Traders who prefer visual candlestick patterns over plain lines.
This script is particularly useful for confirming trends, spotting reversals, and aligning entries with higher timeframe structure.
Structure Level IndicatorThis indicator draws solid lines to show Structure based levels as they form.
When those levels are no longer valid, they turn into dashed lines.
Use it to visualize market structure and spot areas of interest.
copper/goldThe Copper/Gold ratio is a macroeconomic indicator that reflects the market’s risk appetite and economic expectations.
Copper, often referred to as “Doctor Copper,” is closely tied to industrial growth and construction demand. Gold, on the other hand, is considered a safe-haven asset during times of uncertainty.
When the ratio rises, it suggests optimism about economic expansion. A declining ratio, however, may signal caution, stagnation, or even recessionary concerns.
This ratio is frequently used to confirm macro trends, evaluate inflation expectations, or assess bond yield directions.
Lucio Toolkit + LiquidityThis script is designed for trading assets like Nasdaq and Gold, offering a clear view of market trends using dynamic support and resistance indicators such as EMAs and VWAP.
It features Fair Value Gap (FVG) detection and key liquidity levels, helping traders pinpoint strategic zones for smarter entries and exits.
Ideal for those who want to combine advanced technical analysis with price structure-based decision-making.
AI Strat ATR Dinamico + ADX + Trend Adaptivo (No Repaint)Below is a fully self-contained, English-language description of every input, function, and logical block inside the “AI Strat ATR Dinamico + ADX + Trend Adaptivo (No Repaint)” indicator. You can copy and paste this into TradingView’s “Description” field when you publish, without exposing any Pine code.
---
## Indicator Name and Purpose
**Name (Short Title):**
AI Strat Adaptive v3 (NoRepaint)
**Overview:**
This indicator combines multiple technical tools—RSI, EMA, ATR (with a dynamic multiplier), ADX/DI, and an “AI‐style” scoring mechanism—to generate trend-filtered and reversal signals. It also optionally confirms signals on a higher timeframe, dynamically adjusts its sensitivity based on volatility, and plots intrabar stop‐loss (SL) and take‐profit (TP) levels derived from ATR. Special care has been taken to ensure that no signals “repaint” (i.e., once drawn on a closed bar, they never disappear or shift).
---
## 1. Main Inputs
All of the inputs appear in the Settings dialog for the published indicator. Below is a detailed explanation of each input, grouped by logical category.
### A. RSI & EMA Base Parameters
1. **RSI Length (Base)**
* **Input type:** Integer (default 14)
* **Description:** Number of bars used to calculate the Relative Strength Index (RSI). A shorter RSI reacts more quickly to price changes; a longer RSI is smoother.
2. **RSI Overbought Threshold**
* **Input type:** Integer (default 60)
* **Description:** If the RSI value rises above this level, it contributes a “sell” signal component. You can adjust this (e.g., 70) to make your system more conservative.
3. **RSI Oversold Threshold**
* **Input type:** Integer (default 40)
* **Description:** If the RSI falls below this level, it contributes a “buy” signal component. Raising this threshold (e.g., 50) makes the strategy more aggressive in seeking reversals.
4. **EMA Length (Base)**
* **Input type:** Integer (default 20)
* **Description:** Number of bars for the Exponential Moving Average (EMA). A shorter EMA will produce more frequent crossovers, a longer EMA is smoother.
### B. ATR & Volatility Filter Parameters
5. **ATR Length (Base)**
* **Input type:** Integer (default 14)
* **Description:** Number of bars to calculate Average True Range (ATR). The ATR is used both for measuring volatility and for dynamic SL/TP levels.
6. **ATR SMA Length**
* **Input type:** Integer (default 50)
* **Description:** Number of bars to compute a Simple Moving Average of the ATR itself. This gives a baseline of “normal” volatility. If ATR rises significantly above this SMA, the indicator treats the market as “high volatility.”
7. **ATR Multiplier Base**
* **Input type:** Float (default 1.2, step 0.1)
* **Description:** Base multiplier for ATR when filtering for volatility. The actual threshold is computed as `ATR_SMA × (ATR_Multiplier Base) × sqrt(current_ATR / ATR_SMA)`. In other words, the multiplier becomes larger if volatility is rising, and smaller if volatility is falling.
8. **Disable Volatility Filter**
* **Input type:** Boolean (default false)
* **Description:** If enabled (true), the indicator will ignore any volatility‐based filtering, using signals regardless of ATR behavior. If disabled (false), signals only fire when ATR > (ATR\_SMA × dynamic multiplier).
### C. Price-Change & “AI Score” Parameters
9. **Price Change Period (bars)**
* **Input type:** Integer (default 3)
* **Description:** The number of bars back to measure percentage price change. Used to ensure that a “trend” signal is accompanied by a sufficiently positive (for longs) or negative (for shorts) price movement over this many bars.
10. **Base AI Score Threshold**
* **Input type:** Float (default 0.1)
* **Description:** The indicator computes a composite “AI-style” score by combining the RSI signal (overbought/oversold) and an EMA crossover signal. Only if the absolute value of that composite score exceeds this threshold will a trend signal be eligible. Raising it makes signals rarer but (potentially) higher-conviction.
### D. SMA “ICT” Trend Filter Parameters
11. **ICT SMA Long Length (Base)**
* **Input type:** Integer (default 50)
* **Description:** Number of bars for the “long” Simple Moving Average (SMA) used in the internal trend filter. Typically, price must be above this SMA (and ADX must be strong) to confirm an uptrend, or below it (and ADX strong) to confirm a downtrend.
12. **ICT SMA Short1 Length (Base)**
* **Input type:** Integer (default 10)
* **Description:** Secondary “fast” SMA used both for reversal logic (e.g., price crossing above it can count as a bullish reversal) and part of the internal trend confirmation.
13. **ICT SMA Short2 Length (Base)**
* **Input type:** Integer (default 20)
* **Description:** A second “medium” SMA used for reversal triggers (e.g., crossovers or crossunders alongside RSI conditions).
### E. ADX & DI Parameters
14. **Base ADX Length**
* **Input type:** Integer (default 14)
* **Description:** Number of bars for the ADX (Average Directional Index) moving averages, which measure trend strength. The same length is used for +DI and –DI smoothing.
15. **Base ADX Threshold**
* **Input type:** Float (default 25.0, step 0.5)
* **Description:** If ADX > this threshold and +DI > –DI, we consider an uptrend; if ADX > this threshold and –DI > +DI, we consider a downtrend. Raising this value demands stronger trends to qualify.
### F. Sensitivity & Cooldown
16. **Sensitivity (0–1)**
* **Input type:** Float between 0.0 and 1.0 (default 0.5)
* **Description:** A general “mixture” parameter used internally to weight how aggressively the indicator leans into trend versus reversal. In practice, the code uses it to fine-tune exact thresholds for switching between trend and reversal conditions. You can leave it at 0.5 unless you want to bias more heavily toward either regime.
17. **Base Cooldown Bars Between Signals**
* **Input type:** Integer (default 5, min 0)
* **Description:** Once a long or short signal fires, the indicator will wait at least this many bars before allowing a new signal in the same direction. Prevents “signal flipping” on each bar. A higher number forces fewer, more spaced-out entries.
18. **Trend Confirmation Bars**
* **Input type:** Integer (default 3, min 1)
* **Description:** After the directional filters (+DI/–DI cross, price vs. SMA), the indicator still requires that price remains on the same side of the long SMA for at least this many consecutive bars before confirming “trend up” or “trend down.” Larger values smooth out false breakouts but may lag signals.
### G. Higher Timeframe Confirmation
19. **Use Higher Timeframe Confirmation**
* **Input type:** Boolean (default true)
* **Description:** If true, the indicator will request a block of values (SMA, +DI, –DI, ADX) from a higher timeframe (default 60 minutes) and require that the higher timeframe is also in agreement (strong uptrend or strong downtrend) before confirming your current-timeframe trend. This helps filter out lower-timeframe noise.
20. **Higher Timeframe (TF) for Confirmation**
* **Input type:** Timeframe (default “60”)
* **Description:** The chart timeframe (e.g., 5, 15, 60 minutes) whose trend conditions must also be true. It’s sent through a `request.security(..., lookahead=barmerge.lookahead_off)` call so that it never “paints ahead.”
### H. Dynamic TP/SL Parameters
21. **TP as ATR Multiple**
* **Input type:** Float (default 2.0, step 0.1)
* **Description:** When a trade is open, the “take-profit” price is determined by looking at the highest high (for longs) or lowest low (for shorts) observed since entry, and then plotting a cross (“X”) at that level when the trend finally flips. This is purely for display. However, separate from that, this parameter can be adapted if you want a strictly ATR–based TP. In the “Minimal” version, TP is ≈ (highest high) once trend inverts, but you could rewrite it to use `entry_price + ATR×TP_Multiplier`.
22. **SL as ATR Multiple**
* **Input type:** Float (default 1.0, step 0.1)
* **Description:** While in a trade, a trailing SL line is plotted each bar. Its value is always `entry_price ± (ATR × SL_Multiplier)`. When the trend inverts, the SL no longer updates, and you see it on the chart.
### I. Display and Mode Options
23. **Show Debug Lines**
* **Input type:** Boolean (default true)
* **Description:** When enabled, the indicator will plot all intermediate lines—ATR SMA, ATR Threshold, +DI, –DI, ADX (current and HTF), HTF SMA, etc.—so that you can diagnose exactly what’s happening. Turn this off to hide all debug information and only see entry/exit shapes.
24. **Enable Scalping Mode**
* **Input type:** Boolean (default false)
* **Description:** If true, many of the “base” parameters are halved (e.g., RSI length becomes 7 instead of 14, ATR length becomes 7 instead of 14, ADX length becomes 7, etc.), and the ADX threshold is multiplied by 0.8. This makes all oscillators and moving averages more reactive, suited for very short-term (scalping) setups.
---
## 2. Core Calculation Blocks
Below is a high-level description of each logical block (in code order), translated from Pine into conceptual steps.
### A. Adjust Inputs if “Scalping Mode” Is On
If **Scalping Mode** = true, then:
* `RSI_Length` becomes `max(1, round(Base_RSI_Length / 2))`
* `EMA_Length` becomes `max(1, round(Base_EMA_Length / 2))`
* `ATR_Length` becomes `max(1, round(Base_ATR_Length / 2))`
* `Price_Change_Period` becomes `max(1, round(Base_Price_Change_Period / 2))`
* `SMA_Long_Length`, `SMA_Short1_Length`, and `SMA_Short2_Length` are each halved (minimum 1).
* `ADX_Length` = `max(1, round(Base_ADX_Length / 2))`
* `ADX_Threshold` = `Base_ADX_Threshold × 0.8`
* `Cooldown_Bars` = `max(0, round(Base_Cooldown_Bars / 2))`
Otherwise, all adjusted lengths = their base values.
### B. RSI, EMA & “AI Score” on Current Timeframe
1. **Compute RSI:**
* Uses the (possibly adjusted) `RSI_Length`.
* Denote this as `RSI_Value`.
2. **Compute ATR & Its SMA:**
* `ATR_Value` = `ta.atr(ATR_Length)`.
* `ATR_SMA` = `ta.sma(ATR_Value, ATR_SMA_Length)`.
* Then define `Volatility_Increase` = (`ATR_Value > ATR_SMA`).
* If the volatility has increased, the weighting of RSI vs. EMA changes.
3. **Compute Weights:**
* If `Volatility_Increase == true`, then:
* `RSI_Weight = 0.7`
* `EMA_Weight = 0.3`
* Otherwise:
* `RSI_Weight = 0.3`
* `EMA_Weight = 0.7`
4. **RSI Signal Component (`RSI_Sig`):**
* If `RSI_Value > RSI_Overbought`, then `RSI_Sig = –1`.
* Else if `RSI_Value < RSI_Oversold`, then `RSI_Sig = +1`.
* Otherwise, `RSI_Sig = 0`.
5. **EMA Value & Signal Component (`EMA_Sig`):**
* `EMA_Value` = `ta.ema(close, EMA_Length)`.
* `EMA_Sig = +1` if the current close crosses **above** the EMA; `EMA_Sig = –1` if the current close crosses **below** the EMA; else `0`.
6. **Compute Raw “AI Score”:**
$$
Raw\_AI = (RSI\_Sig \times RSI\_Weight)\;+\;(EMA\_Sig \times EMA\_Weight)
$$
Then,
$$
AI\_Score = \frac{Raw\_AI}{(RSI\_Weight + EMA\_Weight)}
$$
(This normalization ensures the score always ranges between –1 and +1 if both weights sum to 1.)
### C. Dynamic ATR Multiplier & Volatility Filter
1. **Volatility Factor:**
$$
Volatility\_Factor = \frac{ATR\_Value}{ATR\_SMA}
$$
2. **Dynamic ATR Multiplier:**
$$
ATR\_Multiplier = ATR\_Multiplier\_Base \times \sqrt{Volatility\_Factor}
$$
3. **High Volatility Condition (`High_Volatility`):**
* If `Disable_Volatility_Filter == true`, then treat `High_Volatility = true` always.
* Else, `High_Volatility = (ATR_Value > ATR_SMA × ATR_Multiplier)`.
### D. Price Change Percentage
* **Compute Price Change:**
$$
Price\_Change = \frac{(Close - Close )}{Close } \times 100
$$
* This is the percent return from `Price_Change_Period` bars ago to now.
* For a valid long‐trend signal, we require `Price_Change > 0`; for a short trend, `Price_Change < 0`.
### E. Local SMAs for Trend/Reversal Filters
* `SMA_Close_Long` = `ta.sma(close, SMA_Long_Length)`.
* `SMA_Close_Short1` = `ta.sma(close, SMA_Short1_Length)`.
* `SMA_Close_Short2` = `ta.sma(close, SMA_Short2_Length)`.
These three SMAs help define the “local trend” and reversal breakout points:
* **Primary Trend Filter:**
* Price must be above `SMA_Close_Long` for an uptrend filter, or below `SMA_Close_Long` for a downtrend filter.
* **Reversal Filter:**
* A bullish reversal is detected if **(RSI < Oversold AND close crosses above EMA)** OR **(RSI < Oversold AND close crosses above SMA\_Close\_Short1)**.
* A bearish reversal is detected if **(RSI > Overbought AND close crosses below EMA)** OR **(RSI > Overbought AND close crosses below SMA\_Close\_Short1)**.
### F. Manual +DI, –DI & ADX on Current Timeframe
Instead of relying on the built-in `ta.adx`, the script calculates DI and ADX manually. This makes it easier to replicate the exact logic on a higher timeframe via `request.security`. The steps are:
1. **Directional Movement (DM) Components:**
* `Up_Move` = `high – high `
* `Down_Move` = `low – low`
* `Plus_DM` = `Up_Move` if (`Up_Move > Down_Move` AND `Up_Move > 0`), else `0`
* `Minus_DM` = `Down_Move` if (`Down_Move > Up_Move` AND `Down_Move > 0`), else `0`
2. **True Range (TR) Components:**
* `TR1` = `high – low`
* `TR2` = `abs(high – close )`
* `TR3` = `abs(low – close )`
* `True_Range` = `max(TR1, TR2, TR3)`
3. **Smoothed Averages (RMA):**
* `Sm_TR` = `ta.rma(True_Range, ADX_Length)`
* `Sm_Plus` = `ta.rma(Plus_DM, ADX_Length)`
* `Sm_Minus`= `ta.rma(Minus_DM, ADX_Length)`
4. **Compute DI%:**
$$
Plus\_DI = \frac{Sm\_Plus}{Sm\_TR} \times 100,\quad
Minus\_DI = \frac{Sm\_Minus}{Sm\_TR} \times 100
$$
5. **DX and ADX:**
$$
DX = \frac{|Plus\_DI - Minus\_DI|}{Plus\_DI + Minus\_DI} \times 100,\quad
ADX = ta.rma(DX, ADX_Length)
$$
These values are referred to as `(plus_di, minus_di, adx_val)` for the current timeframe.
---
## 3. Higher Timeframe (HTF) Confirmation Function
If **Use Higher Timeframe Confirmation** is enabled, the script calls a single helper (Pine) function `f_htf` with two parameters: the ADX length and the SMA length (both taken from the “base” or “scaled” values). Internally, `f_htf` simply reruns the manual DI/ADX logic (same as above) on the higher timeframe’s bar data, and also includes that timeframe’s closing price and its SMA for trend comparison.
* **Request.Security Call:**
```
= request.security(
syminfo.tickerid,
higher_tf,
f_htf(adx_length, sma_long_len),
lookahead=barmerge.lookahead_off
)
```
* `lookahead=barmerge.lookahead_off` ensures that no HTF value “paints” early; you always see only confirmed HTF bars.
* The returned tuple provides:
1. `ht_close` = HTF closing price
2. `ht_sma` = HTF SMA of length `sma_long_len`
3. `ht_pdi` = HTF +DI percentage
4. `ht_mdi` = HTF –DI percentage
5. `ht_adx` = HTF ADX value
---
## 4. Trend & Reversal Filters (Current & HTF)
### A. Current-Timeframe Trend Filter
1. **Uptrend\_Basic (Current TF)**
$$
(plus\_di > minus\_di)\;\land\;(adx\_val > ADX\_Threshold)\;\land\;(close > SMA\_Close\_Long)
$$
2. **Downtrend\_Basic (Current TF)**
$$
(minus\_di > plus\_di)\;\land\;(adx\_val > ADX\_Threshold)\;\land\;(close < SMA\_Close\_Long)
$$
3. **Trend Confirmation by Bars:**
* `Bars_Since_Below` = number of bars since `close <= SMA_Close_Long`.
* `Bars_Since_Above` = number of bars since `close >= SMA_Close_Long`.
* If `Uptrend_Basic == true` AND `Bars_Since_Below ≥ Trend_Confirmation_Bars` → mark `Uptrend_Confirm = true`.
* If `Downtrend_Basic == true` AND `Bars_Since_Above ≥ Trend_Confirmation_Bars` → mark `Downtrend_Confirm = true`.
### B. Reversal Filters (Current TF)
1. **Bullish Reversal (`Rev_Bullish`):**
* If `(RSI < RSI_Oversold AND close crosses above EMA_Value)` OR
`(RSI < RSI_Oversold AND close crosses above SMA_Close_Short1)`
→ then `Rev_Bullish = true`.
2. **Bearish Reversal (`Rev_Bearish`):**
* If `(RSI > RSI_Overbought AND close crosses below EMA_Value)` OR
`(RSI > RSI_Overbought AND close crosses below SMA_Close_Short1)`
→ then `Rev_Bearish = true`.
### C. Higher-Timeframe Trend Filter (HTF)
1. **HTF Uptrend (`HT_Uptrend`):**
$$
(ht\_pdi > ht\_mdi)\;\land\;(ht\_adx > ADX\_Threshold)\;\land\;(ht\_close > ht\_sma)
$$
2. **HTF Downtrend (`HT_Downtrend`):**
$$
(ht\_mdi > ht\_pdi)\;\land\;(ht\_adx > ADX\_Threshold)\;\land\;(ht\_close < ht\_sma)
$$
3. **Combine Current & HTF:**
* If **Use\_HTF\_Confirmation == true**, then:
* `Uptrend_Confirm := Uptrend_Confirm AND HT_Uptrend`
* `Downtrend_Confirm := Downtrend_Confirm AND HT_Downtrend`
* Otherwise, just use the current timeframe’s `Uptrend_Confirm` and `Downtrend_Confirm`.
4. **Define `CurrentTrend` (Integer):**
* `CurrentTrend = +1` if `Uptrend_Confirm == true`.
* `CurrentTrend = –1` if `Downtrend_Confirm == true`.
* Otherwise, `CurrentTrend = 0`.
5. **Reset “One Trade Per Trend”:**
* There is a persistent variable `LastTradeTrend`.
* Every time `CurrentTrend` flips (i.e., `CurrentTrend != CurrentTrend `), the code sets `LastTradeTrend := 0`.
* That allows one new entry once the detected trend has changed.
---
## 5. One‐Time “Cooldown” Logic
* **`LastSignalBar`**
* A persistent integer (initially undefined).
* After each confirmed long or short entry, `LastSignalBar` is set to the bar index where that signal fired.
* **`Bars_Since_Signal`**
* If `LastSignalBar` is undefined, treat as a very large number (so that initial signals are always allowed).
* Otherwise, `Bars_Since_Signal = bar_index – LastSignalBar`.
* **Cooldown Check:**
* A new long (or short) can only be generated if `(Bars_Since_Signal > Signal_Cooldown)`.
* This prevents multiple signals in rapid succession.
---
## 6. Entry Conditions (No Repaint)
All of the conditions below are calculated “intrabar,” but the script only actually registers a **signal** on **bar close** (`barstate.isconfirmed`) so that signals never repaint.
### A. Trend‐Based “Raw” Conditions
1. **Trend\_Long\_Raw:**
$$
(AI\_Score > AI\_Score\_Threshold)\;\land\;Uptrend\_Confirm\;\land\;High\_Volatility\;\land\;(Price\_Change > 0)
$$
2. **Trend\_Short\_Raw:**
$$
(AI\_Score < -AI\_Score\_Threshold)\;\land\;Downtrend\_Confirm\;\land\;High\_Volatility\;\land\;(Price\_Change < 0)
$$
### B. Reversal “Raw” Conditions
1. **Rev\_Long\_Raw:**
$$
Rev\_Bullish\;\land\;(CurrentTrend eq +1)
$$
2. **Rev\_Short\_Raw:**
$$
Rev\_Bearish\;\land\;(CurrentTrend eq -1)
$$
### C. Combine Raw Signals
* `Raw_Long = Trend_Long_Raw OR Rev_Long_Raw`.
* `Raw_Short = Trend_Short_Raw OR Rev_Short_Raw`.
### D. Confirmed Long/Short Signal Flags
On each new bar **close** (`barstate.isconfirmed == true`):
* **Long\_Signal\_Confirmed** can fire if:
1. `Raw_Long == true`
2. `LastTradeTrend != +1` (we haven’t already taken a long in this same trend)
3. `Bars_Since_Signal > Signal_Cooldown`
If all three hold, then on this bar close the code sets:
* `Long_Signal = true`
* `LastTradeTrend := +1`
* `LastSignalBar := bar_index`
Otherwise, `Long_Signal := false` on this bar.
* **Short\_Signal\_Confirmed** works the same way but with `Raw_Short`, `LastTradeTrend != -1`, etc.
If triggered, it sets `Short_Signal = true`, `LastTradeTrend := -1`, and `LastSignalBar := bar_index`. Otherwise `Short_Signal := false`.
* **Important:** If the bar is still forming (`else` branch of `barstate.isconfirmed`), then both `Long_Signal` and `Short_Signal` are forced to `false`. This guarantees that no shape or alert appears until the bar actually closes.
---
## 7. Plotting Entry/Exit Shapes
1. **Trend Long Signal (Triangle Up)**
* Condition: `Long_Signal == true` **AND** `Trend_Long_Raw == true`.
* Appearance: A small, semi-transparent lime green triangle drawn **below** the bar.
2. **Trend Short Signal (Triangle Down)**
* Condition: `Short_Signal == true` **AND** `Trend_Short_Raw == true`.
* Appearance: A small, semi-transparent maroon triangle drawn **above** the bar.
3. **Reversal Long Signal (Circle)**
* Condition: `Long_Signal == true` **AND** `Rev_Long_Raw == true`.
* Appearance: A tiny, more transparent green circle drawn **below** the bar.
4. **Reversal Short Signal (Circle)**
* Condition: `Short_Signal == true` **AND** `Rev_Short_Raw == true`.
* Appearance: A tiny, more transparent red circle drawn **above** the bar.
Since `Long_Signal` and `Short_Signal` only ever become true at bar close, these shapes are never repainted or removed once drawn.
---
## 8. Unified Alert Message
* As soon as a new bar closes with either `Long_Signal` or `Short_Signal == true`, an alert message is sent:
* If `Long_Signal`, then `alert_msg = "action=BUY"`.
* If `Short_Signal`, then `alert_msg = "action=SELL"`.
* If neither, `alert_msg = ""` (no alert).
* The code calls `alert(alert_msg, freq=alert.freq_once_per_bar)` only if `barstate.isconfirmed` and `alert_msg` is non‐empty. This ensures exactly one alert per confirmed bar, no intrabar pops.
---
## 9. Dynamic TP/SL Logic (Minimal Implementation)
Once a long or short position is “open,” the script tracks these variables:
1. **Persistent Flags and Prices** (all persist between bars until reset):
* `InLong` (Boolean)
* `InShort` (Boolean)
* `Long_Max` (Float)
* `Short_Min` (Float)
* `Entry_Price` (Float)
2. **On Bar Close:**
* If `Long_Signal == true` →
* Set `InLong := true`,
* `Entry_Price := close` of that bar,
* `Long_Max := high ` (last bar’s high, so that we’re not using “future” data).
* If `Short_Signal == true` →
* Set `InShort := true`,
* `Entry_Price := close`,
* `Short_Min := low `.
3. **While `InLong == true`:**
* Continuously update `Long_Max = max(Long_Max, current high)` on each bar (intrabar, but finalized each close).
* Compute a dynamic SL:
$$
SL_{Long} = Entry\_Price - (ATR \times SL\_ATR\_Multiplier).
$$
* If **current trend** flips to non-uptrend (`CurrentTrend != +1`), mark `ExitLong = true`.
* Then the routine plots `TP_Long = Long_Max` as a cross (“X”) at that level.
* Set `InLong := false` so that no further changes to `Long_Max` or `Entry_Price` happen on future bars.
4. **While `InShort == true`:**
* Continuously update `Short_Min = min(Short_Min, current low)`.
* Compute a dynamic SL:
$$
SL_{Short} = Entry\_Price + (ATR \times SL\_ATR\_Multiplier).
$$
* If trend flips to non-downtrend (`CurrentTrend != –1`), mark `ExitShort = true`.
* Then the routine plots `TP_Short = Short_Min`.
* Set `InShort := false` to freeze those values.
5. **Plotting TP/SL if “Show Debug” is On:**
* **TP Shapes:**
* When `ExitLong == true`, plot a solid lime “X” at `TP_Long` (highest high).
* When `ExitShort == true`, plot a solid maroon “X” at `TP_Short` (lowest low).
* **SL Lines:**
* If still `InLong`, draw a thin red line at `SL_Long` on each bar.
* If still `InShort`, draw a thin green line at `SL_Short`.
Thus, your charts visually show the highest‐high take-profit cross for longs, the lowest-low take-profit cross for shorts, and a continuously updating trailing SL until the trend flips. Because all of this is triggered on confirmed bars, nothing “jumps around” after the fact.
---
## 10. Debug‐Only Plot Lines (When Enabled)
When **Show Debug Lines** = true, the indicator will also plot:
1. **ATR SMA (Orange):**
* The simple moving average of ATR over `ATR_SMA_Length`.
2. **ATR Threshold (Yellow):**
* `ATR_SMA × ATR_Multiplier` (the dynamically scaled threshold).
3. **+DI & –DI (Current TF):**
* +DI plotted as a green line, –DI plotted as a red line (opacity \~70%).
4. **ADX (Current TF, Blue):**
* A blue line for the present timeframe’s ADX.
5. **ADX Threshold (Gray):**
* A horizontal gray line showing `ADX_Threshold`.
6. **+DI & –DI (HTF, Darker Colors):**
* If HTF confirmation is on, “HTF +DI” is a greener but more transparent line; “HTF –DI” is a redder but more transparent line.
7. **ADX (HTF, Blue but Transparent):**
* HTF ADX plotted in blue (high transparency).
8. **HTF SMA (Orange, Transparent):**
* The higher timeframe’s SMA (same length as `SMA_Long_Length`), drawn in fainter orange.
9. **Volatility Zone Fill (Yellow Tinted Area):**
* Fills the area between `ATR_SMA` and `ATR_SMA × ATR_Multiplier`.
* Indicates “normal” versus “high‐volatility” regimes.
These debug lines are purely visual aids. Disable them if you want a cleaner chart.
---
## 11. Putting It All Together — Step-By-Step Flow
1. **Read Inputs** (RSI lengths, EMA length, ATR settings, etc.).
2. **Optionally Halve All Lengths** if “Scalping Mode” is checked.
3. **Calculate Current TF Indicators:**
* RSI, ATR, ATR\_SMA, EMA, price change, various SMAs, DI/ADX.
4. **Compute “AI Score”** (weighted sum of RSI and EMA signals).
5. **Compute Dynamic ATR Multiplier** and decide if “High Volatility” is true.
6. **Compute Raw Trend/Reversal Conditions** on the current timeframe (without triggering yet).
7. **Fetch HTF Values** in one `request.security` call (SMAs, DI/ADX).
8. **Combine Current & HTF Trend Filters** to confirm `Uptrend_Confirm` or `Downtrend_Confirm`.
9. **Check Reversal Conditions** (price crossing EMA or SMA short, in overbought/oversold zones).
10. **Enforce “One Trade Per Trend”** (clear `LastTradeTrend` whenever `CurrentTrend` flips).
11. **Enforce Cooldown** (must wait at least `Signal_Cooldown` bars since the prior signal).
12. **On Bar Close:**
* If `Raw_Long` AND not already in a long trend AND cooldown met, then fire `Long_Signal`.
* Else if `Raw_Short` AND not already in a short trend AND cooldown met, then fire `Short_Signal`.
* Otherwise, no new signal on this bar.
13. **Plot Long/Short Entry Shapes** according to whether it was a Trend signal or a Reversal signal.
14. **Send Alert** (“action=BUY” or “action=SELL”) exactly once per confirmed bar.
15. **If New Long/Short Signal, Set `InLong`/`InShort`, Record Entry Price, Initialize `Long_Max`/`Short_Min`.**
16. **While `InLong` is true:** Update `Long_Max = max(previous Long_Max, current high)`. Compute `SL_Long`. If the current trend flips (no longer uptrend), set `ExitLong = true`, plot a “TP X,” and close the position logic.
17. **While `InShort` is true:** Similarly update `Short_Min`, compute `SL_Short`, and if trend flips, set `ExitShort = true`, plot a “TP X,” and close the position logic.
18. **Optionally Display Debug Lines** (ATR SMA, ATR threshold, DI/ADX, HTF DI/ADX, etc.).
---
## 12. How to Use in TradingView Community
When you publish this indicator to the TradingView community—choosing “Protected” or “Invite-only” visibility—you can paste the above description into the “Description” field. Users will see exactly what each input does, how signals are generated, and what the various plotted lines represent, **without ever seeing the script source**. In this way, the code itself remains hidden but the logic is fully documented.
1. **Go to “Create New Indicator”** on TradingView.
2. **Paste Your Pine Code** (the full indicator script) in the Pine editor and save it.
3. **Set Visibility = Protected** (or Invite-only).
4. **In the “Description” Text Box, paste the entirety of this document** (steps 1–11).
5. **Click “Publish Script.”**
Users who view your indicator will see its name (“AI Strat Adaptive v3 (NoRepaint)”), a list of all inputs (with default values), and the detailed English description above. They can then load it on any chart, adjust inputs, and see the plotted signals, TP/SL lines, and optional debug overlays—without accessing the underlying Pine code.
---
### Summary of Key Points
* **RSI, EMA, ATR, DI/ADX, and “AI Score”** work together to define “trend vs. reversal.”
* **Dynamic volatility filter** uses ATR and ATR\_SMA to adapt the weighting of RSI vs. EMA and decide whether “volatility is high enough” to permit a trend trade.
* **One trade per detected trend** and a **cooldown period** prevent over‐trading.
* **Higher timeframe confirmation** (optional) further filters out noise.
* **No-repaint logic**:
* All signals only appear at bar close (`barstate.isconfirmed`).
* HTF values are fetched with `lookahead=barmerge.lookahead_off`.
* **Entry shapes** (triangles and circles) clearly mark trend vs. reversal entries.
* **Dynamic TP/SL**: highest‐high (or lowest‐low) since entry is used as TP, ATR×multiplier as SL.
* **Debug mode** (optional) shows every intermediate line for full transparency.
Use this description verbatim (or adapt it slightly for your personal style) when publishing. That way, your community sees exactly how each component works—inputs, functions, filters—while the Pine source code remains private.
1min&5min EMA + CE indicatorCombined indicator for EMA cross-pullback strategy.
In addition to that - there are buttons to turn on/off ce signal appearance limitations on time after 5min cross and ema direction match between 1min and 5min ema.
You can set a single alert for both the 5-minute EMA cross and the 1-minute CE signals simultaneously.
I find it max easy to use by adjusting the Visibility settings - switch it on only for 1min and 5min charts - it will not appear on htf charts. By doing this, you no longer need to switch on/off indicators(in this case only 1) to get clear htf charts.
12H Midpoint Lines [Dire]**Overview:**
This indicator is designed to precisely identify and plot key intra-candle levels from 12-hour candles, projecting them onto your current chart. By visualizing the midpoints of the body, top wick, and bottom wick of these 12-hour candles, traders can gain insights into potential areas of support, resistance, or significant price activity from this higher timeframe.
**How It Works & Key Levels:**
For each 12-hour candle, this script calculates and draws up to three distinct horizontal lines:
1. **Body Midpoint:** The exact center of the candle's body `(Open + Close) / 2`.
* *Color Scheme:* Typically green (configurable).
2. **Top Wick Midpoint:** The midpoint of the upper wick, calculated as `(High + Top of Body) / 2`. This line only appears if a top wick exists.
* *Color Scheme:* Typically blue (configurable, shared with Bottom Wick Midpoint).
3. **Bottom Wick Midpoint:** The midpoint of the lower wick, calculated as `(Low + Bottom of Body) / 2`. This line only appears if a bottom wick exists.
* *Color Scheme:* Typically blue (configurable, shared with Top Wick Midpoint).
**Features:**
* **Comprehensive Midpoint Analysis:** Get a detailed view with three distinct levels per 12H candle.
* **Customizable Appearance:**
* **Colors:** Individually set colors for "Naked" (untouched) and "Touched" lines for Body midpoints and Wick (Top/Bottom) midpoints.
* **Line Thickness:** Adjust the visual weight of all lines.
* **Line Style:** Choose between "Solid," "Dashed," or "Dotted" line styles.
* **Dynamic Line Behavior:**
* **Naked Line Extension (Optional):** Untouched lines can be configured to extend indefinitely to the right, helping you anticipate future interactions.
* **Touched Line Termination:** Once a price level is touched by a subsequent candle, the line automatically stops at the point of intersection, clearly marking this event. If not extended, naked lines will draw to the current bar.
* **Optional Price Labels:**
* Display the precise price level of each line as a text label at its current endpoint.
* Customize label text color and size. (Note: Enabling labels for many lines may impact chart performance).
* **Higher Timeframe Insights:** Seamlessly overlay these significant 12-hour levels onto any active chart timeframe.
* **Historical Data & Performance:** The indicator plots lines for historical 12-hour candles and includes a mechanism to limit the maximum number of displayed lines to maintain optimal chart performance.
**How to Use:**
1. Add the "12H Midpoint Lines V4" indicator to your TradingView chart.
2. Access the indicator's settings (⚙️ icon) to customize colors, line appearance, label visibility, and the naked line extension feature.
3. Observe how price interacts with these dynamically drawn 12-hour midpoint levels, which can act as valuable reference points.
**Development Status:**
Please note that this indicator is a **work in progress.** I am continuously looking to refine its features and functionality. Your feedback and suggestions are highly welcome and can help improve future versions!
RSI TrendSignal🔍 **Smart RSI System – Free & Open Source**
A powerful RSI-based indicator designed for traders who want clarity, simplicity, and filtered signals that *actually mean something*.
---
### 🎯 Key Features:
✅ Classic RSI with custom smoothing
✅ Optional Bollinger Bands over RSI
✅ Built-in Divergence Detection (Regular Bullish/Bearish)
✅ Dynamic Buy/Sell Conditions based on RSI + MA cross
✅ STAR signals for high-conviction entries (Overbought/Oversold + strength filter)
✅ ATR-based strength filter and custom visualizations
✅ Works great on **crypto**, **forex**, or **indices**
✅ Fully open-source and beginner-friendly!
---
### 📊 Recommended Timeframes:
15min, 1H, 4H, Daily – test and adjust settings for your style.
---
### ⚙️ How to Use:
1. Watch for **Buy/Sell** shapes when RSI confirms crossover with smoothed MA.
2. **STAR signals** are stronger – when RSI is above 70 or below 30 with momentum separation.
3. Divergences (optional) can confirm reversals.
4. Use ATR plot or your own trailing stop logic for exit strategy.
---
🔔 Alerts are built-in and ready to use.
📌 You can connect them to bots, webhooks, or Telegram (see alert templates in the script).
---
🧠 **Built by a trader, for traders.**
Use this as a base and build your own version – or just trade it as is.
---
---
💬 **Feedback / Questions / Want to talk?**
Feel free to message me on Telegram:
👉 (t.me/Ario_pinescript_pogramer)
This is a clean version of RSI TrendSignal with improved alerts.
It uses RSI cross with a smoothed moving average to generate filtered buy/sell signals.
No external links or bots. Fully compliant with TradingView rules.
📺 Demo & Tutorial coming soon on my YouTube channel – stay tuned
Alpha Trader University - Fractals & PivotsAlpha Trader University - Fractals & Pivots Indicator
A comprehensive TradingView indicator that identifies key market structure points:
• Fractals: Marks swing highs and lows with red triangles (resistance) and green triangles (support)
• Pivot Points: Labels market structure as HH (Higher High), LH (Lower High), LL (Lower Low), and HL (Higher Low)
• Customizable: Toggle fractals/pivots on/off, choose 3-bar or 5-bar fractal filtering, and customize colors
• Overlay: Plots directly on price chart for easy market structure analysis
Perfect for identifying trend changes, support/resistance levels, and market structure breaks in any timeframe.