(Mustang Algo) Stochastic RSI + Triple EMAStochastic RSI + Triple EMA (StochTEMA)
Overview
The Stochastic RSI + Triple EMA indicator combines the Stochastic RSI oscillator with a Triple Exponential Moving Average (TEMA) overlay to generate clear buy and sell signals on the price chart. By measuring RSI overbought/oversold conditions and confirming trend direction with TEMA, this tool helps traders identify high-probability entries and exits while filtering out noise in choppy markets.
Key Features
Stochastic RSI Calculation
Computes a standard RSI over a user-defined period (default 50).
Applies a Stochastic oscillator to the RSI values over a second user-defined period (default 50).
Smooths the %K line by taking an SMA over a third input (default 3), and %D is an SMA of %K over another input (default 3).
Defines oversold when both %K and %D are below 20, and overbought when both are above 80.
Triple EMA (TEMA)
Calculates three successive EMAs on the closing price with the same length (default 9).
Combines them using TEMA = 3×(EMA1 – EMA2) + EMA3, producing a fast-reacting trend line.
Bullish trend is identified when price > TEMA and TEMA is rising; bearish trend when price < TEMA and TEMA is falling; neutral/flat when TEMA change is minimal.
Signal Logic
Strong Buy: Previous bar’s Stoch RSI was oversold (both %K and %D < 20), %K crosses above %D, and TEMA is in a bullish trend.
Medium Buy: %K crosses above %D (without requiring oversold), TEMA is bullish, and previous %K < 50.
Weak Buy: Previous bar’s %K and %D were oversold, %K crosses above %D, TEMA is flat or bullish (not bearish).
Strong Sell: Previous bar’s Stoch RSI was overbought (both %K and %D > 80), %K crosses below %D, and TEMA is bearish.
Medium Sell: %K crosses below %D (without requiring overbought), TEMA is bearish, and previous %K > 50.
Weak Sell: Previous bar’s %K and %D were overbought, %K crosses below %D, TEMA is flat or bearish (not bullish).
Visual Elements on Chart
TEMA Line: Plotted in cyan (#00BCD4) with a medium-thick line for clear trend visualization.
Buy/Sell Markers:
BUY STRONG: Lime label below the candle
BUY MEDIUM: Green triangle below the candle
BUY WEAK: Semi-transparent green circle below the candle
SELL STRONG: Red label above the candle
SELL MEDIUM: Orange triangle above the candle
SELL WEAK: Semi-transparent orange circle above the candle
Candle & Background Coloring: When a strong buy or sell signal occurs, the candle body is tinted (semi-transparent lime/red) and the chart background briefly flashes light green (buy) or light red (sell).
Dynamic Support/Resistance:
On a strong buy signal, a green dot is plotted under that bar’s low as a temporary support marker.
On a strong sell signal, a red dot is plotted above that bar’s high as a temporary resistance marker.
Alerts
Strong Buy Alert: Triggered when Stoch RSI is oversold, %K crosses above %D, and TEMA is bullish.
Strong Sell Alert: Triggered when Stoch RSI is overbought, %K crosses below %D, and TEMA is bearish.
General Buy Alert: Triggered on any bullish crossover (%K > %D) when TEMA is not bearish.
General Sell Alert: Triggered on any bearish crossover (%K < %D) when TEMA is not bullish.
Inputs
Stochastic RSI Settings (group “Stochastic RSI”):
K (smoothK): Period length for smoothing the %K line (default 3, minimum 1)
D (smoothD): Period length for smoothing the %D line (default 3, minimum 1)
RSI Length (lengthRSI): Number of bars used for the RSI calculation (default 50, minimum 1)
Stochastic Length (lengthStoch): Number of bars for the Stochastic oscillator applied to RSI (default 50, minimum 1)
RSI Source (src): Price source for the RSI (default = close)
TEMA Settings (group “Triple EMA”):
TEMA Length (lengthTEMA): Number of bars used for each of the three EMAs (default 9, minimum 1)
How to Use
Add the Script
Copy and paste the indicator code into TradingView’s Pine Editor (version 6).
Save the script and add it to your chart as “Stochastic RSI + Triple EMA (StochTEMA).”
Adjust Inputs
Choose shorter lengths for lower timeframes (e.g., intraday scalping) and longer lengths for higher timeframes (e.g., swing trading).
Fine-tune the Stochastic RSI parameters (K, D, RSI Length, Stochastic Length) to suit the volatility of the instrument.
Modify TEMA Length if you prefer a faster or slower moving average response.
Interpret Signals
Primary Entries/Exits: Focus on “BUY STRONG” and “SELL STRONG” signals, as they require both oversold/overbought conditions and a confirming TEMA trend.
Confirmation Signals: Use “BUY MEDIUM”/“BUY WEAK” to confirm or add to an existing position when the market is trending. Similarly, “SELL MEDIUM”/“SELL WEAK” can be used to scale out or confirm bearish momentum.
Support/Resistance Dots: These help identify recent swing lows (green dots) and swing highs (red dots) that were tagged by strong signals—useful to place stop-loss or profit-target orders.
Set Alerts
Open the Alerts menu (bell icon) in TradingView, choose this script, and select the desired alert condition (e.g., “BUY Signal Strong”).
Configure notifications (popup, email, webhook) according to your trading workflow.
Notes & Best Practices
Filtering False Signals: By combining Stoch RSI crossovers with TEMA trend confirmation, most false breakouts during choppy price action are filtered out.
Timeframe Selection: This indicator works on all timeframes, but shorter timeframes may generate frequent signals—consider higher-timeframe confirmation when trading lower timeframes.
Risk Management: Always use proper position sizing and stop-loss placement. An “oversold” or “overbought” reading can remain extended for some time in strong trends.
Backtesting/Optimization: Before live trading, backtest different parameter combinations on historical data to find the optimal balance between sensitivity and reliability for your chosen instrument.
No Guarantee of Profits: As with any technical indicator, past performance does not guarantee future results. Use in conjunction with other forms of analysis (volume, price patterns, fundamentals).
Author: Your Name or Username
Version: 1.0 (Pine Script v6)
Published: June 2025
Feel free to customize input values and visual preferences. If you find bugs or have suggestions for improvements, open an issue or leave a comment below. Trade responsibly!
Cicli
Buysell Martingale Signal - CustomBuysell Martingale Signal - Custom Indicator
Introduction:
This indicator provides a dynamic buy and sell signal system incorporating an adaptive Martingale logic. Built upon the signalLib_yashgode9/2 library, it is designed for use across various markets and timeframes.
Key Features:
Primary Buy & Sell Signals: Identifies initial buy and sell opportunities based on directional changes derived from the signalLib.
Martingale Signals:
For Short (Sell) Positions: A Martingale Sell signal is triggered when the price moves against the existing short position by a specified stepPercent from the last entry price, indicating a potential opportunity to average down or increase position size.
For Long (Buy) Positions: Similarly, a Martingale Buy signal is triggered when the price moves against the existing long position by a stepPercent from the last entry price.
On-Chart Labels: Displays clear, customizable labels on the chart for primary Buy, Sell, Martingale Buy, and Martingale Sell signals.
Customizable Colors: Allows users to set distinct colors for primary signals and Martingale signals for better visual distinction.
Adjustable Sensitivity: Features configurable parameters (DEPTH_ENGINE, DEVIATION_ENGINE, BACKSTEP_ENGINE) to fine-tune the sensitivity of the underlying signal generation.
Webhook Support (Static Message Alerts): This indicator provides alerts with static messages for both primary and Martingale buy/sell signals. These alerts can be leveraged for automation by external systems (such as trading bots or exchange-provided Webhook Signal Trading services).
Important Note: When using these alerts for automation, an external system is required to handle the complex Martingale logic and position management (e.g., tracking steps, PnL calculation, hedging, dynamic quantity sizing), as this indicator solely focuses on signal generation and sending predefined messages.
How to Use:
Add the indicator to your desired chart.
Adjust the input parameters in the indicator's settings to match your specific trading symbol and timeframe.
For automation, you can set up TradingView alerts for the Buy Signal (Main/Martingale) and Sell Signal (Main/Martingale) conditions, pointing them to your preferred Webhook URL.
Configurable Parameters:
DEPTH_ENGINE: (e.g., 30) Controls the depth of analysis for the signal algorithm.
DEVIATION_ENGINE: (e.g., 5) Defines the allowable deviation for signal generation.
BACKSTEP_ENGINE: (e.g., 5) Specifies the number of historical bars to look back.
Martingale Step Percent: (e.g., 0.5) The percentage price movement against the current position that triggers a Martingale signal.
Labels Transparency: Adjusts the transparency of the on-chart signal labels.
Buy-Color / Sell-Color: Sets the color for primary Buy and Sell signal labels.
Martingale Buy-Color / Martingale Sell-Color: Sets the color for Martingale Buy and Sell signal labels.
Label size: Controls the visual size of the labels.
Label Offset: Adjusts the vertical offset of the labels from the candlesticks.
Risk Warning:
Financial trading inherently carries significant risk. Martingale strategies are particularly high-risk and can lead to substantial losses or even complete liquidation of capital if the market moves strongly and persistently against your position. Always backtest thoroughly and practice with a demo account, fully understanding the associated risks, before engaging with real capital.
AWR R & LR Oscillator with plots & tableHello trading viewers !
I'm glad to share with you one of my favorite indicator. It's the aggregate of many things. It is partly based on an indicator designed by gentleman goat. Many thanks to him.
1. Oscillator and Correlation Calculations
Overview and Functionality: This part of the indicator computes up to 10 Pearson correlation coefficients between a chosen source (typically the close price, though this is user-configurable) and the bar index over various periods. Starting with an initial period defined by the startPeriod parameter and increasing by a set increment (periodIncrement), each correlation coefficient is calculated using the built-in ta.correlation function over successive ranges. These coefficients are stored in an array, and the indicator calculates their average (avgPR) to provide a complete view of the market trend strength.
Display Features: Each individual coefficient, as well as the overall average, is plotted on the chart using a specific color. Horizontal lines (both dashed and solid) are drawn at levels 0, ±0.8, and ±1, serving as visual thresholds. Additionally, conditional fills in red or blue highlight when values exceed these thresholds, helping the user quickly identify potential extreme conditions (such as overbought or oversold situations).
2. Visual Signals and Automated Alerts
Graphical Signal Enhancements: To reinforce the analysis, the indicator uses graphical elements like emojis and shape markers. For example:
If all 10 curves drop below -0.79, a 🌋 emoji appears at the bottom of the chart;
When curves 2 through 10 are below -0.79, a ⛰️ emoji is displayed below the bar, potentially serving as a buy signal accompanied by an alert condition;
Likewise, symmetrical conditions for correlations exceeding 0.79 produce corresponding emojis (🤿 and 🏖️) at the top or bottom of the chart.
Alerts and Notifications: Using these visual triggers, several alertcondition statements are defined within the script. This allows users to set up TradingView alerts and receive real-time notifications whenever the market reaches these predefined critical zones identified by the multi-period analysis.
3. Regression Channel Analysis
Principles and Calculations: In addition to the oscillator, the indicator implements an analysis of regression channels. For each of the 8 configurable channels, the user can set a range of periods (for example, min1 to max1, etc.). The function calc_regression_channel iterates through the defined period range to find the optimal period that maximizes a statistical measure derived from a regression parameter calculated by the function r(p). Once this optimal period is identified, the indicator computes two key points (A and B) which define the main regression line, and then creates a channel based on the calculated deviation (an RMSE multiplied by a user-defined factor).
The regression channels are not displayed on the chart but are used to plot shapes & fullfilled a table.
Blue shapes are plotted when 6th channel or 7th channel are lower than 3 deviations
Yellow shapes are plotted when 6th channel or 7th channel are higher than 3 deviations
4. Scores, Conditions, and the Summary Table
Scoring System: The indicator goes further by assigning scores across multiple analytical categories, such as:
1. BigPear Score
What It Represents: This score is based on a longer-term moving average of the Pearson correlation values (SMA 100 of the average of the 10 curves of correlation of Pearson). The BigPear category is designed to capture where this longer-term average falls within specific ranges.
Conditions: The script defines nine boolean conditions (labeled BigPear1up through BigPear9up for the “up” direction).
Here's the rules :
BigPear1up = (bigsma_avgPR <= 0.5 and bigsma_avgPR > 0.25)
BigPear2up = (bigsma_avgPR <= 0.25 and bigsma_avgPR > 0)
BigPear3up = (bigsma_avgPR <= 0 and bigsma_avgPR > -0.25)
BigPear4up = (bigsma_avgPR <= -0.25 and bigsma_avgPR > -0.5)
BigPear5up = (bigsma_avgPR <= -0.5 and bigsma_avgPR > -0.65)
BigPear6up = (bigsma_avgPR <= -0.65 and bigsma_avgPR > -0.7)
BigPear7up = (bigsma_avgPR <= -0.7 and bigsma_avgPR > -0.75)
BigPear8up = (bigsma_avgPR <= -0.75 and bigsma_avgPR > -0.8)
BigPear9up = (bigsma_avgPR <= -0.8)
Conditions: The script defines nine boolean conditions (labeled BigPear1down through BigPear9down for the “down” direction).
BigPear1down = (bigsma_avgPR >= -0.5 and bigsma_avgPR < -0.25)
BigPear2down = (bigsma_avgPR >= -0.25 and bigsma_avgPR < 0)
BigPear3down = (bigsma_avgPR >= 0 and bigsma_avgPR < 0.25)
BigPear4down = (bigsma_avgPR >= 0.25 and bigsma_avgPR < 0.5)
BigPear5down = (bigsma_avgPR >= 0.5 and bigsma_avgPR < 0.65)
BigPear6down = (bigsma_avgPR >= 0.65 and bigsma_avgPR < 0.7)
BigPear7down = (bigsma_avgPR >= 0.7 and bigsma_avgPR < 0.75)
BigPear8down = (bigsma_avgPR >= 0.75 and bigsma_avgPR < 0.8)
BigPear9down = (bigsma_avgPR >= 0.8)
Weighting:
If BigPear1up is true, 1 point is added; if BigPear2up is true, 2 points are added; and so on up to 9 points from BigPear9up.
Total Score:
The positive score (posScoreBigPear) is the sum of these weighted conditions.
Similarly, there is a negative score (negScoreBigPear) that is calculated using a mirrored set of conditions (named BigPear1down to BigPear9down), each contributing a negative weight (from -1 to -9).
In essence, the BigPear score tells you—in a weighted cumulative way—where the longer-term correlation average falls relative to predefined thresholds.
2. Pear Score
What It Represents: This category uses the immediate average of the Pearson correlations (avgPR) rather than a longer-term smoothed version. It reflects a more current picture of the market’s correlation behavior.
How It’s Calculated:
Conditions: There are nine conditions defined for the “up” scenario (named Pear1up through Pear9up), which partition the range of avgPR into intervals. For instance:
Pear1up = (avgPR > -0.2 and avgPR <= 0)
Pear2up = (avgPR > -0.4 and avgPR <= -0.2)
Pear3up = (avgPR > -0.5 and avgPR <= -0.4)
Pear4up = (avgPR > -0.6 and avgPR <= -0.5)
Pear5up = (avgPR > -0.65 and avgPR <= -0.6)
Pear6up = (avgPR > -0.7 and avgPR <= -0.65)
Pear7up = (avgPR > -0.75 and avgPR <= -0.7)
Pear8up = (avgPR > -0.8 and avgPR <= -0.75)
Pear9up = (avgPR > -1 and avgPR <= -0.8)
There are nine conditions defined for the “down” scenario (named Pear1down through Pear9down), which partition the range of avgPR into intervals. For instance:
Pear1down = (avgPR >= 0 and avgPR < 0.2)
Pear2down = (avgPR >= 0.2 and avgPR < 0.4)
Pear3down = (avgPR >= 0.4 and avgPR < 0.5)
Pear4down = (avgPR >= 0.5 and avgPR < 0.6)
Pear5down = (avgPR >= 0.6 and avgPR < 0.65)
Pear6down = (avgPR >= 0.65 and avgPR < 0.7)
Pear7down = (avgPR >= 0.7 and avgPR < 0.75)
Pear8down = (avgPR >= 0.75 and avgPR < 0.8)
Pear9down = (avgPR >= 0.8 and avgPR <= 1)
Weighting:
Each condition has an associated weight, such as 0.9 for Pear1up, 1.9 for Pear2up, and so on, up to 9 for Pear9up.
Sum up :
Pear1up = 0.9
Pear2up = 1.9
Pear3up = 2.9
Pear4up = 3.9
Pear5up = 4.99
Pear6up = 6
Pear7up = 7
Pear8up = 8
Pear9up = 9
Total Score:
The positive score (posScorePear) is the sum of these values for each condition that returns true.
A corresponding negative score (negScorePear) is calculated using conditions for when avgPR falls on the positive side, with similar weights in the negative direction.
This score quantifies the current correlation reading by translating its relative level into a numeric score through a weighted sum.
3. Trendpear Score
What It Represents: The Trendpear score is more dynamic as it compares the current avgPR with its short-term moving average (sma_avgPR / 14 periods ) and also considers its relationship with an even longer moving average (bigsma_avgPR / 100 periods). It is meant to capture the trend or momentum in the correlation behavior.
How It’s Calculated:
Conditions: Nine conditions (from Trendpear1up to Trendpear9up) are defined to check:
Whether avgPR is below, equal to, or above sma_avgPR by different margins;
Whether it is trending upward (i.e., it is higher than its previous value).
Here are the rules
Trendpear1up = (avgPR <= sma_avgPR -0.2) and (avgPR >= avgPR )
Trendpear2up = (avgPR > sma_avgPR -0.2) and (avgPR <= sma_avgPR -0.07) and (avgPR >= avgPR )
Trendpear3up = (avgPR > sma_avgPR -0.07) and (avgPR <= sma_avgPR -0.03) and (avgPR >= avgPR )
Trendpear4up = (avgPR > sma_avgPR -0.03) and (avgPR <= sma_avgPR -0.02) and (avgPR >= avgPR )
Trendpear5up = (avgPR > sma_avgPR -0.02) and (avgPR <= sma_avgPR -0.01) and (avgPR >= avgPR )
Trendpear6up = (avgPR > sma_avgPR -0.01) and (avgPR <= sma_avgPR -0.001) and (avgPR >= avgPR )
Trendpear7up = (avgPR >= sma_avgPR) and (avgPR >= avgPR ) and (avgPR <= bigsma_avgPR)
Trendpear8up = (avgPR >= sma_avgPR) and (avgPR >= avgPR ) and (avgPR >= bigsma_avgPR -0.03)
Trendpear9up = (avgPR >= sma_avgPR) and (avgPR >= avgPR ) and (avgPR >= bigsma_avgPR)
Weighting:
The weights here are not linear. For example, the lightest condition may add 0.1 point, whereas the most extreme condition (e.g., when avgPR is not only above the moving average but also reaches a high proportion relative to bigsma_avgPR) might add as much as 90 points.
Trendpear1up = 0.1
Trendpear2up = 0.2
Trendpear3up = 0.3
Trendpear4up = 0.4
Trendpear5up = 0.5
Trendpear6up = 0.69
Trendpear7up = 7
Trendpear8up = 8.9
Trendpear9up = 90
Total Score:
The positive score (posScoreTrendpear) is the sum of the weights from all conditions that are satisfied.
A negative counterpart (negScoreTrendpear) exists similarly for when the trend indicates a downward bias.
Trendpear integrates both the level and the direction of change in the correlations, giving a strong numeric indication when the market starts to diverge from its short-term average.
4. Deviation Score
What It Represents: The “Écart” score quantifies how far the asset’s price deviates from the boundaries defined by the regression channels. This metric can indicate if the price is excessively deviating—which might signal an eventual reversion—or confirming a breakout.
How It’s Calculated:
Conditions: For each channel (with at least seven channels contributing to the scoring from the provided code), there are three levels of deviation:
First tier (EcartXup): Checks if the price is below the upper boundary but above a second boundary.
Second tier (EcartXup2): Checks if the price has dropped further, between a lower and a more extreme boundary.
Third tier (EcartXup3): Checks if the price is below the most extreme limit.
Weighting:
Each tier within a channel has a very small weight for the lowest severities (for example, 0.0001 for the first tier, 0.0002 for the second, 0.0003 for the third) with weights increasing with the channel index.
First channel : 0.0001 to 0.0003 (very short term)
Second channel : 0.001 to 0.003 (short term)
Third channel : 0.01 to 0.03 (short mid term)
4th channel : 0.1 to 0.3 ( mid term)
5th channel: 1 to 3 (long mid term)
6th channel : 10 to 30 (long term)
7th channel : 100 to 300 (very long term)
Total Score:
The overall positive score (posScoreEcart) is the sum of all the weights for conditions met among the first, second, and third tiers.
The corresponding negative score (negScoreEcart) is calculated similarly (using conditions when the price is above the channel boundaries), with the weights being the same in magnitude but negative in sign.
This layered scoring method allows the indicator to reflect both minor and major deviations in a gradated and cumulative manner.
Example :
Score + = 321.0001
Score - = -0.111
The asset price is really overextended in long term view, not for mid term & short term expect the in the very short term.
Score + = 0.0033
Score - = -1.11
The asset price is really extended in short term view, not for mid term (even a bit underextended) & long term is neutral
5. Slope Score
What It Represents: The Slope score captures the trend direction and steepness of the regression channels. It reflects whether the regression line (and hence the underlying trend) is sloping upward or downward.
How It’s Calculated:
Conditions:
if the slope has a uptrend = 1
if the slope has a downtrend = -1
Weighting:
First channel : 0.0001 to 0.0003 (very short term)
Second channel : 0.001 to 0.003 (short term)
Third channel : 0.01 to 0.03 (short mid term)
4th channel : 0.1 to 0.3 ( mid term)
5th channel: 1 to 3 (long mid term)
6th channel : 10 to 30 (long term)
7th channel : 100 to 300 (very long term)
The positive slope conditions incrementally add weights from 0.0001 for the smallest positive slopes to 100 for the largest among the seven checks. And negative for the downward slopes.
The positive score (posScoreSlope) is the sum of all the weights from the upward slope conditions that are met.
The negative score (negScoreSlope) sums the negative weights when downward conditions are met.
Example :
Score + = 111
Score - = -0.1111
Trend is up for longterm & down for mid & short term
The slope score therefore emphasizes both the magnitude and the direction of the trend as indicated by the regression channels, with an intentional asymmetry that flags strong downtrends more aggressively.
Summary
For each category—BigPear, Pear, Trendpear, Écart, and Slope—the indicator evaluates a defined set of conditions. Each condition is a binary test (true/false) based on different thresholds or comparisons (for example, comparing the current value to a moving average or a channel boundary). When a condition is true, its assigned weight is added to the cumulative score for that category. These individual scores, both positive and negative, are then displayed in a table, making it easy for the trader to see at a glance where the market stands according to each analytical dimension.
This comprehensive, weighted approach allows the indicator to encapsulate several layers of market information into a single set of scores, aiding in the identification of potential trading opportunities or market reversals.
5. Practical Use and Application
How to Use the Indicator:
Interpreting the Signals:
On your chart, observe the following components:
The individual correlation curves and their average, plotted with visual thresholds;
Visual markers (such as emojis and shape markers) that signal potential oversold or overbought conditions
The summary table that aggregates the scores from each category, offering a quick glance at the market’s state.
Trading Alerts and Decisions: Set your TradingView alerts through the alertcondition functions provided by the indicator. This way, you receive immediate notifications when critical conditions are met, allowing you to react as soon as the market reaches key levels. This tool is especially beneficial for advanced traders who want to combine multiple technical dimensions to optimize entry and exit points with a confluence of signals.
Conclusion and Additional Insights
In summary, this advanced indicator innovatively combines multi-scale Pearson correlation analysis (via multiple linear regressions) with robust regression channel analysis. It offers a deep and nuanced view of market dynamics by delivering clear visual signals and a comprehensive numerical summary through a built-in score table.
Combine this indicator with other tools (e.g., oscillators, moving averages, volume indicators) to enhance overall strategy robustness.
3x MTF EMA + VWAP + Daily CPR3x MTF EMA + VWAP + Daily CPR
A Complete Trend & Structure Toolkit for Informed Decisions
This all-in-one indicator blends the power of multi-timeframe analysis, volume-weighted price action, and daily structure zones to give you high-confidence entries and real-time market context.
📌 Key Features:
✅ 3x Multi-Timeframe EMAs
Plot up to three EMAs from any timeframe (e.g., 15m, 1H, Daily) on your current chart. Each EMA comes with:
Custom length
Custom source (close, hl2, etc.)
Independent timeframe
Color and visibility toggles
Use them for dynamic support/resistance, trend direction, and confluence zones.
✅ VWAP (Volume-Weighted Average Price)
Industry-standard intraday VWAP to track the true average traded price. Essential for:
Volume-weighted mean reversion
Institutional support/resistance
Intraday directional bias
Auto-hides on higher timeframes for precision.
✅ Daily CPR (Central Pivot Range)
Maps out key market structure levels for the day:
Central Pivot (P)
Top Central (TC)
Bottom Central (BC)
Widely used by pros for reversal zones, trend continuation, and opening range setups.
🎯 Why Use This Script?
Whether you're scalping intraday or swinging higher timeframes, this indicator gives you:
Instant clarity on market structure
High-probability trend confluence
Reliable institutional price zones
Perfect for SMC, ICT, VWAP traders, or anyone seeking an edge with precision levels.
⚙️ Fully Customizable
Toggle visibility for each layer (EMA, VWAP, CPR)
Adjust EMA sources, lengths, timeframes
Lightweight & optimized for performance [/
SMA 200 High/Low with Buy/Sell Signals✅ Buy Rule:
Wait for the closing price of the candle (close) to cross above the EMA200 (from below to above).
This indicates that the trend may be shifting to an uptrend.
You may add confirmation from other indicators such as RSI, MACD, or Volume.
✅ Sell Rule:
Wait for the closing price to cross below the EMA200 (from above to below).
This suggests that the trend may be turning into a downtrend.
EMA 200 Monitor - Bybit CoinsEMA 200 Monitor - Bybit Coins
📊 OVERVIEW
The EMA 200 Monitor - Bybit Coins is an advanced indicator that automatically monitors 30 of the top cryptocurrencies traded on Bybit, alerting you when they are close to the 200-period Exponential Moving Average on the 4-hour timeframe.
This indicator was developed especially for traders who use the EMA 200 as a key support/resistance level in their swing trading and position trading strategies.
🎯 WHAT IT'S FOR
Multi-Asset Monitoring: Simultaneous monitoring of 30 cryptocurrencies without having to switch between charts
Opportunity Identification: Detects when coins are approaching the 200 EMA, a crucial technical level
Automated Alerts: Real-time notifications when a coin reaches the configured proximity
Time Efficiency: Eliminates the need to manually check chart collections
⚙️ HOW IT WORKS
Main Functionality
The indicator uses the request.security() function to fetch price data and calculate the 200 EMA of each monitored asset. With each new bar, the script:
Calculates the distance between the current price and the 200 EMA for each coin
Identifies proximity based on the configured percentage (default: 2%)
Displays results in a table organized on the chart
Generates automatic alerts when proximity is detected
Monitored Coins
Major : BTC, ETH, BNB, ADA, XRP, SOL, DOT, DOGE, AVAX
DeFi : UNI, LINK, ATOM, ICP, NEAR, OP, ARB, INJ
Memecoins : SHIB, PEPE, WIF, BONK, FLOKI
Emerging : SUI, TON, APT, POL (ex-MATIC)
📋 AVAILABLE SETTINGS
Adjustable Parameters
EMA Length (Default: 200): Exponential Moving Average Period
Proximity Percentage (Default: 2%): Distance in percentage to consider "close"
Show Table (Default: Active): Show/hide results table
Table Position: Position of the table on the chart (9 options available)
Color System
🔴 Red: Distance ≤ 1% (very close)
🟠 Orange: Distance ≤ 1.5% (close)
🟡 Yellow: Distance ≤ 2% (approaching)
🚀 HOW TO USE
Initial Configuration
Add the indicator to the 4-hour timeframe chart
Set the parameters according to your strategy
Position the table where there is no graphic preference
Setting Alerts
Click "Create Alert" in TradingView
Select the "EMA 200 Monitor" indicator
Set the notification frequency and method
Activate the alert to receive automatic notifications
Results Interpretation
The table shows:
Coin: Asset name (e.g. BTC, ETH)
Price: Current currency quote
EMA 200: Current value of the moving average
Distance: Percentage of proximity to the core code
💡 STRATEGIES TO USE
Reversal Trading
Entry: When price touches or approaches the EMA 200
Stop: Below/above the EMA with a safety margin
Target: Previous resistance/support levels
Breakout Trading
Monitoring: Watch for currencies consolidating near the EMA 200
Entry: When the media is finally broken
Confirmation: Volume and close above/below the EMA
Swing Trading
Identification: Use the monitor to detect setups in formation
Timing: Wait for the EMA 200 to approach for detailed analysis
Management: Use the EMA as a reference for stops dynamics
⚠️ IMPORTANT CONSIDERATIONS
Technical Limitations
Request Bybit data: Access to exchange symbols required
Specific timeframe: Optimized for 4-hour analysis
Minimum delay: Data updated with each new bar
Usage Recommendations
Combine with technical analysis: Use together with other indicators
Confirm the configuration: Check the graphic patterns before trading
Manage risk: Always use stop loss and adequate position sizing
Backtesting: Test your strategy before applying with real capital
Disclaimer
This indicator is a technical analysis tool and does not constitute investment advice. Always do your own analysis and manage detailed information about the risks of your operations.
🔧 TECHNICAL INFORMATION
Pine Script version: v6
Type: Indicator (overlay=true)
Compatibility: All TradingView plans
Resources used: request.security(), arrays, tables
Performance: Optimized for multiple simultaneous queries
📈 COMPETITIVE ADVANTAGES
✅ Simultaneous monitoring of 30 major assets ✅ Clear visual interface with intuitive core system ✅ Customizable alerts for different details ✅ Optimized code for maximum performance ✅ Flexible configuration adaptable to different strategies ✅ Real-time update without the need for manual refresh
Developed for traders who value efficiency and accuracy in identifying market opportunities based on the EMA 20
Bayram Günleri 2020-2025// This script highlights the days of Ramadan Eid and Eid al-Adha (including the day before) on the chart.
// This indicator is designed to visually mark Ramadan Eid, Eid al-Adha, and their preceding days (Arefe) between 2020 and 2025.
// It colors the background in orange on those specific dates, making it easy to identify and analyze holiday periods.
// Works across all timeframes (1m, 1h, 1d, etc.).
// Dates are checked using year, month, and dayofmonth values manually.
// All times are based on Turkish local time (UTC+3).
// Ramazan Bayramı ve Kurban Bayramı günlerini gösterir
Jeff_T_FXRSI that you can set alerts. Its just a regular RSI, there is nothing fancy about it. Tradingview is making me write all this stuff because it says I was too short in my answer. I wanted to get alerted for over bought and over sold and so I had to make this.
Close Difference Histogram with EMA SD Bands and LinesIndicator for the NSI system.
Possible use on the 3D timeframe for BTC.
Parabolic Run Detector (With Weighted Caution)This indicator, Parabolic Run Detector (With Weighted Caution), is designed to help traders identify moments of strong directional movement (I call it a run) in asset prices, especially those that exhibit a parabolic character. It uses a combination of log-scale price slopes, RSI momentum, and Ichimoku cloud structure (via the very useful Tenkan-Kijun "clamp") to evaluate whether a price move has both strength and sustainability. When certain thresholds are met, it marks the beginning of a potential run with a green circle below the price chart, helping traders spot entries early in high-momentum conditions.
In addition to identifying the start of a run, the indicator also looks for end-of-run caution signals. These are marked with orange circles, indicating potential exhaustion or overextension. The caution logic doesn’t require all conditions to trigger at once — instead, it uses a weighted scoring system based on RSI extension, slowing price momentum (second derivative), and the widening of the Ichimoku clamp. If these conditions cross a confidence threshold within a set number of bars after a run begins, the caution signal fires. This allows traders to stay alert to reversal or consolidation risks without being prematurely spooked by noise. So, choose to ignore them, but they are there for you to assess.
You can fine-tune sensitivity with a set of adjustable parameters, including minimum slope values, RSI reversion awareness (bias weight), clamp thresholds, and spacing between signals. So play around to see what works best for you! For advanced users, the option to toggle between static or dynamically calculated RSI baselines and adapt Ichimoku settings for crypto vs. legacy markets adds another layer of contextual accuracy. Whether you're trading Bitcoin on a 4-hour chart or scanning equities on a daily timeframe, this tool helps bring clarity to trend acceleration and potential fatigue, all while minimizing visual clutter and giving you intuitive visual cues.
Let me know what you think.
OpenAI Signal Generator - Enhanced Accuracy# AI-Powered Trading Signal Generator Guide
## Overview
This is an advanced trading signal generator that combines multiple technical indicators using AI-enhanced logic to generate high-accuracy trading signals. The indicator uses a sophisticated combination of RSI, MACD, Bollinger Bands, EMAs, ADX, and volume analysis to provide reliable buy/sell signals with comprehensive market analysis.
## Key Features
### 1. Multi-Indicator Analysis
- **RSI (Relative Strength Index)**
- Length: 14 periods (default)
- Overbought: 70 (default)
- Oversold: 30 (default)
- Used for identifying overbought/oversold conditions
- **MACD (Moving Average Convergence Divergence)**
- Fast Length: 12 (default)
- Slow Length: 26 (default)
- Signal Length: 9 (default)
- Identifies trend direction and momentum
- **Bollinger Bands**
- Length: 20 periods (default)
- Multiplier: 2.0 (default)
- Measures volatility and potential reversal points
- **EMAs (Exponential Moving Averages)**
- Fast EMA: 9 periods (default)
- Slow EMA: 21 periods (default)
- Used for trend confirmation
- **ADX (Average Directional Index)**
- Length: 14 periods (default)
- Threshold: 25 (default)
- Measures trend strength
- **Volume Analysis**
- MA Length: 20 periods (default)
- Threshold: 1.5x average (default)
- Confirms signal strength
### 2. Advanced Features
- **Customizable Signal Frequency**
- Daily
- Weekly
- 4-Hour
- Hourly
- On Every Close
- **Enhanced Filtering**
- EMA crossover confirmation
- ADX trend strength filter
- Volume confirmation
- ATR-based volatility filter
- **Comprehensive Alert System**
- JSON-formatted alerts
- Detailed technical analysis
- Multiple timeframe analysis
- Customizable alert frequency
## How to Use
### 1. Initial Setup
1. Open TradingView and create a new chart
2. Select your preferred trading pair
3. Choose an appropriate timeframe
4. Apply the indicator to your chart
### 2. Configuration
#### Basic Settings
- **Signal Frequency**: Choose how often signals are generated
- Daily: Signals at the start of each day
- Weekly: Signals at the start of each week
- 4-Hour: Signals every 4 hours
- Hourly: Signals every hour
- On Every Close: Signals on every candle close
- **Enable Signals**: Toggle signal generation on/off
- **Include Volume**: Toggle volume analysis on/off
#### Technical Parameters
##### RSI Settings
- Adjust `rsi_length` (default: 14)
- Modify `rsi_overbought` (default: 70)
- Modify `rsi_oversold` (default: 30)
##### EMA Settings
- Fast EMA Length (default: 9)
- Slow EMA Length (default: 21)
##### MACD Settings
- Fast Length (default: 12)
- Slow Length (default: 26)
- Signal Length (default: 9)
##### Bollinger Bands
- Length (default: 20)
- Multiplier (default: 2.0)
##### Enhanced Filters
- ADX Length (default: 14)
- ADX Threshold (default: 25)
- Volume MA Length (default: 20)
- Volume Threshold (default: 1.5)
- ATR Length (default: 14)
- ATR Multiplier (default: 1.5)
### 3. Signal Interpretation
#### Buy Signal Requirements
1. RSI crosses above oversold level (30)
2. Price below lower Bollinger Band
3. MACD histogram increasing
4. Fast EMA above Slow EMA
5. ADX above threshold (25)
6. Volume above threshold (if enabled)
7. Market volatility check (if enabled)
#### Sell Signal Requirements
1. RSI crosses below overbought level (70)
2. Price above upper Bollinger Band
3. MACD histogram decreasing
4. Fast EMA below Slow EMA
5. ADX above threshold (25)
6. Volume above threshold (if enabled)
7. Market volatility check (if enabled)
### 4. Visual Indicators
#### Chart Elements
- **Moving Averages**
- SMA (Blue line)
- Fast EMA (Yellow line)
- Slow EMA (Purple line)
- **Bollinger Bands**
- Upper Band (Green line)
- Middle Band (Orange line)
- Lower Band (Green line)
- **Signal Markers**
- Buy Signals: Green triangles below bars
- Sell Signals: Red triangles above bars
- **Background Colors**
- Light green: Buy signal period
- Light red: Sell signal period
### 5. Alert System
#### Alert Types
1. **Signal Alerts**
- Generated when buy/sell conditions are met
- Includes comprehensive technical analysis
- JSON-formatted for easy integration
2. **Frequency-Based Alerts**
- Daily/Weekly/4-Hour/Hourly/Every Close
- Includes current market conditions
- Technical indicator values
#### Alert Message Format
```json
{
"symbol": "TICKER",
"side": "BUY/SELL/NONE",
"rsi": "value",
"macd": "value",
"signal": "value",
"adx": "value",
"bb_upper": "value",
"bb_middle": "value",
"bb_lower": "value",
"ema_fast": "value",
"ema_slow": "value",
"volume": "value",
"vol_ma": "value",
"atr": "value",
"leverage": 10,
"stop_loss_percent": 2,
"take_profit_percent": 5
}
```
## Best Practices
### 1. Signal Confirmation
- Wait for multiple confirmations
- Consider market conditions
- Check volume confirmation
- Verify trend strength with ADX
### 2. Risk Management
- Use appropriate position sizing
- Implement stop losses (default 2%)
- Set take profit levels (default 5%)
- Monitor market volatility
### 3. Optimization
- Adjust parameters based on:
- Trading pair volatility
- Market conditions
- Timeframe
- Trading style
### 4. Common Mistakes to Avoid
1. Trading without volume confirmation
2. Ignoring ADX trend strength
3. Trading against the trend
4. Not considering market volatility
5. Overtrading on weak signals
## Performance Monitoring
Regularly review:
1. Signal accuracy
2. Win rate
3. Average profit per trade
4. False signal frequency
5. Performance in different market conditions
## Disclaimer
This indicator is for educational purposes only. Past performance is not indicative of future results. Always use proper risk management and trade responsibly. Trading involves significant risk of loss and is not suitable for all investors.
time NYThis TradingView Pine Script plots vertical lines at specific key times throughout the trading day based on the New York timezone (Eastern Time), which aligns with Colombian time during Daylight Saving Time (UTC-4). It also highlights the opening price of the 00:00 candle and shades a specific time range on the chart.
Key Features:
Timezone Configuration:
Uses "America/New_York" to define the trading session times.
Opening Price at 00:00:
Captures and stores the opening price of the candle at exactly 00:00.
Optionally stores the bar index (although it's not used visually here).
Vertical Lines at Key Times:
Draws vertical dashed lines at these specific times each day:
00:00
07:30
08:30
09:45
10:00
10:15
10:30
10:45
11:00
13:30
16:30
These lines extend above and below the chart range, from the highest to the lowest price over the last 500 bars.
Background Highlight:
Shades the time interval between 11:00 and 13:30 with a semi-transparent gray background, but only for the current day.
5th Candle Breakout (Selected Date)✅ How to Use
🔁 Set the targetDate input to any date you want to test the setup on.
🕒 Use this on 30-minute timeframe.
📊 Works great on NIFTY, BANKNIFTY, or any F&O instrument.
📌 Uses body-close breakout during 6th or 7th candle.
🎯 Plots real entry, SL, and 1x target.
Options Risk Manager v2.2.0 - Priority 7 CompleteScript Description for TradingView Publication
Options Risk Manager v2.2.0 - Priority 7 Complete
What does this script do?
Options Risk Manager v2.2.0 is a comprehensive position management system designed specifically for options traders. The indicator calculates precise stop loss levels, risk/reward targets, and position sizing based on user-defined risk parameters. It provides real-time profit/loss tracking, options Greeks monitoring, and automated alert systems for critical price levels.
The script displays entry points, stop losses, and profit targets directly on the chart while continuously calculating position metrics including dollar risk, account exposure, and probability of success. Version 2.2.0 introduces Priority 7 advanced alerts with dynamic risk warnings and multi-condition notifications.
How does it do it?
The script performs several key calculations:
1. Risk-Based Stop Loss Calculation - Determines stop loss levels based on percentage of entry price, automatically adjusting for calls versus puts. Put positions place stops above entry, while calls place stops below.
2. Position Sizing Algorithm - Calculates optimal contract quantities using account size, risk
percentage, and stop distance to ensure consistent risk per trade regardless of underlying price.
3. Options-Specific P&L Tracking - Incorporates Delta, Gamma, Vega, and Theta to provide accurate profit/loss calculations for options positions, including time decay effects.
4. Three-Phase Trade Management - Implements systematic position management through Entry
Phase (initial risk), Profit Phase (approaching target), and Trailing Phase (EMA-based exit
management).
5. Multi-Level Alert System - Monitors price action, Greeks thresholds, time decay acceleration, and account risk levels to generate context-aware notifications.
How to use it?
Initial Setup:
1. Apply indicator to any optionable security
2. Toggle "In Position" ON when entering a trade
3. Set Direction (Call/Put) and Side (Long/Short)
4. Enter the underlying price at position entry
5. Specify number of contracts and risk percentage
Position Management:
Blue line shows entry price
Red line indicates stop loss level
Orange line displays risk/reward target
Purple EMA line activates after target hit
Monitor real-time P&L in trade panels
Alert Configuration:
Enable Advanced Alerts in settings
Set profit/loss notification thresholds
Configure Greek-based warnings
Activate time decay alerts for expiration
Risk Parameters:
Risk % determines stop distance from entry
Account Value sets position sizing limits
Contract Multiplier (standard = 100)
R:R Ratio defines profit targets
What makes it unique?
Options Risk Manager addresses the specific challenges of options trading that generic indicators miss. The script accounts for the inverse relationship in put options (profiting from price declines), incorporates Greeks for accurate P&L calculations, and provides options-specific limit orders for TradeStation integration.
The three-phase management system removes emotional decision-making by defining clear rules for position management. Phase transitions occur automatically based on price action, shifting from initial risk management to profit protection to trend-following modes.
Version 2.2.0's Priority 7 alert system provides intelligent notifications that include live metrics, risk warnings, and market context rather than simple price crosses.
Key Features Summary
Options-Specific Calculations - Proper handling of calls/puts with inverse relationships
Risk-Based Position Sizing - Consistent risk regardless of underlying price
Greeks Integration - Delta, Gamma, Vega, Theta for accurate tracking
Phase Management System - Systematic three-stage position handling
Advanced Alert System - Context-aware notifications with metrics
TradeStation Integration - Option limit orders for execution
Visual Risk Display - Clear chart overlays for all levels
Probability Calculator - Win/loss probability with expected value
Multi-Account Support - Scales from small to large accounts
Important Notes
This indicator requires manual input of option prices and Greeks (available from your broker's option chain). It functions as a risk management overlay and does not generate entry signals. The calculations assume standard options contracts of 100 shares.
Designed for TradeStation platform with full functionality. Basic features available on other platforms
without options data integration. Always verify calculations with your broker's risk system before placing
trades.
iGTR_DailyDaily TF chart setup for index. Use it wisely with MACD or Alpha on same TF for a bigger momentum.
Based on multi TF analysis of BB & MA.
Baseline Entry + RSI Divergence Exit + Triangle+DiamondThis strategy focuses on low-frequency trades with high win factor and winning probability.
It uses momentum to enter trades, which is combined with moving averages and volume. It exits based on partial profit booking and when the momentum turns to the opposite direction. It can also exit on RSI divergences. First, check the backtest result for it.
I like to use it on Flockusdt.p with the parameters Stop loss—1.2, Take profit—10,10, Ema—8 42, 9, 44, while keeping the normal CVD off.
It has fantastic risk management, a Win rate of 56.52%, a win factor of 41 on a 4-hour time frame at 1000 capital, and a 0.05% commission on flockusdt on Blofin.
Session RangeThis Indicator Shows you the high, low and the midpoint for a chosen session and displays them on the chart.
You can make the following inputs:
Timezone: Choose your time zone (in UTC) to display the session correctly
Session Time: Choose the start time and end time of the session you want to have displayed.
Show Session Midpoint: Choose between displaying or not displaying the midpoint of the sessions high and low.
Extend Session Values until next Session: Choose this option if you want to display the sessions range until the next session starts. The midpoint will only be displayed if you chose "yes" at "Show Session Midpoint?"
Maximum number of bars between sessions: This is needed to ensure the correct display of the extended lines. Also this will affect the running speed of the script.
Limitations:
A higher number between bars slows down the script. What does that mean practically? If you choose to not have the sessions values displayed until the next session you can set this to 1 and the script will run as fast as it can. If you choose to display all the values until the next session you have to make sure that the number you put in is higher than the number of bars between the sessions. Otherwise the lines will be displayed backwards. As this affects the calculation speed you want to keep the number as low as possible. The default setting is 300 which is fine for 5 minute charts. On a 1 minute chart you will have to use something around 5000 depending on how long your session is.
Also the script will only run correctly if the start time of your session can be divided by the timeframe you are using. Example: you can use a 1min, 3min, 5min, or 15min chart on all sessions as they can only start every 15 minutes and 15 can be divided by all these numbers. A 2 minute timeframe will only work on sessions that start at minute 00 or 30, as 15 and 45 can not be divided by 2.
Customization and Alerts:
You can change the color of the sessions high, low, midpoint and background filling. The line style can also be changed but this might lead to a faulty display of the session.
The style of the extension lines can not be altered.
Alerts can be added for crossing the sessions high or low (after the session is finished). You do not have to display the extension lines in order to set an alert.
credit: The inspiration (especially for the look of this indicator) comes from the Asian Range by Nico948 indicator.
iFVG Pro ToolkitThe iFVG Pro Toolkit is a collaboration with @TIMELESS1_ to bring you a one stop indicator giving you the ability to filter iFVGs with things like:
- The number of max number of candles allowed before an inversion is considered invalid.
- ATR filter to filter out smaller FVGs.
- Session Filter to show only iFVGs in your trading window.
- Historical iFVGs allowed to plot.
- iFVG Entry type.
- Complete color customization
- Automated Customizable MTF Liquidity Levels.
- Liquidity Timeframe Info Table
- Toggles to enable and disable Lines, FVGs, and Entries
- SMT Divergences with a validation filter
- Alerts for iFVGs and SMTs
A little bit about iFVGs:
Inversion Fair Value Gaps occur when a previous bullish or bearish Fair Value Gap is closed through hence the 'Inversion' aspect.
This can be a very strong sign that price may reverse and sweep the opposing liquidity.
Its a great visual way to see order flow when you inverse the opposite bias momentum within just a few candles.
Waiting for a sweep of BSL or SSL and an iFVG to occur after the fact can be a strong sign that we will reverse and sweep opposing liquidity before pushing higher or lower.
A little bit about Liquidity Levels:
Liquidity levels also know as Buyside Liquidity (BSL) and Sellside Liquidity (SSL) is commonly used as targets to take profit or to look for entries due to most traders and institutions having large blocks of orders sitting in those areas which can act as a magnet for price.
A little bit about SMT Divergence:
SMT Divergences occur daily in the market.
This is when a ticker like SEED_ALEXDRAYM_SHORTINTEREST2:NQ and NYSE:ES are doing the opposite of each other.
Making the opposite highs and/or lows.
When SMTs are forming on the lows it is considered Bullish SMT Divergence which can be strong confluence to enter a long trade when an iFVG is formed before or after a sweep of liquidity or FVG.
When SMTs are forming on the highs it is considered Bearish SMT Divergence which can be strong confluence to enter a short trade when an iFVG is formed before or after a sweep of liquidity of FVG.
Box Lunedi BT (Ultimo visibile)Indicator that shows in a box the Monday's movement and marks 50% of it and can be used for a possible intraday strategy
استراتجية متوسط 50This strategy focuses on identifying precise swing highs and lows, which are treated as key horizontal levels
These levels are integrated with the 50-period moving average, and horizontal lines are automatically drawn at the intersection points between the MA and the swing levels.
The goal is to highlight critical zones where potential reversals or trend continuations may occur, helping traders make more accurate entry and exit decisions based on price behavior and structure
Fair Value Trend Model [SiDec]ABSTRACT
This pine script introduces the Fair Value Trend Model, an on-chart indicator for TradingView that constructs a continuously updating "fair-value" estimate of an asset's price via a logarithmic regression on historical data. Specifically, this model has been applied to Bitcoin (BTC) to fully grasp its fair value in the cryptocurrency market. Symmetric channel bands, defined by fixed percentage offsets around this central fair-value curve, provide a visual band within which normal price fluctuations may occur. Additionally, a short-term projection extends both the fair-value trend and its channel bands forward by a user-specified number of bars.
INTRODUCTION
Technical analysts frequently seek to identify an underlying equilibrium or "fair value" about which prices oscillate. Traditional approaches-moving averages, linear regressions in price-time space, or midlines-capture linear trends but often misrepresent the exponential or power-law growth patterns observable in many financial markets. The Fair Value Trend Model addresses this by performing an ordinary least squares (OLS) regression in log-space, fitting ln(Price) against ln(Days since inception). In practice, the primary application has been to Bitcoin, aiming to fully capture Bitcoin's underlying value dynamics.
The result is a curved trend line in regular (price-time) coordinates, reflecting Bitcoin's long-term compounding characteristics. Surrounding this fair-value curve, symmetric bands at user-specified percentage deviations serve as dynamic support and resistance levels. A simple linear projection extends both the central fair-value and its bands into the immediate future, providing traders with a heuristic for short-term trend continuation.
This exposition details:
Data transformation: converting bar timestamps into days since first bar, then applying natural logarithms to both time and price.
Regression mechanics: incremental (or rolling-window) accumulation of sums to compute the log-space fit parameters.
Fair-value reconstruction: exponentiation of the regression output to yield a price-space estimate.
Channel-band definition: establishing ±X% offsets around the fair-value curve and rendering them visually.
Forecasting methodology: projecting both the fair-value trend and channel bands by extrapolating the most recent incremental change in price-space.
Interpretation: how traders can leverage this model for trend identification, mean-reversion setups, and breakout analysis, particularly in Bitcoin trading.
Analysing the macro cycle on Bitcoin's monthly timeframe illustrates how the fair-value curve aligns with multi-year structural turning points.
DATA TRANSFORMATION AND NOTATION
1. Timestamp Baseline (t0)
Let t0 = timestamp of the very first bar on the chart (in milliseconds). Each subsequent bar has a timestamp ti, where ti ≥ t0.
2. Days Since Inception (d(t))
Define the “days since first bar” as
d(t) = max(1, (t − t0) / 86400000.0)
Here, 86400000.0 represents the number of milliseconds in one day (1,000 ms × 60 seconds × 60 minutes × 24 hours). The lower bound of 1 ensures that we never compute ln(0).
3. Logarithmic Coordinates:
Given the bar’s closing price P(t), define:
xi = ln( d(ti) )
yi = ln( P(ti) )
Thus, each data point is transformed to (xi, yi) in log‐space.
REGRESSION FORMULATION
We assume a log‐linear relationship:
yi = a + b·xi + εi
where εi is the residual error at bar i. Ordinary least squares (OLS) fitting minimizes the sum of squared residuals over N data points. Define the following accumulated sums:
Sx = Σ for i = 1 to N
Sy = Σ for i = 1 to N
Sxy = Σ for i = 1 to N
Sx2 = Σ for i = 1 to N
N = number of data points
The OLS estimates for b (slope) and a (intercept) are:
b = ( N·Sxy − Sx·Sy ) / ( N·Sx2 − (Sx)^2 )
a = ( Sy − b·Sx ) / N
All‐Time Versus Rolling‐Window Mode:
All-Time Mode:
Each new bar increments N by 1.
Update Sx ← Sx + xN, Sy ← Sy + yN, Sxy ← Sxy + xN·yN, Sx2 ← Sx2 + xN^2.
Recompute a and b using the formulas above on the entire dataset.
Rolling-Window Mode:
Fix a window length W. Maintain two arrays holding the most recent W values of {xi} and {yi}.
On each new bar N:
Append (xN, yN) to the arrays; add xN, yN, xN·yN, xN^2 to the sums Sx, Sy, Sxy, Sx2.
If the arrays’ length exceeds W, remove the oldest point (xN−W, yN−W) and subtract its contributions from the sums.
Update N_roll = min(N, W).
Compute b and a using N_roll, Sx, Sy, Sxy, Sx2 as above.
This incremental approach requires only O(1) operations per bar instead of recomputing sums from scratch, making it computationally efficient for long time series.
FAIR‐VALUE RECONSTRUCTION
Once coefficients (a, b) are obtained, the regressed log‐price at time t is:
ŷ(t) = a + b·ln( d(t) )
Mapping back to price space yields the “fair‐value”:
F(t) = exp( ŷ(t) )
= exp( a + b·ln( d(t) ) )
= exp(a) · ^b
In other words, F(t) is a power‐law function of “days since inception,” with exponent b and scale factor C = exp(a). Special cases:
If b = 1, F(t) = C · d(t), which is an exponential function in original time.
If b > 1, the fair‐value grows super‐linearly (accelerating compounding).
If 0 < b < 1, it grows sub‐linearly.
If b < 0, the fair‐value declines over time.
CHANNEL‐BAND DEFINITION
To visualise a “normal” range around the fair‐value curve F(t), we define two channel bands at fixed percentage offsets:
1. Upper Channel Band
U(t) = F(t) · (1 + α_upper)
where α_upper = (Channel Band Upper %) / 100.
2. Lower Channel Band
L(t) = F(t) · (1 − α_lower)
where α_lower = (Channel Band Lower %) / 100.
For example, default values of 50% imply α_upper = α_lower = 0.50, so:
U(t) = 1.50 · F(t)
L(t) = 0.50 · F(t)
When “Show FV Channel Bands” is enabled, both U(t) and L(t) are plotted in a neutral grey, and a semi‐transparent fill is drawn between them to emphasise the channel region.
SHORT‐TERM FORECAST PROJECTION
To extend both the fair‐value and its channel bands M bars into the future, the model uses a simple constant‐increment extrapolation in price space. The procedure is:
1. Compute Recent Increments
Let
F_prev = F( t_{N−1} )
F_curr = F( t_N )
Then define the per‐bar change in fair‐value:
ΔF = F_curr − F_prev
Similarly, for channel bands:
U_prev = U( t_{N−1} ), U_curr = U( t_N ), ΔU = U_curr − U_prev
L_prev = L( t_{N−1} ), L_curr = L( t_N ), ΔL = L_curr − L_prev
2. Forecasted Values After M Bars
Assuming the same per‐bar increments continue:
F_future = F_curr + M · ΔF
U_future = U_curr + M · ΔU
L_future = L_curr + M · ΔL
These forecasted values produce dashed lines on the chart:
A dashed segment from (bar_N, F_curr) to (bar_{N+M}, F_future).
Dashed segments from (bar_N, U_curr) to (bar_{N+M}, U_future), and from (bar_N, L_curr) to (bar_{N+M}, L_future).
Forecasted channel bands are rendered in a subdued grey to distinguish them from the current solid bands. Because this method does not re‐estimate regression coefficients for future t > t_N, it serves as a quick visual heuristic of trend continuation rather than a precise statistical forecast.
MATHEMATICAL SUMMARY
Summarising all key formulas:
1. Days Since Inception
d(t_i) = max( 1, ( t_i − t0 ) / 86400000.0 )
x_i = ln( d(t_i) )
y_i = ln( P(t_i) )
2. Regression Summations (for i = 1..N)
Sx = Σ
Sy = Σ
Sxy = Σ
Sx2 = Σ
N = number of data points (or N_roll if using rolling‐window)
3. OLS Estimator
b = ( N · Sxy − Sx · Sy ) / ( N · Sx2 − (Sx)^2 )
a = ( Sy − b · Sx ) / N
4. Fair‐Value Computation
ŷ(t) = a + b · ln( d(t) )
F(t) = exp( ŷ(t) ) = exp(a) · ^b
5. Channel Bands
U(t) = F(t) · (1 + α_upper)
L(t) = F(t) · (1 − α_lower)
with α_upper = (Channel Band Upper %) / 100, α_lower = (Channel Band Lower %) / 100.
6. Forecast Projection
ΔF = F_curr − F_prev
F_future = F_curr + M · ΔF
ΔU = U_curr − U_prev
U_future = U_curr + M · ΔU
ΔL = L_curr − L_prev
L_future = L_curr + M · ΔL
IMPLEMENTATION CONSIDERATIONS
1. Time Precision
Timestamps are recorded in milliseconds. Dividing by 86400000.0 yields days with fractional precision.
For the very first bar, d(t) = 1 ensures x = ln(1) = 0, avoiding an undefined logarithm.
2. Incremental Versus Sliding Summation
All‐Time Mode: Uses persistent scalar variables (Sx, Sy, Sxy, Sx2, N). On each new bar, add the latest x and y contributions to the sums.
Rolling‐Window Mode: Employs fixed‐length arrays for {x_i} and {y_i}. On each bar, append (x_N, y_N) and update sums; if array length exceeds W, remove the oldest element and subtract its contribution from the sums. This maintains exact sums over the most recent W data points without recomputing from scratch.
3. Numerical Robustness
If the denominator N·Sx2 − (Sx)^2 equals zero (e.g., all x_i identical, as when only one day has passed), then set b = 0 and a = Sy / N. This produces a constant fair‐value F(t) = exp(a).
Enforcing d(t) ≥ 1 avoids attempts to compute ln(0).
4. Plotting Strategy
The fair‐value line F(t) is plotted on each new bar. Its color depends on whether the current price P(t) is above or below F(t): a “bullish” color (e.g., green) when P(t) ≥ F(t), and a “bearish” color (e.g., red) when P(t) < F(t).
The channel bands U(t) and L(t) are plotted in a neutral grey when enabled; otherwise they are set to “not available” (no plot).
A semi‐transparent fill is drawn between U(t) and L(t). Because the fill function is executed at global scope, it is automatically suppressed if either U(t) or L(t) is not plotted (na).
5. Forecast Line Management
Each projection line (for F, U, and L) is created via a persistent line object. On successive bars, the code updates the endpoints of the same line rather than creating a new one each time, preserving chart clarity.
If forecasting is disabled, any existing projection lines are deleted to avoid cluttering the chart.
INTERPRETATION AND APPLICATIONS
1. Trend Identification
The fair‐value curve F(t) represents the best‐fit long‐term trend under the assumption that ln(Price) scales linearly with ln(Days since inception). By capturing power‐law or exponential patterns, it can more accurately reflect underlying compounding behavior than simple linear regressions.
When actual price P(t) lies above U(t), it may be considered “overextended” relative to its long‐term trend; when price falls below L(t), it may be deemed “oversold.” These conditions can signal potential mean‐reversion or breakout opportunities.
2. Mean‐Reversion and Breakout Signals
If price re‐enters the channel after touching or slightly breaching L(t), some traders interpret this as a mean‐reversion bounce and consider initiating a long position.
Conversely, a sustained move above U(t) can indicate strong upward momentum and a possible bullish breakout. Traders often seek confirmation (e.g., price remaining above U(t) for multiple bars, rising volume, or corroborating momentum indicators) before acting.
3. Rolling Versus All‐Time Usage
All‐Time Mode: Captures the entire dataset since inception, focusing on structural, long‐term trends. It is less sensitive to short‐term noise or volatility spikes.
Rolling‐Window Mode: Restricts the regression to the most recent W bars, making the fair‐value curve more responsive to changing market regimes, sudden volatility expansions, or fundamental shifts. Traders who wish to align the model with local behaviour often choose W so that it approximates a market cycle length (e.g., 100–200 bars on a daily chart).
4. Channel Percentage Selection
A wider band (e.g., ±50 %) accommodates larger price swings, reducing the frequency of breaches but potentially delaying actionable signals.
A narrower band (e.g., ±10 %) yields more frequent “overbought/oversold” alerts but may produce more false signals during normal volatility. It is advisable to calibrate the channel width to the asset’s historical volatility regime.
5. Forecast Cautions
The short‐term projection assumes that the last single‐bar increment ΔF remains constant for M bars. In reality, trend acceleration or deceleration can occur, rendering the linear forecast inaccurate.
As such, the forecast serves as a visual guide rather than a statistically rigorous prediction. It is best used in conjunction with other momentum, volume, or volatility indicators to confirm trend continuation or reversal.
LIMITATIONS AND CONSIDERATIONS
1. Power‐Law Assumption
By fitting ln(P) against ln(d), the model posits that P(t) ≈ C · ^b. Real markets may deviate from a pure power‐law, especially around significant news events or structural regime changes. Temporary misalignment can occur.
2. Fixed Channel Width
Markets exhibit heteroskedasticity: volatility can expand or contract unpredictably. A static ±X % band does not adapt to changing volatility. During high‐volatility periods, a fixed ±50 % may prove too narrow and be breached frequently; in unusually calm periods, it may be excessively broad, masking meaningful variations.
3. Endpoint Sensitivity
Regression‐based indicators often display greater curvature near the most recent data, especially under rolling‐window mode. This can create sudden “jumps” in F(t) when new bars arrive, potentially confusing users who expect smoother behaviour.
4. Forecast Simplification
The projection does not re‐estimate regression slope b for future times. It only extends the most recent single‐bar change. Consequently, it should be regarded as an indicative extension rather than a precise forecast.
PRACTICAL IMPLEMENTATION ON TRADINGVIEW
1 Adding the Indicator
In TradingView’s “Indicators” dialog, search for Fair Value Trend Model or visit my profile, under "scripts" add it to your chart.
Add it to any chart (e.g., BTCUSD, AAPL, EURUSD) to see real‐time computation.
2. Configuring Inputs
Show Forecast Line: Toggle on or off the dashed projection of the fair‐value.
Forecast Bars: Choose M, the number of bars to extend into the future (default is often 30).
Forecast Line Colour: Select a high‐contrast colour (e.g., yellow).
Bullish FV Colour / Bearish FV Colour: Define the colour of the fair‐value line when price is above (e.g., green) or below it (e.g., red).
Show FV Channel Bands: Enable to display the grey channel bands around the fair‐value.
Channel Band Upper % / Channel Band Lower %: Set α_upper and α_lower as desired (defaults of 50 % create a ±50 % envelope).
Use Rolling Window?: Choose whether to restrict the regression to recent data.
Window Bars: If rolling mode is enabled, designate W, the number of bars to include.
3. Visual Output
The central curve F(t) appears on the price chart, coloured green when P(t) ≥ F(t) and red when P(t) < F(t).
If channel bands are enabled, the chart shows two grey lines U(t) and L(t) and a subtle shading between them.
If forecasting is active, dashed extensions of F(t), U(t), and L(t) appear, projecting forward by M bars in neutral hues.
CONCLUSION
The Fair Value Trend Model furnishes traders with a mathematically principled estimate of an asset’s equilibrium price curve by fitting a log‐linear regression to historical data. Its channel bands delineate a normal corridor of fluctuation based on fixed percentage offsets, while an optional short‐term projection offers a visual approximation of trend continuation.
By operating in log‐space, the model effectively captures exponential or power‐law growth patterns that linear methods overlook. Rolling‐window capability enables responsiveness to regime shifts, whereas all‐time mode highlights broader structural trends. Nonetheless, users should remain mindful of the model’s assumptions—particularly the power‐law form and fixed band percentages—and employ the forecast projection as a supplemental guide rather than a standalone predictor.
When combined with complementary indicators (e.g., volatility measures, momentum oscillators, volume analysis) and robust risk management, the Fair Value Trend Model can enhance market timing, mean‐reversion identification, and breakout detection across diverse trading environments.
REFERENCES
Draper, N. R., & Smith, H. (1998). Applied Regression Analysis (3rd ed.). Wiley.
Tsay, R. S. (2014). Introductory Time Series with R (2nd ed.). Springer.
Hull, J. C. (2017). Options, Futures, and Other Derivatives (10th ed.). Pearson.
These references provide background on regression, time-series analysis, and financial modeling.
MestreDoFOMO RENKO Sushy System v6🔍 What is this script?
The MestreDoFOMO RENKO Sushy System is a visual tool developed to help traders better interpret the market trend based on a Renko logic adapted to traditional candlestick charts.
It does not use TradingView's native Renko chart, but rather a simulation of Renko behavior, calculated dynamically in real time, adapting to the percentage movement of the price.
🧠 How does it work?
The script uses a Renko simulation with an adjustable percentage base (Renko Size), allowing the trader to define the size of the virtual "blocks" or "bricks" in % of the price. This logic creates a dynamic trend line that changes direction only when there is a sufficient variation in the price — filtering out noise and helping to focus on the prevailing direction.
When a change in direction occurs, a visual signal is displayed on the chart:
💲 Buy signal, when the trend changes from bearish to bullish
👹 Sell signal, when the trend changes from bullish to bearish
These signals are not automatic trading alerts, but rather visual periodic signals based on the internal logic of the system.
📈 Why do we include EMAs (20, 50 and 200)?
Exponential moving averages (EMAs) are widely used in technical analysis as supporting tools for understanding market structure:
EMA 20: A short-term indicator, useful for capturing recent movements.
EMA 50: Considered an interactive trend average, often used as dynamic support/resistance.
EMA 200: A long-term reference, often used to identify the "bigger direction" of the market.
EMAs are indicated in the script and can be enabled or disabled according to the user's preference. They are not part of the signal logic — they serve only as visual and contextual support to assist the trader's manual analysis.
📋 Included features
✅ Renko logic adapted to the candlestick chart, with sensitivity control in %
✅ Trend line based on the current Renko direction
✅ Visual signals of trend change (buy/sell)
✅ Option to enable/disable EMAs 20, 50 and 200
✅ Information panel with trend status, EMA values and current parameters
✅ Customizable trend change alerts
✅ Background color to strengthen the direction (green = high, red = low)
🛠 How to use?
Choose the timeframe: Works best on timeframes longer than 1 hour (e.g. 1H, 4H, Daily).
Adjust the Renko size (%): Try starting with 1% and adjusting according to the asset (crypto, forex, etc.).
Decide whether to use EMAs: Only activate if you want additional context.
Observe the signals and the trend line: They are useful for detecting possible reversals or confirmations of movement.
Combine with other elements: This system is a support tool. For best results, use it in conjunction with price action, liquidity zones or other complementary indicators.
⚠️ Important notice
This script does not execute orders or make automatic decisions. It is an educational and visual tool created to help read the trend in a clean and simple way.
No guarantee of past or future performance is provided. Use is at the sole risk of the user.