Trend Mode Indicator by Kripto MuhtarEn: This indicator is a combination of both linear regression slope and relative strength index. Linear regression slope is calculated, maximum and minimum values of a certain period is determined and a band for slope movement is declared. This bands is a similar of Bollinger Bands. While the slope is refered as speed, the speed of the trend mode is calculated by the movement in the bands. If slope crosses the mid band and sRSI is above 55(50 +filter value), it is accepted that the trend is in rising mode and vice versa. The RSI filter is optional. Blue area is rising trend mode, red area is falling trend mode, silver area is ranging trend mode.
The inputs:
Look back:Calculation period of linear regression slope
Smoothing: Weighted moving average period of the slope
Filter Value: The constant to add/subtract from smoothed RSI on signal line 50.
SRSI Period: Smoothed RSI period
Tr: Bu indikatör, lineer regresyon eğimi ve göreceli güç endeksi indikatörlerinin birleştirilmesi sonucu elde edilmiştir. Öncelikle lineer regresyon eğimi hesaplanmış, belirli bir periyotta maksimum ve minimum değerleri hesaplanmış ve bu sonuçlara göre Bollinger Bantlarına benzeyen bir bant elde edilmiştir. Hız, eğim ile ifade edildiğinden trendin hareket hızı da bant içindeki eğimin hareketine göre belirlenerek trend modu tespit edilmiştir. Eğer eğim çizgisi orta bandı yukarı keser ve sRSI 55(50+filter value) üzerinde ise bu koşul yükselen bir trendi göstermektedir ya da tersi. RSI filtresi opsiyoneldir. Mavi bölge yükselen trend modunu, kırmızı bölge düşen trend modunu, gümüş bölge yatay trend modunu göstermektedir.
Girdiler:
Look back: Lineer regresyon eğiminin hesaplama perioyodu
Smoothing: Eğimin ağırlıklı ortalama periyodu
Filter Value: RSI sinyal çizgisi 50 değerine eklenip çıkartılacak değer
SRSI Period: Yumuşatılmış RSI hesaplama periyodu
在腳本中搜尋"trend"
Trendtrader with profit/rentry==Strategy==
Adjust trend code until the majority of the up-trends are green and the downtrends are red. Take 20% profits at the first and second take profit levels while leaving the rest of the trade in until close.
==Indicator includes==
EMA cross, trend analysis, stoc-RSI TP and re-entries.
==Credits==
Trade Indicators for the strategy, jhanson107, for the trend indicator, and Zekis for helping with the TP and re-entries.
BOSS EMA Trend Meter PRO With Alerts BOSS PRO TRADING SYSTEM INDICATORS
Bullish Uptrend
To determine bullish uptrend there must beat least 2 green squares on all three trend meters. This is a great predictor that a uptrend is imminent. You can set alerts for top two meters being green as well as all 3 meters being green
Bearish Downtrend
To determine bearish downtrend there must beat least 2 red squares on all three trend meters. This is a great predictor that a downtrend is imminent. You can set alerts for top two meters being red as well as all 3 meters being red.
Purchase Here: bosscripts.com
HMA-Kahlman Trend & TrendlinesThis script utilizes two modules, Trendlines module (by Joris Duyck) and HMA-Kahlman Trend module. Trendlines module produces crossovers predictive of the next local trend.
(TBO) Trending Break OutTBO (Trending Break Out) is an indicator designed to help identify trends within the markets. Users are able to see trend continuations and potential trend reversals. Potential breakouts are also shown as trend strength increases or decreases. There are buy signals and short signals included as well. Clouds show underlying support or resistance areas and potential changes in trend strength. Pivots show resistance and support as well.
-Brought to you by Drungle_OG and MooninPapa (YouTubes)
Bitcoin long term trendsThis script shows the long term trends in Bitcoin price.
It is based on my mathematical formula for the long term trends.
The blue line is a long term trend as a power function B = (t/693)^5.526
And the green line is a more sophisticated trend, which models the wave behavior over the whole history of bitcoin.
This script is only applicable to BTCUSD price. The trend lines are calculated as the functions of time only.
BITFINEX:BTCUSD
Oasis Trend StrategyThis is a simple script developed to give a quick visual of trend on any given time frame.
This is a script that gives signals of trend switches. Can be used to for buying and selling signals.
On larger time Frames we use the Aqua and Fuchsia Clouds to express the larger time frame trends.
This can be used for long term swing trades especially useful with the 4hr, 6 hr, and daily chart to cancel out all the noise within the larger trends. The smaller Blue/Red Clouds can be used within trend if you are a skillful trader.
On smaller time frames (Intraday), we used the Blue and Red intraday price action. Is meant to be used
alongside with the Aqua/Fuchsia to create short term trades decisions within the short term trends indicated by the Aqua and Fuchsia.
The 9 ema is used to keep a close eye on short term directional changes.
You would want to see if price stays above or below this level along with its price action.
This should give you initial signs of strength or weakness.
The 55 ema (Black) is used to determine larger trend directional changes and for confirmation of trend shifts.
If interested, you can learn a lot just by watching the price react to these levels and can really visualize the price action that encompasses these averages.
We recommend that all traders study Technical patterns, Price action, Financial risk management, and other pre-trade planning strategies to minimize drawdown risk.
Please give us a like and a follow if you like this indicator. Its simple and very easy to use.
We are not financial advisors. We do not give financial advise. Please use this indicator at your free will.
We are not responsible for any financial losses or claims.
If you find this indicator very useful as I have, we do appreciate any amount of tips.
This will fund us to create more indicators to be made for your use.
BTC - 3PmVmmsnuLedg7umzVkLnarKRo43g6P5Tp
ETH - 0x9a1Ba8809687D8d9A1D32Ed1602abEef48060aF1
LTC - MAgqbC6Kev1x3L2GvNwzhZacyBRxCKJ8Mi
ZCash - t1UYRLzQxeaHCNYfA9cLChfBX5mbcNqworA
0x - 0x2B07D8BFB20b6eDb9A498113764082211cdFA2cE
Many free Tradingview users can benefit from our indicators as we employ many many useful indicators that can be toggled in each script to surpass the indicator limits.
Popat Trend AlanyzerThis tool will help you analyze the trend where you determine when you have to enter and when exits with your Technical analysis, with this indicator you can easily spot if market is trending or ranging and can trade according to it. You can use it with any time frame, you can use it bigger time frames for accurate result coz there are lot of noise in smaller time frame, this is not a 100% working system but you can make money in trending market buy with proper risk management and discipline.
I have include multiple indicator in the one , The main benefit of this all in one indicator is that you can use all of the indicator one by one by turning of all other in one click so your chart looks clean and you can see the candles. And if you have FREE plan in Trading view where you can use only 3 indicators but with this you can use more than 3 in single chart, included indicator are Moving averages and ichimoku kinko hyo.
USE OF INDICATORS
1)7/30 Moving averages
This is default indicator with 7/30 MA and background ploting (you can remove background color) when you add POPAT TREND ANALYZER
2) 50/200 cross trend arrows at top n bottom
If you enable this check you will see black and red circles on the top and bottom of your chart, where BLACK CIRCLE at bottom indicate bullish crossover between 50/200 in pertucaler time frames and RED CIRCLE at the top indicate bearish 50/200 crossover, and you can on off it by one click, with this you can easily see the current trend or crossover of 50/200 MA without add both MAs.
3) Ichimoku T & K On/Off
Enable this if you want to add only Tenkan and kijun, many TA experts only use T&K crossover to determine their next trade. For more information about ichimoku you can search on the internet.
4) Ichimoku Cloud On/Off
If you enable this you can add only kumo cloud which is combination of senkou A & senkou B and ploting it in the future. Many people want to use kumo cloud without Tenkan and kijun and want to use the favorites Moving averages with it, they will defiantly love it.
4) SMA 50/100/200 On/Off
Here I have added 3 big Moving averages which is 50,100 and 200, in the FREE plan of trading view you can only 3 indicators and you have to remove one for add another one but now you can easily add it by single check to see the big trend quickly and hide it easily.
If you have any question or suggestions you can comment below.
Happy Trading.
Power Trend by Atilla YurtsevenPower Trend is the indicator that i have developed for myself and would like to share with you.
Power Trend automatically detects High / Low points and draw trend lines. If you have a look at the graph, you can simply draw a line over last 2 points to combine them and see the trends current state. You can also change High and Low points' sources. I often use Horizontal trend lines by selecting "close" for both High and Low sources.
I also love to use Horizontal Trends. They usually shows breakouts. Expect a breakout when lines are close to each other.
Remember; this is a lagging indicator. If there is a point in the current bar, indicator will draw it after 2 bars!
Disclaimer: All the information in this article, including the algorithm/indicator, was provided and published for informational purposes only and should not be considered legal or financial advice.
Happy trading :)
Atilla Yurtseven
[NMM] TrendLines - v1An easy to use chart to display trend lines for the current trends in effect.
There are simply two parameters:
- Base Period: Defines how long back you are looking for trends. For a given base period of X, price from upto 5X bars back is taken into consideration for drawing trend lines. I would suggest keeping this to a low value. Default is 12.
- Smoothing Period: To further smoothen the trend lines, use this parameter.
Usually, a trend reversal can be easily seen from this indicator. At reversals, there is a clearly visible reversal of this indicator. If you look carefully, you can even count Eliott Waves easily on this indicator, which are sharply defined.
NOTE: I am available for custom work on hire. Contact me via PM, if required.
Spicytrader V4 [LONG and SHORT signals + Trendline]NEW VERSION : JUNE 2018
LONG and SHORT signals (with alerts)
Trendline : Bullish and bearish market (with alerts)
Compatible with Autoview bot (Open Long/Short)
Working with 1min* interval and more (1min to Month)
TRY IT FOR FREE : spicytrader.com
* Market has to be enough volatile to use it with 1min interval (Ok with ETHER for instance).
Use these scripts together to maximize profit
Spicytrader V4
Squeeze Momentum Indicator
Pivot Point High Low
How to use the script
Add the scripts to your chart
Select a time interval from 1min to 1 month which shows great trends (Multiple following colored candles)
Don't go if trends are not well defined
LONG position
The BLUE* candle is CLOSED and BULLISH (Green candle)
Squeeze Momentum Indicator is BULLISH
Trendline is BULLISH (Green)
Candle close above Trendline
Pivot Points are below or far enough
Don't go if trends are not well defined
* Dark blue is a strong buy signal
* Ligh blue is a weak buy signal but can be ok depending of the market
SHORT position
The YELLOW candle is CLOSED and BEARISH (Red candle)
Squeeze Momentum Indicator is BEARISH
Trendline is BEARISH (Red)
Candle close bellow Trendline
Pivot Points are above or far enough
Don't go if trends are not well defined
When to close a trade ?
Trend is over (New closed candle is NOT colored)
or Market direction is changing
or Pivot Point is reached and failed to cross
or You feel it
WARNING :
The purpose of these signals is to HELP/SUPPORT you to take a decision.
You need to analyse the general trend before placing an order.
Don't trust FOMO or FUD and do your own research
TRY IT FOR FREE : spicytrader.com
TRY IT FOR FREE : spicytrader.com
TRY IT FOR FREE : spicytrader.com
How to use it with Autoview
Add an alert (OPEN LONG or OPEN SHORT) and set it to "Once Per bar Closed" in order to place an order after the confirmation.
Refer to the official website (Autoview) bit.ly to get more information.
Trend Detector IndicatorTrend Detector Indicator
Class : trend oscillator/average analysis
Trading type : trading in trend
Time frame : 1 day
Purpose : trend detection
Level of aggressiveness : conservative
The key problem of trend following trading is danger of entering into position at extreme points of the trend with further trend reverse. Plus in any case it is very important to understand the phase of the trend cycle to be effective and successful trader.
Each trend can be divided into several phases: start of the trend, active development, consolidation phase, end of the trend. Obviously the most interesting phases for trading in trend are start and active development of the trend. At these phases risk of unsuccessful trading in trend direction is minimal, but profit opportunities are maximal. Still as a rule it is quite hard to detect the start of the trend. As the result probability of false signals is rather high.
Indicator «Trend Detector Indicator» is developed to identify the active phases of the trend cycle and helps to avoid trading at the end of the trend.
Using unique algorithm Indicator “TDI” allows to identify moments in price dynamics which are the most appropriate for trading in trend.
Structure of the indicator
Indicator consists of the TDI line and special colored zones:
- TDI line (multi-colored line in the indicator window) – is used to divide phases of the trend cycle, different colors signal about current type of price dynamics (blue color – uptrend, red color – downtrend, green – flat);
- Colored zones (blue, yellow and red colors depending on type of the signal) – are used for color indication of the trend cycle phases. Blue color means that trend is in active phase. Yellow warns about possible transition of the trend to the extinction. Entering the red zone is a signal of possible break of a trend.
Input parameters of the indicator
To set up the indicator a number of input parameters are used:
- Average period – averaging period. Responsible for the data filtration (by default = 13). The bigger the period is the less quantity of the signals would be, but the higher their quality is expected. Decrease of this parameter allows to increase the aggressiveness of the trading and the number of generated signals, but potentially this can decrease the quality of the signals
- Correlation period – period which is used in correlation analysis to calculate the correlation moment (by default = 21).
Rules of trading
Entering of the TDI line into blue zone and being there is a signal for active trading in current price direction. The direction of the tendency is indicated by the color of the TDI line: blue color – uptrend and “buy” signal, red color – downtrend and “sell” signal, green – flat, that means there is no dominating tendency and trading in trend should be postponed.
Since the basis for the trades are trend signals, their closing with profits or stops should be done when these signals lost relevance. So stop-loss and take-profit parameters are not provided. Such approach allows to avoid profit limitation by a certain number of points and to extract maximum from the active phase of the trend cycle, which is not limited in theory.
Change of the TDI line color in blue zone is a signal to close current long positions. Exit of the TDI line from blue zone is a signal to close current trend positions.
Script and Bot Marketplace's Trend Detector 2.0Use this custom indicator to analyze the current trend of any market that you choose on all time frames. Works great as a secondary indicator while day or swing trading.
Interested? Check us out here: www.scriptandbotmarketplace.com
Join our discord to talk about bots, scripts, and crypto: discord.gg
Auto Bull/Bear TrendlinesAutomated trendlines for easily identifying market trend continuation or reversals
Trend vs Chop Detector - Stocky Mind ⚡️👉🏻 Fractal Efficiency Ratio – Stocky Mind ⚡
This indicator helps traders identify whether the market is trending or choppy using the Fractal Efficiency Ratio (FE) as described originally by Perry J. Kaufman in his book Trading Systems and Methods & by Pradeep Bonde.
👉🏻 What it does
Measures trend efficiency over a given period (length) by comparing net price change vs. cumulative absolute price change.
Higher FE values suggest linear (trending) price movement.
Lower FE values indicate choppiness or range-bound behaviour.
👉🏻 Key Features:
Fractal Efficiency Plot: Visualize trend clarity numerically.
Dynamic Background Zones:
Green: Strong linear trend (FE > threshold)
Red: Choppy market (FE < threshold)
Customizable thresholds for both trend and chop zones.
👉🏻 Use Case
Use this to filter stocks or confirm entries where price is moving smoothly.
Avoid low-efficiency (choppy) zones where breakout trades may fail.
👉🏻 Note
Best used in combination with price action and volume.
Higher timeframes may smooth out noisy behaviour.
Brought to you by Stocky Mind ⚡ – Simplifying setups with logic and clarity.
Yaman's - TREND 🔴🟢 Trend Indicator for Scalping.
Trends ----->
XAUUSD (GOLD)
BTCUSD
DXY
Time Frames ----->
M1
M5
M15
H1
Happy Trading!!!
Thanks
Yaman Didi
07-01-2025
Adaptive Trend Filter🔒 IAFL Adaptive Trend Filter – Smart Entry & Exit Tool for All Traders
Description:
This invite-only indicator is designed to offer precision-based trade entries and exits using adaptive trend logic. Rather than simply combining common tools, it integrates market strength and directional confirmation in a customized framework optimized for intraday, swing, and positional trading.
🎯 What Sets This Apart?
🔹 Dynamic Strategy Modes
Traders can toggle between three distinct behavioral modes based on their trading style—intraday, swing, or positional—each optimized to adjust internal decision thresholds, not just display values.
🔹 Filtered Entry System
Buy and Sell signals are only generated when multiple custom-defined trend conditions align, significantly reducing noise and false signals. This makes it particularly useful during volatile or consolidating markets.
🔹 Smart Risk Tools
Includes a built-in module to automatically generate Stop Loss and Take Profit levels using real-time market dynamics or predefined risk-reward rules. This helps users manage trades more consistently.
🔹 Trade Insight Panel
A non-intrusive on-chart panel gives users key details such as:
Latest signal
Stop loss & target levels
Current position status and live P/L
🔹 Non-Repainting Logic
Signals are confirmed and stable. There’s no repainting once a bar closes, ensuring that what users see is what actually happened.
🧠 How to Use It
Ideal for traders who want signal confirmation before acting
Suitable for equities, indices, crypto, or commodities
Can be combined with price action, volume, or multi-timeframe analysis
Works best on trending instruments with adequate volatility
This is a tool for discretionary trading, not an auto-entry system. It’s meant to complement a trader's strategy, not replace it.
❌ No Promotions or External Links
No website links
No contact info
No ads or offers
It is solely intended to provide value to serious traders who are looking for a thoughtful entry-filtering system.
🔐 Why Invite-Only?
This system is not just a mashup of public indicators. It involves:
Proprietary entry/exit logic
Dynamic threshold adjustments under the hood
User interface tools designed for better clarity and discipline
It’s invite-only to ensure that it's used responsibly and by users who understand how to integrate it into their process.
Dow Theory Trend IndicatorIdentifies bullish (Higher Highs/Lows) and bearish (Lower Highs/Lows) trends using Dow Theory principles, with dynamic volume confirmation.
Displays the current trend status ("Bull", "Bear", or "Neutral")
Step Channel Momentum Trend [ChartPrime]OVERVIEW
Step Channel Momentum Trend is a momentum-based price filtering system that adapts to market structure using pivot levels and ATR volatility. It builds a dynamic channel around a stepwise midline derived from swing highs and lows. The system colors price candles based on whether price remains inside this channel (low momentum) or breaks out (strong directional flow). This allows traders to clearly distinguish ranging conditions from trending ones and take action accordingly.
⯁ STRUCTURAL MIDLNE (STEP CHANNEL CORE)
The midline acts as the backbone of the trend system and is based on structure rather than smoothing.
Calculated as the average of the most recent confirmed Pivot High and Pivot Low.
The result is a step-like horizontal line that only updates when new pivot points are confirmed.
This design avoids lag and makes the line "snap" to recent structural shifts.
It reflects the equilibrium level between recent bullish and bearish control.
This unique step logic creates clear regime shifts and prevents noise from distorting trend interpretation.
⯁ DYNAMIC VOLATILITY BANDS (ATR FILTERING)
To detect momentum strength, the script constructs upper and lower bands using the ATR (Average True Range):
The distance from the midline is determined by ATR × multiplier (default: 200-period ATR × 0.6).
These bands adjust dynamically to volatility, expanding in high-ATR environments and contracting in calm markets.
The area between upper and lower bands represents a neutral or ranging market state.
Breakouts outside the bands are treated as significant momentum shifts.
This filtering approach ensures that only meaningful breakouts are visually emphasized — not every candle fluctuation.
⯁ MOMENTUM-BASED CANDLE COLORING
The system visually transforms price candles into momentum indicators:
When price (hl2) is above the upper band, candles are green → bullish momentum.
When price is below the lower band, candles are red → bearish momentum.
When price is between the bands, candles are orange → low or no momentum (range).
The candle body, wick, and border are all colored uniformly for visual clarity.
This gives traders instant feedback on when momentum is expanding or fading — ideal for breakout, pullback, or trend-following strategies.
⯁ PIVOT-BASED SWING ANCHORS
Each confirmed pivot is plotted as a label ⬥ directly on the chart:
They also serve as potential manual entry zones, SL/TP anchors, or confirmation points.
⯁ MOMENTUM STATE LABEL
To reinforce the current market mode, a live label is displayed at the most recent candle:
Displays either:
“ Momentum Up ” when price breaks above the upper band.
“ Momentum Down ” when price breaks below the lower band.
“ Range ” when price remains between the bands.
Label color matches the candle color for quick identification.
Automatically updates on each bar close.
This helps discretionary traders filter trades based on market phase.
USAGE
Use the green/red zones to enter with momentum and ride trending moves.
Use the orange zone to stay out or fade ranges.
The step midline can act as a breakout base, pullback anchor, or bias reference.
Combine with other indicators (e.g., order blocks, divergences, or volume) to build high-confluence systems.
CONCLUSION
Step Channel Momentum Trend gives traders a clean, adaptive framework for identifying trend direction, volatility-based breakouts, and ranging environments — all from structural logic and ATR responsiveness. Its stepwise midline provides clarity, while its dynamic color-coded candles make momentum shifts impossible to miss. Whether you’re scalping intraday momentum or managing swing entries, this tool helps you trade with the market’s rhythm — not against it.
Didi Index Pro – NNFX Trend Indicator [UTS]📈 Uber Didi Index Pro – NNFX Trend Indicator
A Top 100 NNFX-Compliant Trend Indicator – Refined for Rule-Based Traders
This enhanced Didi Index is a purpose-built trend indicator optimized for No Nonsense Forex (NNFX) systems. It reimagines the classic Brazilian Didi Index with powerful upgrades designed for serious, rules-based trading.
🔍 What Makes This Version Unique?
✅ NNFX-Adjusted Logic
• Removes short/fast MAs to reduce noise
• Designed to work only with long-period moving averages – as per VP’s recommendations
🔁 Inverted & Zero-Centered
• Deviations are plotted relative to the medium MA baseline at zero
• Inverted formula offers better signal clarity (e.g., rising above zero = uptrend)
🎛️ Customizable with 25+ Moving Average Types
• Choose SMA, EMA, WMA, VWMA, Hull, LSMA, and more
• Tune each line individually to match your system rules
📢 Alerts Built In
• Set alerts for crossovers, entering/exiting zones, or custom signal events
• Works as a primary confirmation, secondary confirmation or even exit indicator
🎯 Clean Signals, Fast Readability
• Removed the "Curta" and relies on the better "Longa" line relative to a zero centered "Media" line
• Great for confirming higher timeframe trends or filtering false entries
🕰️ History & Context
Originally developed by Brazilian trader Odir “Didi” Aguiar, the Didi Index compares short, medium, and long moving averages to spot market compression and expansions. This version repurposes the idea for trend-following, not mean reversion, and fully aligns with NNFX methodology.
📎 How to Use in NNFX Systems
Use this indicator as part of your C1 or C2 (confirmation) indicator:
When the Longa line is above zero → Bias = Long
When the Longa line is below zero → Bias = Short
Avoid trades when both lines are tightly compressed near zero
✅ Designed by traders who follow the rules.
✅ Built for traders who want clarity, consistency, and compliance.
🚀 Moving Averages
Trend-determining method offers 26 high quality Moving averages to choose.
"SMA", Simple Moving Average, R. H. Hooker, 1901
"EMA", Exponential Moving Average, P. N. Haurlan, early 1960s
"MDMA", McGinley Dynamic MA, John R. McGinley, 1990s
"DSEMA", Double Smoothed EMA, William Blau, year unknown
"DEMA", Double EMA, Patrick G. Mulloy, 1994
"TEMA", Triple EMA, Patrick G. Mulloy, 1994
"WMA", Weighted MA, Author and year unknown
"PWMA", Parabolic Weighted MA, Author and year unknown
"VWMA", Volume Weighted MA, Author and year unknown
"HULL", Hull MA, Alan Hull, 2005, year unknown
"TMA", Triangular MA, Author and year unknown
"B2P", Two Pole Ehlers Butterworth, John F. Ehlers, 2004
"S2P", Two Pole Ehlers Smoother, John F. Ehlers, year unknown
"S3P", Three Pole Ehlers Smoother, John F. Ehlers, year unknown
"SINE", Sine Weighted MA, Author and year unknown
"LINREG", Linear Regression Value (LSMA), Author and year unknown
"ILINREG", Integral of Linear Regression Slope, Author and year unknown
"NLMA", Non Lag MA, Author and year unknown
"ZLMA", Zero Lag MA, Author and year unknown
"KIJUN", Kijun-Sen Ichimoku, Goichi Hosoda, late 1930s
"SSM", Super Smoother, John F. Ehlers, year unknown
"ALMA", Arnaud Legoux MA, Arnaud Legoux, year unknown
"KAMA", Kaufman Adaptive MA, Perry J. Kaufman, 1998
"FRAMA", Fractal MA, John F. Ehlers, year unknown
"RMA", Running MA, J. Welles Wilder Jr., 1978
"JMA", Jurik Moving Average, Mark Jurik, year unknown
🚥 Signals
The indicator displays buy/sell signals, Beyond-ATR signals, and recommends when a pullback entry is possible.
Long Signal
Short Signal
📢 Alerts
Each chart signal can trigger an alert with the same name. To avoid multiple alerts being triggered within a single candle, it is recommended to wait for the candle to close and use the 'Once Per Bar Close' setting.
Long Signal
Short Signal
🗃️ About
Name: Uber Didi Index Pro – NNFX Trend Indicator
Created: 2025/06/20
PineScript: v6
Trend Blend
Trend blend is my new indicator. I use it to identify my bias when trading and filter out fake setups that are going in the wrong direction.
Trend blend utilises the 9 EMA (Red), 21 EMA (Black), and if you trade futures or Bitcoin, you can also use the VWAP (Blue).
There is also a table at the top right that displays the chart time frame bias
I prefer to use the 1-hour time frame for bias and execute the trades on 5-minute charts, mainly, and sometimes on the 1-minute for a smaller stoploss.
Here's an example of the trade I took during the London session on XAU/USD
1 hour bias was Bearish
Price broke out of the range
I waited for the London session to open, where I ended up taking a short on the 5-minute time frame as we broke out of the pre-London range
Entry was at the Fair Value Gap (5-minute bias was also Bearish as price traded into the FVG)
Stoploss was at the last high
Take Profit was the next major support level
Another set that I like to trade with the Trend blend is when price is trending bullish and price trades inside the 9 and 21 EMA, and there is a bullish candle closer above the 9 EMA with Stoploss below the low of the bullish candle and Take profit between 1-2 Risk to Reward
Same when there's a bearish trend, I wait for price to trade inside the 9 and 21 EMA, and I'll take sells when a bearish candle closes below the 9 EMA.
This setup works best in strong trends, or it can be used to enter a trade on a pullback or to scale into an existing trade.
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 \neq +1)
$$
2. **Rev\_Short\_Raw:**
$$
Rev\_Bearish\;\land\;(CurrentTrend \neq -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.
Trend Factor Simplified - Shared (Crypto)A Trend Following Indicator for crypto, stronger than your thought, entering lower region means you need to be careful of buying/long chance, entering upper region means you need to be careful of selling/short chance, good luck! NOT an oscillator/reversal indicator, don't be mislead by its plotting way.
一个加密货币的趋势跟踪指标,比你想的要强的那种,进入下方区域说明要关注买入/做多机会,进入上方区域说明要关注卖出/做空机会,实际操作试试看就知道了。不是振荡器/反转指标,别用错了。