DTMA (Double Triangular Moving Average)English Description:
DTMA (Double Triangular Moving Average) is a smoothed moving average indicator that applies a triangular moving average (TMA) twice to reduce lag and provide a more stable trend line. The formula used is:
DTMA = 2 * TMA(src, period) - TMA(TMA(src, period), period)
This implementation focuses on the core calculation and plotting of the DTMA line, omitting visual styling features like bar coloring or trend direction. It's useful for traders looking for a smoother alternative to standard moving averages when identifying trends.
移動平均線
EMA Trend Cross Signal
LOGIC :
This strategy opens position if shorter period Exponential Moving Average (EMA) crosses over or crosses under the longer period EMA and exits position if any of the 3 exit conditions mentioned below is fulfilled
ENTRY CONDITIONS :
LONG ENTRY -
shorter period EMA crosses over longer period EMA
SHORT ENTRY -
shorter period EMA crosses under longer period EMA
EXIT CONDITIONS :
BOTH EMA CROSSED -
LONG EXIT - If price closes below both the shorter period EMA & longer period EMA
SHORT EXIT - If price closes above both the shorter period EMA & longer period EMA
STOP-LOSS HIT -
LONG EXIT - If price closes below the LOW created at the time of ema crossover
SHORT EXIT - If price closes above the HIGH created at the time of ema crossover
EMA CROSS -
LONG EXIT - If shorter period EMA crosses under longer period EMA
SHORT EXIT - If shorter period EMA crosses above longer period EMA
EXAMPLES :
1. TESLA (1-DAY) -
2. APPLE (1-WEEK) -
PYRAMID CLOSING -
Positions will be closed pyramidically in 5 levels and price of each level will be calculated by multiplying current market price with the percentage of each pyramid level's value user has entered
SETTINGS OPTIONS -
MA TYPE -
There is option to choose the type of moving average among SMA, EMA, RMA, WMA, VWMA on chart
MA LENGTH -
There is option to change the length of short period MA & large period MA
FIELD TYPE -
There is also option to choose the price field among open, close, low, high etc. for the selected MA
HISTORICAL BACKTEST -
We can also backtest the strategy for a certain duration of time using this option by changing the start time and end time
SHOW BACKGROUND COLORS FOR EVERY POSITION -
There is option to show background color as green whenever a bullish position is opened and as red whenever a bearish position is opened
SHOW BACKGROUND COLORS FOR EVERY PROFIT & LOSS -
There is option to show green circle in background whenever profit is made and red circle whenever loss is made
SHOW TABLE -
If selected then it will show a table at the top-right corner with all the pyramid levels at which position will be closed for the current scrip
PAUSE TRADING -
If this option is selected then no position will opened on the chart
Trend Scanner ProTrend Scanner Pro, Robust Trend Direction and Strength Estimator
Trend Scanner Pro is designed to evaluate the current market trend with maximum robustness, providing both direction and strength based on statistically reliable data.
This indicator builds upon the core logic of a previous script I developed, called Best SMA Finder. While the original script focused on identifying the most profitable SMA length based on backtested trade performance, Trend Scanner Pro takes that foundation further to serve a different purpose: analyzing and quantifying the actual trend state in real time.
It begins by testing hundreds of SMA lengths, from 10 to 1000 periods. Each one is scored using a custom robustness formula that combines profit factor, number of trades, and win rate. Only SMAs with a sufficient number of trades are retained, ensuring statistical validity and avoiding curve fitting.
The SMA with the highest robustness score is selected as the dynamic reference point. The script then calculates how far the price deviates from it using rolling standard deviation, assigning a trend strength score from -5 (strong bearish) to +5 (strong bullish), with 0 as neutral.
Two detection modes are available:
Slope mode, based on SMA slope reversals
Bias mode, based on directional shifts relative to deviation zones
Optional features:
Deviation bands for visual structure
Candle coloring to reflect trend strength
Compact table showing real-time trend status
This tool is intended for traders who want an adaptive, objective, and statistically grounded assessment of market trend conditions.
Advanced Moving Average ChannelAdvanced Moving Average Channel (MAC) is a comprehensive technical analysis tool that combines multiple moving average types with volume analysis to provide a complete market perspective.
Key Features:
1. Dynamic Channel Formation
- Configurable moving average types (SMA, EMA, WMA, VWMA, HMA, TEMA)
- Separate upper and lower band calculations
- Customizable band offsets for precise channel adjustment
2. Volume Analysis Integration
- Multi-timeframe volume analysis (1H, 24H, 7D)
- Relative volume comparison against historical averages
- Volume trend detection with visual indicators
- Price-level volume distribution profile
3. Market Context Indicators
- RSI integration for overbought/oversold conditions
- Channel position percentage
- Volume-weighted price levels
- Breakout detection with visual signals
Usage Guidelines:
1. Channel Interpretation
- Price within channel: Normal market conditions
- Price above upper band: Potential overbought condition
- Price below lower band: Potential oversold condition
- Channel width: Indicates market volatility
2. Volume Analysis
- High relative volume (>150%): Strong market interest
- Low relative volume (<50%): Weak market interest
- Volume trend arrows: Indicate increasing/decreasing market participation
- Volume profile: Shows price levels with highest trading activity
3. Trading Signals
- Breakout arrows: Potential trend continuation
- RSI extremes: Confirmation of overbought/oversold conditions
- Volume confirmation: Validates price movements
Customization:
- Adjust MA length for different market conditions
- Modify band offsets for tighter/looser channels
- Fine-tune volume analysis parameters
- Customize visual appearance
This indicator is designed for traders who want to combine price action, volume analysis, and market structure in a single, comprehensive tool.
5EMA_BB_ScalpingWhat?
In this forum we have earlier published a public scanner called 5EMA BollingerBand Nifty Stock Scanner , which is getting appreciated by the community. That works on top-40 stocks of NSE as a scanner.
Whereas this time, we have come up with the similar concept as a stand-alone indicator which can be applied for any chart, for any timeframe to reap the benifit of reversal trading.
How it works?
This is essentially a reversal/divergence trading strategy, based on a widely used strategy of Power-of-Stocks 5EMA.
To know the divergence from 5-EMA we just check if the high of the candle (on closing) is below the 5-EMA. Then we check if the closing is inside the Bollinger Band (BB). That's a Buy signal. SL: low of the candle, T: middle and higher BB.
Just opposite for selling. 5-EMA low should be above 5-EMA and closing should be inside BB (lesser than BB higher level). That's a Sell signal. SL: high of the candle, T: middle and lower BB.
Along with we compare the current bar's volume with the last-20 bar VWMA (volume weighted moving average) to determine if the volume is high or low.
Present bar's volume is compared with the previous bar's volume to know if it's rising or falling.
VWAP is also determined using `ta.vwap` built-in support of TradingView.
The Bolling Band width is also notified, along with whether it is rising or falling (comparing with previous candle).
What's special?
We love this reversal trading, as it offers many benifits over trend following strategies:
Risk to Reward (RR) is superior.
It _Does Hit_ stop losses, but the stop losses are tiny.
Means, althrough the Profit Factor looks Nahh , however due to superior RR, end of day it ended up in green.
When the day is sideways, it's difficult to trade in trending strategies. This sort of volatility, reversal strategies works better.
It's always tempting to go agaist the wind. Whole world is in Put/PE and you went opposite and enter a Call/CE. And turns out profitable! That's an amazing feeling, as a trader :)
How to trade using this?
* Put any chart
* Apply this screener from Indicators (shortcut to launch indicators is just type / in your keyboard).
* It will show you the Green up arrow when buy alert comes or red down arrow when sell comes. * Also on the top right it will show the latest signal with entry, SL and target.
Disclaimer
* This piece of software does not come up with any warrantee or any rights of not changing it over the future course of time.
* We are not responsible for any trading/investment decision you are taking out of the outcome of this indicator.
BAFD (Price Action For D.....s)🧠 Overview
This indicator combines multiple Moving Averages (MA) with visual price action elements such as Fair Value Gaps (FVGs) and Swing Points. It provides traders with real-time insight into trend direction, structural breaks, and potential entry zones based on institutional price behavior.
⚙️ Features
1. Multi MA Visualization (SMA & EMA)
- Plots short-, mid-, and long-term moving averages
- Fully customizable: MA type (SMA/EMA) and length per MA
- Dynamic color coding: green for bullish, red for bearish (based on close >/< MA)
2. Fair Value Gaps (FVG) Detection
Detects bullish and bearish imbalances using multiple logic types:
- Same Type: Last 3 candles move in the same direction
- Twin Close: Last 2 candles close in the same direction
- All: Shows all valid FVGs regardless of pattern
Gaps are marked with semi-transparent yellow boxes
Useful for identifying potential liquidity voids and retest zones
3. Swing Highs and Lows
- Automatically identifies major swing points
- Customizable sensitivity (strength setting)
Marked with subtle colored dots for structure identification or support/resistance mapping
📈 Use Cases
- Trend Identification: Visualize momentum on multiple timeframes
- Liquidity Mapping: Spot potential retracement zones using FVGs
- Confluence Building: Combine MA slope, FVG zones, and swing points for refined setups
🛠️ Customizable Settings
- Moving average type and length for each MA
- FVG logic selection and color
- Swing point strength
🔔 Note
This script does not generate buy/sell signals or alerts. It is designed as a visual decision-support tool for discretionary traders who rely on market structure, trend, and price action.
Brian Shannon 5-Day MA BackgroundBrian Shannon 5-Day Moving Average with Dynamic Background Fill
OVERVIEW
This indicator implements Brian Shannon's renowned 5-Day Moving Average methodology from his acclaimed work "Technical Analysis Using Multiple Timeframes." The indicator provides instant visual clarity on short-term trend direction and momentum, making it an essential tool for swing traders and active investors.
KEY FEATURES
• True 5-Day Moving Average: Dynamically calculates the correct period across all timeframes (1min, 5min, 15min, 1H, etc.)
• Visual Price-to-MA Relationship: Color-coded fill between price and the moving average
- Green Fill: Price is above the 5-day MA (bullish short-term momentum)
- Red Fill: Price is below the 5-day MA (bearish short-term momentum)
• Multi-Timeframe Compatible: Works seamlessly on any chart timeframe while maintaining the true 5-day calculation
BRIAN SHANNON'S STRATEGIC APPLICATION
Primary Uses:
1. Trend Identification: Quickly identify short-term momentum shifts
2. Dynamic Support/Resistance: The 5-day MA acts as a moving support level in uptrends and resistance in downtrends
3. Entry Signal Confirmation: Look for pullbacks to the 5-day MA as potential entry points in trending stocks
4. Multi-Timeframe Analysis: Essential component of Shannon's multiple timeframe approach
Perfect Combination with:
• AVWAP (Anchored Volume Weighted Average Price): Use together to identify high-probability setups where price is above both the 5-day MA and AVWAP
• Longer-term Moving Averages: Combine with 20-day and 50-day MAs for complete trend analysis
• Volume Analysis: Confirm 5-day MA signals with volume patterns
TRADING APPLICATIONS
For Swing Traders:
• Bullish Setup: Price above 5-day MA + above AVWAP + above longer-term MAs = Strong uptrend
• Bearish Setup: Price below 5-day MA + below AVWAP + below longer-term MAs = Strong downtrend
• Entry Timing: Use pullbacks to the 5-day MA as entry opportunities in the direction of the primary trend
For Day Traders:
• Quick visual confirmation of intraday momentum
• Dynamic support/resistance levels for scalping opportunities
• Clear trend bias for directional trades
WHY THIS INDICATOR WORKS
Brian Shannon's approach emphasizes that the 5-day moving average represents the short-term sentiment of market participants. When price is consistently above this level, it indicates buyers are in control of short-term price action. Conversely, when price falls below, it suggests selling pressure is dominating.
The visual fill makes it immediately obvious:
• How far price is from the 5-day MA
• The strength of the current short-term trend
• Potential areas where price might find support or resistance
BEST PRACTICES
1. Never use in isolation - Always combine with longer timeframe analysis
2. Volume confirmation - Look for volume expansion on moves away from the 5-day MA
3. Multiple timeframe approach - Check higher timeframes for overall trend direction
4. Combine with AVWAP - Most powerful when both indicators align
INSTALLATION NOTES
This indicator automatically adjusts for any timeframe, ensuring you always get a true 5-trading-day moving average regardless of whether you're viewing 1-minute or hourly charts.
Based on the technical analysis methodology of Brian Shannon, author of "Technical Analysis Using Multiple Timeframes"
Pineify® - Signals & Overlays™Indicator Theoretical Basis
The Pineify® Signals & Overlays™ indicator is built upon Dow Theory principles , which identify primary and secondary market trends through systematic price analysis. This comprehensive system combines multiple proven technical methodologies to create a unified trend-following and reversal-detection framework. The indicator synthesizes quantitative momentum analysis with qualitative trend assessment, providing traders with a complete market perspective across multiple timeframes.
This versatile indicator is suitable for various trading styles and timeframes, also has Beginner-Friendly presets to enable multiple features at once within one-click.
Key Features
Trend Confirmation
Trend Confirmation: This indicator presents two types of market trends: the primary trend and the secondary trend. The primary trend is the long - term direction of the market and can last for days or months; the secondary trend is the adjustment phase within the primary trend.
This indicator uses the EMA (Exponential Moving Average) and visualizes the trend phases through color filling. The judgment of the trend is that blue plus green indicates a bullish trend, and yellow plus red indicates a bearish trend.
The primary trend of this indicator is visualized by two sets of moving averages through color filling. These two sets of moving averages are used to describe the short - term and long - term trends in the market.
The short - period moving averages and the long - period moving averages each consist of 4 moving averages, with a total of 8 moving averages, representing the short - term fluctuations and trends of the market.
Trend Persistence: Once the primary trend is formed, it will persist for a period of time. This indicator judges based on the Dow Theory. Short - term market fluctuations do not necessarily reflect changes in the primary trend. Therefore, the judgment direction of the primary trend is visualized through color.
The Signals of Buying, Selling and Closing
In the primary trend, we can see signals of trend reversal. This indicator incorporates the "Consecutive Candles". The indicator mainly identifies the overbought or oversold state of the market through a series of consecutive conditions, so as to predict the reversal point. The core of this indicator is to identify a series of consecutive price movements in the market trend and determine whether the market is about to reverse based on this sequence. We visualize the turning points through buy and sell signals.
The trend confirmation system utilizes four pairs of Exponential Moving Averages (EMAs) creating dynamic cloud formations that visualize market direction. Short-period EMAs (5, 8, 20, 34) interact with longer-period EMAs (9, 13, 21, 50) to generate color-coded trend clouds . Blue and green clouds indicate bullish conditions, while yellow and red clouds signal bearish trends, providing immediate visual trend identification.
The presentation of buying and selling points, namely "Quantitative Qualitative Estimation", is a technical indicator that combines the concepts of the Relative Strength Index (RSI) and moving averages. It is used to evaluate market trends, overbought and oversold conditions, as well as potential trend reversal points. The oscillator has a relatively long smoothing period, making the indicator relatively stable, thus enabling the visualization of buy + and sell + signals for trading.
ATR Stop - Loss Line
ATR (Average True Range) is an indicator for measuring market volatility. By using the ATR value to set the stop - loss distance, the stop - loss level can be automatically adjusted according to market volatility, making the stop - loss more flexible.
Recommended parameters
RSI Length: 14 (QQE calculation base)
QQE Factor: 4.238 (Fibonacci-based multiplier)
ATR Period: 21 (volatility measurement)
EMA Lengths: Configurable short (5,8,20,34) and long (9,13,21,50) periods
Consecutive Candles: Selectable count (8)
Multi-timeframe Filter: Filter is enabled by default, resulting in more accurate signals.
Filters
The multi-timeframe filter enhances signal reliability by confirming trends across higher timeframes. This prevents counter-trend trades by ensuring alignment between current chart timeframe and broader market direction. The filter automatically calculates appropriate higher timeframes for trend confirmation.
Signals & Alerts
The indicator system exports multiple alert signals, and you can easily alert for any signal.
Up Trend : Primary long signal appears
Long - ▲ : Buy signal appears
Long - ▲+ : Confirmation buy signal appears
Long - ● : Primary reversal signal appears
Long - ☓ : Secondary reversal signal appears
Down Trend : Primary short signal appears
Short - ▼ : Sell signal appears
Short - ▼+ : Confirmation sell signal appears
Short - ● : Primary reversal signal appears
Short - ☓ : Secondary reversal signal appears
Conclusion
This indicator uniquely combines momentum analysis (QQE), trend identification (EMA clouds), reversal detection (Consecutive Candles), and risk management (ATR) into one comprehensive system. The multi-timeframe filtering adds institutional-grade sophistication, making it suitable for both retail and professional traders seeking reliable trend-following signals with precise entry and exit timing.
Risk Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (Pineify) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
MEDIAS MOVILES ASL//@version=5
indicator("MEDIAS MOVILES ASL",overlay=true, max_bars_back=3000)
// ======== Indicator Input Parameters =========
linew = 2 // line width for moving averages.
var string G_DAILY = "►► Daily Moving Average"
bool ma_c_enable = input(inline = "01", group = G_DAILY, defval=true, title="MM1")
string ma_c = input.string(inline = "01", group = G_DAILY, defval="ASL", title="", options= )
int len_c = input.int(inline = "01", group = G_DAILY, defval=21, minval=1, title="Length:")
color col_c = input(inline = "01", group = G_DAILY, defval=color.blue,title="")
bool ma_i_enable = input(inline = "02", group = G_DAILY, defval=true, title="MM2")
string ma_i = input.string(inline = "02", group = G_DAILY, defval="EMA", title="", options= )
int len_i = input.int(inline = "02", group = G_DAILY, defval=150, minval=1, title="Length:")
color col_i = input(inline = "02", group = G_DAILY, defval=color.red, title="")
bool ma_l_enable = input(inline = "03", group = G_DAILY, defval=true, title="MM3")
string ma_l = input.string(inline = "03", group = G_DAILY, defval="EMA", title="", options= )
int len_l = input.int(inline = "03", group = G_DAILY, defval=200, minval=1, title="Length:")
color col_l = input(inline = "03", group = G_DAILY, defval=color.orange,title="")
bool ma_a_enable = input(inline = "04", group = G_DAILY, defval=true, title="MM4")
string ma_a = input.string(inline = "04", group = G_DAILY, defval="SMA", title="", options= )
int len_a = input.int(inline = "04", group = G_DAILY, defval=30, minval=1, title="Length:")
color col_a = input(inline = "04", group = G_DAILY, defval=color.green,title="")
var string G_WEEKLY = "►► Weekly Moving Average"
bool w_ma_c_enable = input(inline = "01", group = G_WEEKLY, defval=true, title="MM1")
string w_ma_c = input.string(inline = "01", group = G_WEEKLY, defval="WMA", title="", options= )
int w_len_c = input.int(inline = "01", group = G_WEEKLY, defval=10, minval=1, title="Length:")
color w_col_c = input(inline = "01", group = G_WEEKLY, defval=color.blue,title="")
bool w_ma_i_enable = input(inline = "02", group = G_WEEKLY, defval=true, title="MM2")
string w_ma_i = input.string(inline = "02", group = G_WEEKLY, defval="WMA", title="", options= )
int w_len_i = input.int(inline = "02", group = G_WEEKLY, defval=30, minval=1, title="Length:")
color w_col_i = input(inline = "02", group = G_WEEKLY, defval=color.orange, title="")
bool w_ma_l_enable = input(inline = "03", group = G_WEEKLY, defval=true, title="MM3")
string w_ma_l = input.string(inline = "03", group = G_WEEKLY, defval="SMA", title="", options= )
int w_len_l = input.int(inline = "03", group = G_WEEKLY, defval=200, minval=1, title="Length:")
color w_col_l = input(inline = "03", group = G_WEEKLY, defval=color.green,title="")
bool w_ma_a_enable = input(inline = "04", group = G_WEEKLY, defval=true, title="MM4")
string w_ma_a = input.string(inline = "04", group = G_WEEKLY, defval="WMA", title="", options= )
int w_len_a = input.int(inline = "04", group = G_WEEKLY, defval=50, minval=1, title="Length:")
color w_col_a = input(inline = "04", group = G_WEEKLY, defval=color.red,title="")
var string G_MONTHLY = "►► Monthly Moving Average"
bool m_ma_c_enable = input(inline = "01", group = G_MONTHLY, defval=true, title="MM1")
string m_ma_c = input.string(inline = "01", group = G_MONTHLY, defval="WMA", title="", options= )
int m_len_c = input.int(inline = "01", group = G_MONTHLY, defval=12, minval=1, title="Length:")
color m_col_c = input(inline = "01", group = G_MONTHLY, defval=color.orange,title="")
bool m_ma_l_enable = input(inline = "02", group = G_MONTHLY, defval=false, title="MM2")
string m_ma_l = input.string(inline = "02", group = G_MONTHLY, defval="SMA", title="", options= )
int m_len_l = input.int(inline = "02", group = G_MONTHLY, defval=12, minval=1, title="Length:")
color m_col_l = input(inline = "02", group = G_MONTHLY, defval=color.olive,title="")
var color TBL_TXT = color.white
var color TBL_BG = #000000
var string TXT_SIZE = 'auto'
var string G_TABLE = '►► Moving Average and 2Sigma Table (Position & Size)'
bool i_table_enable = input.bool(true, inline='01', group=G_TABLE, title = "Enable? | ")
string i_tableYpos = input.string('bottom', '↕', inline='01', group=G_TABLE, options= )
string i_tableXpos = input.string('right', '↔', inline='01', group=G_TABLE, options= , tooltip='Position on the chart.')
color i_c_tableText = input.color(TBL_TXT, 'Text', inline='03', group=G_TABLE)
color i_c_tableBg = input.color(TBL_BG, 'Background', inline='03', group=G_TABLE)
string i_tableTextSize = input.string(TXT_SIZE, '', inline='03', group=G_TABLE, options= )
var string G_TABLEADD = '►► Table Additional Information'
bool unify_emas = input.bool(true, inline='01', group=G_TABLEADD, title = "Smart Unify Daily EMAS 150 & 200?", tooltip='Consolidate the two percentages in one to show the distance from close price to the long EMAS.')
cell_1 ='2σ Dispersion'
cell_2 = 'β-5Y'
cell_3 = 'Div Yield FQ'
var string G_SIGMAF = '►► 2Sigma and Bollinger Band Format'
string sigma_bb_format = input.string('0-100 inside band',inline='01', group=G_SIGMAF, title = "2σ and BB Format:", options= )
var string G_TABLEPARAM = '►► Beta & ATR Indicator Parameters'
string beta_baseline = input.string('SPY', inline='01', group=G_TABLEPARAM, title = "β Index or Benchmark:")
int beta_years = input.int(5, inline='01', group=G_TABLEPARAM, title = "Window Years:")
var color TBL_TXT2 = color.white
var color TBL_BG2 = #363A45
var string TXT_SIZE2 = 'auto'
var string COMMENT = 'EMAs = EMA(200)+EMA(150) / 2 (not adjusted by dividens) '
// ======== Functions Library =========
// ————— Function returning the leftmost `_n` characters in `_str`.
moving_avg(type, len) =>
value = type == "ASL" ? (ta.ema(close,len-1)+ta.wma(close,len))/2 : type =="EMA" ? ta.ema(close,len) : type=="WMA" ? ta.wma(close,len) : type=="HMA" ? ta.hma(close,len) : type=="L_EMAS_AVG" ? (ta.ema(close,len)+ta.ema(close,len+50))/2: ta.sma(close ,len)
txt = type + str.tostring(len,"#")
//sigma functions
// v=variation vs price
v(float x) => (close-x)/close
sigma2(x) => ta.stdev(x,bar_index > 3000 ? 3000 : (timeframe.isweekly or timeframe.ismonthly) ? 1000/5 : 1000) * 2
bg_mm(v,s) => (v > 0) ? (math.abs(v) > s) ? color.lime : color.green : (math.abs(v) > s) ? #ff0000 : #ad2323
bg_rsi(r) => r>70 ? color.red : r<30 ? color.green : r<35 ? #67Eb65 : r>65 ? #F2A09D : (r > 48 and r <52) ? color.olive : color.gray
bg_sigma2(x) => x < 0 ? #fffbbf : color.gray
fg_sigma2(x) => x < 0 ? #ff0000 : i_c_tableText
// Beta Background Color codes:
bg_beta(b) => b<0 ? color.blue : b<= 1 ? color.green : b>= 3 ? #ff0000 : b>= 1.7 ? #ad2323 : color.olive
// beta < 0 --> blue
// beta = 0 is chash no risk.
// 0 < beta <= 1 --> green
// 1 < beta <= 1.7 --> olive
// 1.7 < beta <= 3 --> dark red
// beta > 3 --> light red
// Div Yield Backgroudn
bg_div(x) => x == 0 ? color.gray : x < 3 ? color.blue : x < 5 ? color.olive : x < 10 ? color.green : color.lime
// identify ticker with operations
spread_symbol(x) =>
str.contains(x,"+") or str.contains(x,"-") or str.contains(x,"/") or str.contains(x,"*") or str.contains(x,"(")
// Table cells output.
print_cell(tbl, col, title_txt, color_txt_tit, color_bg_tit, value_txt, color_txt_val, color_bg_val,txt_size) =>
if barstate.islast
table.cell(tbl,col,0, title_txt, bgcolor = color_bg_tit , text_color = color_txt_tit,text_size = txt_size)
table.cell(tbl,col,1, value_txt, bgcolor = color_bg_val , text_color = color_txt_val,text_size = txt_size)
// formula simplified included in cells --> this function is used to setup if conditions to save execution time.
included(x,a,b,c) => x == a or x == b or x == c
// change funtion for beta
return_percent(src) => ta.change(src) * 100 / src
// bollinger band %B
bg_percentage_BB(x) => x < 0 or x > 100 ? #fffbbf : x <10 ? #30CC5A : x > 90 ? #F63538 : color.gray
fg_percentage_BB(x) => x < 0 ? color.green : x >100 ? #ff0000 : i_c_tableText
ETFs_tickers=' SPY QQQ DIA EWZ XLF XLE XLB XLV XLH XLK XLC XLY XLP XLI XLRE XLU MCHI VGLT VIG VYM VNQ SCHD IWM '
IsETF(x) => str.contains(ETFs_tickers, " " +x+" ")
// ====== End Functions Library =======
// ++++++++++++++++++ moving average calcs
= moving_avg(ma_c,len_c)
plot(timeframe.isdaily and ma_c_enable ? valmm1 : na, color=col_c, linewidth=linew)
= moving_avg(ma_i,len_i)
plot(timeframe.isdaily and ma_i_enable ? valmm2 : na, color=col_i, linewidth=linew)
= moving_avg(ma_l,len_l)
plot(timeframe.isdaily and ma_l_enable ? valmm3 : na, color=col_l,linewidth=linew)
= moving_avg(ma_a,len_a)
plot(timeframe.isdaily and ma_a_enable ? valmm4 : na, color=col_a,linewidth=linew)
if barstate.islast and timeframe.isdaily
ma_c_label = label.new(x=time, y=valmm1,
text=ma_c_enable ? txt1:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=col_c , size=size.small)
ma_i_label = label.new(x=time, y=valmm2,
text=ma_i_enable ? txt2:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=col_i, size=size.small)
ma_l_label = label.new(x=time, y=valmm3,
text=ma_l_enable ? txt3:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=col_l, size=size.small)
ma_a_label = label.new(x=time, y=valmm4,
text=ma_a_enable ? txt4:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=col_a, size=size.small)
xUpMM1 = ta.crossover(close, valmm1)
xDnMM1 = ta.crossunder(close, valmm1)
xUpEMA = ta.crossover(close, (valmm2+valmm3)/2)
xDnEMA = ta.crossunder(close, (valmm2+valmm3)/2)
if timeframe.isdaily and xUpMM1
alert(syminfo.ticker +" crossing UP ASL21 (short MA)")
if timeframe.isdaily and xDnMM1
alert(syminfo.ticker +" crossing DOWN ASL21 (short MA)")
if timeframe.isdaily and xUpEMA
alert(syminfo.ticker +" crossing UP EMAs (avg EMA150,EMA200)")
if timeframe.isdaily and xDnEMA
alert(syminfo.ticker +" crossing DOWN EMAs (avg EMA150,EMA200)")
alertcondition(xUpMM1 or xDnMM1, title="Daily Price x MA1 (ASL21)", message="Crossing ALS21")
alertcondition(xUpEMA or xDnEMA, title="Daily Price x Avg(MM2,MM3) (avg EMA150 & EMA200)",message="Crossing Big EMAs")
= moving_avg(w_ma_c,w_len_c)
plot(timeframe.isweekly and w_ma_c_enable ? w_valmm1 : na, color=w_col_c, linewidth=linew)
= moving_avg(w_ma_i,w_len_i)
plot(timeframe.isweekly and w_ma_i_enable ? w_valmm2 : na, color=w_col_i, linewidth=linew)
= moving_avg(w_ma_l,w_len_l)
plot(timeframe.isweekly and w_ma_l_enable ? w_valmm3 : na, color=w_col_l,linewidth=linew)
= moving_avg(w_ma_a,w_len_a)
plot(timeframe.isweekly and w_ma_a_enable ? w_valmm4 : na, color=w_col_a,linewidth=linew)
if barstate.islast and timeframe.isweekly
w_ma_c_label = label.new(x=time, y=w_valmm1,
text=w_ma_c_enable ? w_txt1:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=w_col_c, size=size.small)
w_ma_i_label = label.new(x=time, y=w_valmm2,
text=w_ma_i_enable ? w_txt2:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=w_col_i, size=size.small)
w_ma_l_label = label.new(x=time, y=w_valmm3,
text=w_ma_l_enable ? w_txt3:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=w_col_l, size=size.small)
w_ma_a_label = label.new(x=time, y=w_valmm4,
text=w_ma_a_enable ? w_txt4:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=w_col_a, size=size.small)
= moving_avg(m_ma_c,m_len_c)
plot(timeframe.ismonthly and m_ma_c_enable ? m_valmm1 : na, color= m_col_c, linewidth=linew)
= moving_avg(m_ma_l,m_len_l)
plot(timeframe.ismonthly and m_ma_l_enable ? m_valmm2 : na, color=m_col_l,linewidth=linew)
// ***** TABLE SETUP AND PRINT
unify_emas := unify_emas and timeframe.isdaily and ma_i_enable and ma_l_enable and len_i == 150 and len_l == 200 and ma_i == "EMA" and ma_l == "EMA" and
math.abs(v(valmm2)-v(valmm3)) /( math.abs(v(valmm2)+v(valmm3))/2) < 0.2 and
bg_mm(v(valmm2),sigma2(v(valmm2))) == bg_mm(v(valmm3),sigma2(v(valmm3)))
total_col = 1 // 1 is RSI
total_col += timeframe.isdaily ? ((ma_c_enable ? 1 : 0) + (ma_i_enable ? 1 : 0) + (ma_l_enable ? 1 : 0) + (ma_a_enable ? 1 : 0 )) : 0
total_col += unify_emas ? -1 : 0
total_col += timeframe.isweekly ? ((w_ma_c_enable ? 1 : 0) + (w_ma_i_enable ? 1 : 0) + (w_ma_l_enable ? 1 : 0) + (w_ma_a_enable ? 1 : 0)) : 0
total_col += timeframe.ismonthly ? ((m_ma_c_enable ? 1 : 0) + (m_ma_l_enable ? 1 : 0)) : 0
// not inluding for intraday ((i_ma_c_enable ? 1 : 0) + (i_ma_i_enable ? 1 : 0)
// additional info
total_col += cell_1 == 'None' ? 0 : 1
total_col += cell_2 == 'None' ? 0 : 1
total_col += cell_3 == 'None' ? 0 : 1
border = i_tableTextSize == "tiny" ? 0 : i_tableTextSize == "small" ? 1 : i_tableTextSize == "normal" ? 2 : 3
frame = i_tableTextSize == "tiny" ? 1 : i_tableTextSize == "small" ? 2 : i_tableTextSize == "normal" ? 3 : 4
var table display = table.new(i_tableYpos + '_' + i_tableXpos, total_col, 2 ,border_width=border, frame_width = frame, frame_color = i_c_tableBg, border_color = i_c_tableBg)
// calcs
// ++++++++++++++++++++++++++ Beta
float beta = na
smooth = 1
length = timeframe.ismonthly ? 12 * beta_years + 1 : timeframe.isweekly ? 52 * beta_years + 1 : timeframe.isdaily ? 252 * beta_years + 1 : 300
instrument = not spread_symbol(syminfo.ticker) ? request.security(syminfo.tickerid, 'M', ta.ema(close, smooth)) : na
benchmark = not spread_symbol(syminfo.ticker) ? request.security(beta_baseline, 'M', ta.ema(close, smooth)) : na
inst_return = return_percent(instrument)
bench_return = return_percent(benchmark)
avg_inst_return = ta.sma(inst_return, length)
avg_bench_return = ta.sma(bench_return, length)
sum = 0.0
for idx = length to 0 by 1
inst_variance = inst_return - avg_inst_return
bench_variance = bench_return - avg_bench_return
sum += inst_variance * bench_variance
sum
covariance = sum / (length - 1)
beta := covariance / ta.variance(bench_return, length)
// Print Table with Moving Average variation vs price percentages
i=0
if timeframe.isdaily and i_table_enable
bg_mm2 = nz(bg_mm(v(valmm2),sigma2(v(valmm2))),color.gray)
bg_mm3 = nz(bg_mm(v(valmm2),sigma2(v(valmm2))),color.gray)
if ma_c_enable
print_cell(display, i, txt1, i_c_tableText, i_c_tableBg, str.tostring(v(valmm1),'#.#%'), i_c_tableText,bg_mm(v(valmm1),sigma2(v(valmm1))),i_tableTextSize)
i+=1
if ma_i_enable and not unify_emas
print_cell(display, i, txt2, i_c_tableText, i_c_tableBg, str.tostring(v(valmm2),'#.#%'), i_c_tableText,bg_mm2,i_tableTextSize)
i+=1
if ma_l_enable and not unify_emas
print_cell(display, i, txt3, i_c_tableText, i_c_tableBg, str.tostring(v(valmm3),'#.#%'), i_c_tableText,bg_mm3,i_tableTextSize)
i+=1
if unify_emas
unified_var = (valmm2 > close) ? math.max(v(valmm2), v(valmm3)) : math.min(v(valmm2),v(valmm3))
print_cell(display, i, "EMAs", i_c_tableText, i_c_tableBg, str.tostring(unified_var,'#.#%'), i_c_tableText,bg_mm2,i_tableTextSize)
i+=1
if ma_a_enable
print_cell(display, i, txt4, i_c_tableText, i_c_tableBg, str.tostring(v(valmm4),'#.#%'), i_c_tableText,bg_mm(v(valmm4),sigma2(v(valmm4))),i_tableTextSize)
i+=1
print_cell(display, i, "RSI", i_c_tableText, i_c_tableBg, str.tostring(ta.rsi(close,14),'##'), i_c_tableText,bg_rsi(ta.rsi(close,14)),i_tableTextSize)
i+=1
d = math.abs(sigma2(v(valmm1))) - math.abs(v(valmm1))
if timeframe.isweekly and i_table_enable
if w_ma_c_enable
print_cell(display, i, w_txt1, i_c_tableText, i_c_tableBg, str.tostring(v(w_valmm1),'#.#%'), i_c_tableText,bg_mm(v(w_valmm1),sigma2(v(w_valmm1))),i_tableTextSize)
i+=1
if w_ma_i_enable
print_cell(display, i, w_txt2, i_c_tableText, i_c_tableBg, str.tostring(v(w_valmm2),'#.#%'), i_c_tableText,bg_mm(v(w_valmm2),sigma2(v(w_valmm2))),i_tableTextSize)
i+=1
if w_ma_l_enable
print_cell(display, i, w_txt3, i_c_tableText, i_c_tableBg, str.tostring(v(w_valmm3),'#.#%'), i_c_tableText,bg_mm(v(w_valmm3),sigma2(v(w_valmm3))),i_tableTextSize)
i+=1
if w_ma_a_enable
print_cell(display, i, w_txt4, i_c_tableText, i_c_tableBg, str.tostring(v(w_valmm4),'#.#%'), i_c_tableText,bg_mm(v(w_valmm4),sigma2(v(w_valmm4))),i_tableTextSize)
i+=1
print_cell(display, i, "RSI", i_c_tableText, i_c_tableBg, str.tostring(ta.rsi(close,14),'##'), i_c_tableText,bg_rsi(ta.rsi(close,14)),i_tableTextSize)
i+=1
d = math.abs(sigma2(v(w_valmm1))) - math.abs(v(w_valmm1))
if timeframe.ismonthly and i_table_enable
if m_ma_c_enable
print_cell(display, i, m_txt1, i_c_tableText, i_c_tableBg, str.tostring(v(m_valmm1),'#.#%'), i_c_tableText,bg_mm(v(m_valmm1),sigma2(v(m_valmm1))),i_tableTextSize)
i+=1
if m_ma_l_enable
print_cell(display, i, m_txt2, i_c_tableText, i_c_tableBg, str.tostring(v(m_valmm2),'#.#%'), i_c_tableText,bg_mm(v(m_valmm2),sigma2(v(m_valmm2))),i_tableTextSize)
i+=1
print_cell(display, i, "RSI", i_c_tableText, i_c_tableBg, str.tostring(ta.rsi(close,14),'##'), i_c_tableText,bg_rsi(ta.rsi(close,14)),i_tableTextSize)
i+=1
d = math.abs(sigma2(v(m_valmm1))) - math.abs(v(m_valmm1))
print_cell(display, i, "2σ", i_c_tableText, i_c_tableBg, str.tostring(d ,'####.#%'), fg_sigma2(d),bg_sigma2(d),i_tableTextSize)
// ++++++++++++++++++++++++++ Yield
temp_ticker = spread_symbol(syminfo.tickerid) ? "NASDAQ:TSLA" : syminfo.tickerid // Tesla is a dummy stock to have 0 div to execute the formula.
_divYield = barstate.islast ? request.financial(temp_ticker, "DIVIDENDS_YIELD", "FQ", ignore_invalid_symbol = true) : 0.0
s1 = IsETF(syminfo.ticker) ? request.dividends(temp_ticker) : na // no se puede poner barstate.islast al preguntar por anteriores s1 +s1 +s1 +s1
dividendPeriodicity = 4 // checkear como validar la periodicidad diferente de 4 para ETFs
_divYield := IsETF(syminfo.ticker) ? (s1 +s1 +s1 +s1 ) / close * 100 : _divYield
// ++++++++++++++++++++++++++ 2sigma percentage and 0-100 like %B
float bb_2sigma = na
d = 0.0
if sigma_bb_format == '0-100 inside band'
mid2sigma =
timeframe.isdaily ? valmm1 :
timeframe.isweekly ? w_valmm1 :
timeframe.ismonthly ? m_valmm1 : na
bandwidth2sigma =
timeframe.isdaily ? sigma2(v(valmm1)) :
timeframe.isweekly ? sigma2(v(w_valmm1)) :
timeframe.ismonthly ? sigma2(v(m_valmm1)) : na
upbb2 = mid2sigma + bandwidth2sigma * close
dnbb2 = mid2sigma - bandwidth2sigma * close
bb_2sigma := (close - dnbb2) / (upbb2 - dnbb2) * 100
if sigma_bb_format == '% to up/dn band'
d := timeframe.isdaily ? math.abs(sigma2(v(valmm1))) - math.abs(v(valmm1)) :
timeframe.isweekly ? math.abs(sigma2(v(w_valmm1))) - math.abs(v(w_valmm1)) :
timeframe.ismonthly ? math.abs(sigma2(v(m_valmm1))) - math.abs(v(m_valmm1)) : na
// // ++++++++++++++++++++++++++ PRINT SELECTIONS
if i_table_enable and barstate.islast
// cell 1 - 2 sigma dispesion
if sigma_bb_format == '0-100 inside band'
if timeframe.isdaily or timeframe.isweekly or timeframe.ismonthly
print_cell(display, i, "2σ", i_c_tableText, i_c_tableBg, str.tostring(bb_2sigma,'#'), fg_percentage_BB(bb_2sigma),bg_percentage_BB(bb_2sigma),i_tableTextSize)
i+=1
else
if timeframe.isdaily or timeframe.isweekly or timeframe.ismonthly
print_cell(display, i, "2σ", i_c_tableText, i_c_tableBg, str.tostring(d ,'####.#%'), fg_sigma2(d),bg_sigma2(d),i_tableTextSize)
i+=1
// cell 2 - beta
beta_txt = "β-5Y"
print_cell(display, i, beta_txt , i_c_tableText, i_c_tableBg, str.tostring(beta,'#.#'), i_c_tableText,bg_beta(beta),i_tableTextSize)
i+=1
// cell 3 - div
yield_txt = "Div Yield"
print_cell(display,i, yield_txt, i_c_tableText, i_c_tableBg, str.tostring(_divYield/100,'#.#%'), i_c_tableText,bg_div(nz(_divYield,0.0)),i_tableTextSize)
i+=1
AutoFib Breakout Strategy for Uptrend AssetsThis trading strategy is designed to help you catch powerful upward moves on assets that are in a long-term uptrend, such as Gold (XAUUSD). It uses a popular technical tool called the Fibonacci Extension, combined with a trend filter and a risk-managed exit system.
✅ When to Use This Strategy
• Works best on higher timeframes: Daily (1D), 3-Day (3D), or Weekly (W).
• Best used on uptrending assets like Gold.
• Designed for swing trading – holding trades from a few days to weeks.
📊 How It Works
1. Find the Trend
We only want to trade in the direction of the trend.
• The strategy uses the 200-period EMA (Exponential Moving Average) to identify if the market is in an uptrend.
• If the price is above the 200 EMA, we consider it an uptrend and allow long trades.
2. Identify Breakout Levels
• The strategy detects recent high and low pivot points to draw Fibonacci extension levels.
• It focuses on the 1.618 Fibonacci level, which is often a target in strong trends.
• When the price breaks above this level in an uptrend, it signals a potential momentum breakout – a good time to buy.
3. Enter a Trade
• The strategy enters a long (buy) position when the price closes above the 1.618 Fibonacci level and the market is in an uptrend (above the 200 EMA).
4. Manage Risk Automatically
• The trade includes a stop-loss set to 1x the ATR (Average True Range) below the entry price – this protects against sudden drops.
• It sets a take-profit at 3x the ATR above the entry – aiming for higher rewards than risks.
⚠️ Important Notes
• 📈 Higher Timeframes Preferred: This strategy works best on Daily (D), 3-Day (3D), and Weekly (W) charts, especially on Gold (XAUUSD).
• 🧪 Not for Deep Backtesting: Due to the nature of how pivot points and Fib levels are calculated, this strategy may not perform well in backtesting simulations (because the historical calculations can shift). It is better used for live analysis and forward testing.
Slow EMA# Slow EMA Indicator
## What Is This Indicator?
The **Slow EMA** is an **Exponential Moving Average** that reacts slowly to price changes. Think of it as a smooth line that shows the **big picture trend** without getting confused by daily price jumps.
## Why "Slow"?
- **Regular EMA** (like 10 or 20 periods) = Reacts quickly, more signals, more noise
- **Slow EMA** (50+ periods) = Reacts slowly, fewer signals, clearer trends
It's like comparing a nervous person who reacts to everything vs. a calm person who only reacts to important things.
## What You See on Your Chart
### The Main Line (Blue/Colored):
- **Blue Line**: Normal trend
- **Green Line**: Strong uptrend (getting stronger)
- **Red Line**: Strong downtrend (getting weaker)
### Signal Arrows:
- **Green Triangle ▲**: Price crossed above EMA = Bullish signal
- **Red Triangle ▼**: Price crossed below EMA = Bearish signal
### Background Colors (Optional):
- **Light Green**: Price is above EMA (bullish zone)
- **Light Red**: Price is below EMA (bearish zone)
### Filled Area:
- **Green Fill**: Space between price and EMA when price is higher
- **Red Fill**: Space between price and EMA when price is lower
## How to Read the Signals
### Simple Trend Rules:
1. **Price ABOVE the line** = **Uptrend** (consider buying)
2. **Price BELOW the line** = **Downtrend** (consider selling)
3. **Line going UP** = **Bull market**
4. **Line going DOWN** = **Bear market**
### Entry/Exit Signals:
- **Green triangle** = Potential **BUY** signal
- **Red triangle** = Potential **SELL** signal
- **Wait for confirmation** - don't rush on every signal
## Settings You Can Change
### EMA Length (Default: 50):
- **Lower numbers** (20-30) = Faster, more signals
- **Higher numbers** (100-200) = Slower, fewer signals
- **50 is the sweet spot** for most traders
### Other Options:
- **Source**: What price to use (usually keep as "close")
- **Show Signals**: Turn triangles on/off
- **Background Color**: Turn trend coloring on/off
## When to Use This Indicator
### Perfect For:
- **Swing Trading** (holding for days/weeks)
- **Long-term investing**
- **Filtering out market noise**
- **Confirming other indicators**
### Not Great For:
- **Day trading** (too slow)
- **Scalping** (too few signals)
- **Choppy/sideways markets**
## Pro Tips for Using Slow EMA
### 1. **Trend Following**:
- Only buy when price is above the line
- Only sell when price is below the line
- Stay out when price keeps crossing back and forth
### 2. **Support & Resistance**:
- In uptrends, the EMA often acts as **support**
- In downtrends, the EMA often acts as **resistance**
- Watch for price to bounce off the line
### 3. **Combine with Other Tools**:
- Use with volume indicators
- Add RSI for momentum confirmation
- Check higher timeframes for bigger picture
## Common Mistakes to Avoid
❌ **Don't chase every signal** - wait for clear trends
❌ **Don't use alone** - combine with other analysis
❌ **Don't expect perfection** - no indicator is 100% accurate
❌ **Don't ignore the trend** - fighting the EMA usually loses
## The Bottom Line
The Slow EMA is like having a **wise advisor** who ignores daily market panic and focuses on what really matters - the **big trend**. It won't catch every move, but it will help you stay on the right side of major trends while avoiding most of the noise.
**Remember**: Slow and steady wins the race! 🐢
Fibonacci Moving Average (Non-Repainting)# Fibonacci Moving Average Indicator
## What Does This Indicator Do?
This indicator creates a **special moving average** that combines traditional moving averages with Fibonacci ratios to help identify support and resistance levels.
## How It Works (In Simple Terms)
### 1. **Gets Yesterday's Close Price**
- Takes the closing price from the previous day
- This ensures the indicator **never repaints** (won't change its past values)
### 2. **Calculates a Base Moving Average**
- Uses yesterday's close to create a moving average (you can choose SMA, EMA, or WMA)
- This becomes the "center line" of our Fibonacci levels
### 3. **Creates Fibonacci Levels**
- Measures the distance between current price and the base moving average
- Uses famous Fibonacci percentages (23.6%, 38.2%, 50%, 61.8%, 78.6%) to create levels above and below the base line
- These levels often act as **support and resistance**
### 4. **Main Fibonacci MA**
- Combines the most important levels (61.8% upper, base, 61.8% lower) into one main line
- This blue line is your primary signal
## What You See on Your Chart
### Visual Elements:
- **Blue Line**: Main Fibonacci Moving Average (your key signal)
- **Colored Lines**: Individual Fibonacci levels (if enabled)
- **Background Color**:
- Light green = uptrend
- Light red = downtrend
- **Info Table**: Shows current values in top-right corner
## How to Use It
### Trading Signals:
1. **Price above blue line** = Bullish bias
2. **Price below blue line** = Bearish bias
3. **Blue line trending up** = Overall uptrend
4. **Blue line trending down** = Overall downtrend
### Support & Resistance:
- Fibonacci level lines often act as support when price is rising
- Same lines act as resistance when price is falling
- Watch for price reactions at these levels
## Key Settings You Can Adjust
- **Fibonacci Length**: How many periods to use (default: 21)
- **MA Type**: Choose SMA, EMA, or WMA for the base calculation
- **Show Levels**: Turn Fibonacci level lines on/off
## Why This Is Better Than Regular Moving Averages
1. **No Repainting**: Uses fixed historical data, so signals won't disappear
2. **Multiple Levels**: Gives you several potential support/resistance zones
3. **Fibonacci Magic**: Uses ratios that markets naturally respect
4. **Trend Confirmation**: Background color helps confirm overall direction
## Perfect For:
- Swing trading
- Identifying key levels
- Trend following
- Entry and exit timing
Kapsamlı Al-Sat Sinyal İndikatörü11 oscillators and 15 moving average tracking generates Buy-Sell signals based on 6 or more Oscillator movements, and also generates Buy-Sell signals based on 8 or more Moving Average movements. In summary, you can see the Buy-Sell conditions in the table.
EVERUP.EDU.VN - EMA - LịneEverup.edu.vn is a specialized platform for in-depth Crypto technical analysis, combining a minimalist and intuitive interface with a team of highly experienced analysts. Every feature and report is designed to help you access accurate, timely, and easy-to-understand market information, empowering you to make confident and effective trading decisions.
EverUp Crypto is not just a tool—it’s your trusted companion on the journey to conquer the Crypto market. Sign up today to experience advanced analysis, receive timely advice, and grow together with the EverUp community!
McGinley Dynamic debugged🔍 McGinley Dynamic Debugged (Adaptive Moving Average)
This indicator plots the McGinley Dynamic, a mathematically adaptive moving average designed to reduce lag and better track price action during both trends and consolidations.
✅ Key Features:
Adaptive smoothing: The McGinley Dynamic adjusts itself based on the speed of price changes.
Lag reduction: Compared to traditional moving averages like EMA or SMA, McGinley provides smoother yet responsive tracking.
Stability fix: This version includes a robust fix for rare recursive calculation issues, particularly on low-priced historical assets (e.g., Wipro pre-2000).
⚙️ What’s Different in This Debugged Version?
Implements manual clamping on the source / previous value ratio to prevent mathematical spikes that could cause flattening or distortion in the plotted line.
Ensures more stable behavior across all instruments and timeframes, especially those with historically low price points or volatile early data.
💡 Use Case:
Ideal for:
Trend confirmation
Entry filtering
Adaptive support/resistance visualization
Improving signal precision in low-volatility or high-noise environments
⚠️ Notes:
Works best when combined with volume filters or other trend indicators for validation.
This version is optimized for visual use—for signal generation, consider pairing it with additional logic or thresholds.
GEEKSDOBYTE IFVG w/ Buy/Sell SignalsCME_MINI:ES1!
discord.gg
geeksdobyte.com
1. Inputs & Configuration
Swing Lookback (swingLen)
Controls how many bars on each side are checked to mark a swing high or swing low (default = 5).
Booleans to Toggle Plotting
showSwings – Show small triangle markers at swing highs/lows
showFVG – Show Fair Value Gap zones
showSignals – Show “BUY”/“SELL” labels when price inverts an FVG
showDDLine – Show a yellow “DD” line at the close of the inversion bar
showCE – Show an orange dashed “CE” line at the midpoint of the gap area
2. Swing High / Low Detection
isSwingHigh = ta.pivothigh(high, swingLen, swingLen)
Marks a bar as a swing high if its high is higher than the highs of the previous swingLen bars and the next swingLen bars.
isSwingLow = ta.pivotlow(low, swingLen, swingLen)
Marks a bar as a swing low if its low is lower than the lows of the previous and next swingLen bars.
Plotting
If showSwings is true, small red downward triangles appear above swing highs, and green upward triangles below swing lows.
3. Fair Value Gap (3‐Bar) Identification
A Fair Value Gap (FVG) is defined here using a simple three‐bar logic (sometimes called an “inefficiency” in price):
Bullish FVG (bullFVG)
Checks if, two bars ago, the low of that bar (low ) is strictly greater than the current bar’s high (high).
In other words:
bullFVG = low > high
Bearish FVG (bearFVG)
Checks if, two bars ago, the high of that bar (high ) is strictly less than the current bar’s low (low).
In other words:
bearFVG = high < low
When either condition is true, it identifies a three‐bar “gap” or unfilled imbalance in the market.
4. Drawing FVG Zones
If showFVG is enabled, each time a bullish or bearish FVG is detected:
Bullish FVG Zone
Draws a semi‐transparent green box from the bar two bars ago (where the gap began) at low up to the current bar’s high.
Bearish FVG Zone
Draws a semi‐transparent red box from the bar two bars ago at high down to the current bar’s low.
These colored boxes visually highlight the “fair value imbalance” area on the chart.
5. Inversion (Fill) Detection & Entry Signals
An inversion is defined as the price “closing through” that previously drawn FVG:
Bullish Inversion (bullInversion)
Occurs when a bullish FVG was identified on bar-2 (bullFVG), and on the current bar the close is greater than that old bar-2 low:
bullInversion = bullFVG and close > low
Bearish Inversion (bearInversion)
Occurs when a bearish FVG was identified on bar-2 (bearFVG), and on the current bar the close is lower than that old bar-2 high:
bearInversion = bearFVG and close < high
When an inversion is true, the indicator optionally draws two lines and a label (depending on input toggles):
Draw “DD” Line (yellow, solid)
Plots a horizontal yellow line from the current bar’s close price extending five bars forward (bar_index + 5). This is often referred to as a “Demand/Daily Demand” line, marking where price inverted the gap.
Draw “CE” Line (orange, dashed)
Calculates the midpoint (ce) of the original FVG zone.
For a bullish inversion:
ce = (low + high) / 2
For a bearish inversion:
ce = (high + low) / 2
Plots a horizontal dashed orange line at that midpoint for five bars forward.
Plot Label (“BUY” / “SELL”)
If showSignals is true, a green “BUY” label is placed at the low of the current bar when a bullish inversion occurs.
Likewise, a red “SELL” label at the high of the current bar when a bearish inversion happens.
6. Putting It All Together
Swing Markers (Optional):
Visually confirm recent swing highs and swing lows with small triangles.
FVG Zones (Optional):
Highlight areas where price left a 3-bar gap (bullish in green, bearish in red).
Inversion Confirmation:
Wait for price to close beyond the old FVG boundary.
Once that happens, draw the yellow “DD” line at the close, the orange dashed “CE” line at the zone’s midpoint, and place a “BUY” or “SELL” label exactly on that bar.
User Controls:
All of the above elements can be individually toggled on/off (showSwings, showFVG, showSignals, showDDLine, showCE).
In Practice
A bullish FVG forms whenever a strong drop leaves a gap in liquidity (three bars ago low > current high).
When price later “fills” that gap by closing above the old low, the script signals a potential long entry (BUY), draws a demand line at the closing price, and marks the midpoint of that gap.
Conversely, a bearish FVG marks a potential short zone (three bars ago high < current low). When price closes below that gap’s high, it signals a SELL, with similar lines drawn.
By combining these elements, the indicator helps users visually identify inefficiencies (FVGs), confirm when price inverts/fills them, and place straightforward buy/sell labels alongside reference lines for trade management.
PRO Trading Averaging Beta(v1)Adaptive Position Scaling
Automatically increases position size during pullbacks using exponential volume scaling (1x, 2x, 4x, etc.). This reduces average entry cost and accelerates breakeven when price reverses.
Multi-Timeframe Confirmation
All indicators operate on a higher timeframe (120 minutes), providing:
Noise-filtered signals
Stronger trend alignment
Reduced false entries
Triple-Layer Entry Logic
Requires simultaneous confluence of:
Custom Bollinger Band penetration
RSI oversold filter (above critical threshold)
Golden cross confirmation (fast MA > slow MA)
Volatility assessment via ATR
Intelligent Exit System
Position closure triggers when either:
Fixed profit target (% of account) is reached
Technical boundary (upper Bollinger Band) is touched
⚙️ Core Mechanics:
graph LR
A --> B
B --> C{Initial Entry: 1% capital}
C --> D
D -->|Yes| E
D -->|No| F
E --> G{Max Averaging Levels?}
G -->|No| D
G -->|Yes| H
F --> I
📊 Implementation Guide:
Capital Configuration
Set initial_capital to your actual account size
Calculate base contract size:
(Account Size × 0.01) / (Instrument Price × Point Value)
Example: $10,000 account → 0.01 BTC futures contracts
Pyramiding Structure
Volume progression per averaging level:
Level 1: 1× (Base volume)
Level 2: 2×
Level 3: 4×
Level 4: 8×
Level 5: 16×
Level 6: 32×
(Max 6 levels configurable in strategy settings)
Custom Entry Variations
Alternative approach for swing captures:
// Enter only at 3rd averaging with 5% capital
if averaging_condition and strategy.opentrades == 2
strategy.entry("SwingEntry", strategy.long, qty=base_order_size*5)
Risk Management Protocol
No traditional stop-loss (replaced by averaging)
Break-even trigger: Manually move to breakeven at +0.5% profit
Max exposure: Capped at 6 averaging levels
Commissions: Pre-configured at 0.1% per trade
⚠️ Critical Risk Disclosures:
"Past Performance ≠ Future Results"
Historical optimization requires continuous forward testing ("Walk Forward" in TV).
Pyramiding Hazards
Exponential volume growth demands:
Minimum 20% free margin buffer
High liquidity instruments (spread < 0.5% of ATR)
Strict per-level risk calculation
Market Regime Dependence
Peak efficiency during:
Strong trends with 2-4% retracements
Assets with ATR > 1.5% of daily range
Avoid ranging/low-volatility conditions
💡 Pro Usage Recommendations:
Position Sizing Formula
For futures: Contracts = (Capital × Risk %) / (Entry Price × Point Value × Stop Distance)
Profit Protection
Close 50% position at 50% profit target, trail remainder
Event Safety
Disable averaging during:
High-impact news events
Exchange outages
Abnormal volume spikes
pie
title Risk Allocation per Level
“First Entry” : 12
“Level 2” : 18
“Level 3” : 25
“Level 4” : 45
ESSENTIAL: This strategy demands strict discipline. Terminate averaging when price action deviates from expected patterns. Always maintain reserve capital exceeding maximum drawdown requirements. Regularly validate strategy performance against current market dynamics.
🔥 Уникальные особенности и ценность:
Адаптивное усреднение
Стратегия автоматически увеличивает позицию при движении против вас, используя экспоненциальное наращивание объема (1x, 2x, 4x и т.д.). Это снижает среднюю цену входа и ускоряет выход в прибыль при развороте.
Мультитаймфреймная фильтрация
Все индикаторы работают на старшем таймфрейме (120 минут), что:
Фильтрует рыночный шум
Обеспечивает более надежные сигналы
Синхронизируется с глобальным трендом
Комбинированный триггер входа
Для активации требуется одновременное выполнение 4 условий:
Пробитие кастомной полосы Боллинджера
Подтверждение тренда (быстрая MA > медленной MA)
Контроль перепроданности (RSI выше критического уровня)
Фильтр волатильности (ATR)
Двойной механизм выхода
Закрытие позиций происходит при:
Достижении целевого уровня прибыли (% от депозита)
Техническом сигнале (касание верхней полосы Боллинджера)
⚙️ Как работает стратегия:
graph TD
A --> B
B --> C{Первый вход: 1% депозита}
C --> D
D -->|Да| E
D -->|Нет| F
E --> G{Достигнут лимит усреднений?}
G -->|Нет| D
G -->|Да| H
F --> I
📊 Как пользоваться:
Стартовые настройки
Base Order Size: Стартовый объем = 1% депозита
(Пример: при $10 000 депозита = 0.01 контракта)
initial_capital: Укажите ваш реальный депозит
Правила пирамидинга
Объем наращивается по схеме:
Уровень 1: 1x (базовый объем)
Уровень 2: 2x
Уровень 3: 4x
Уровень 4: 8x
Уровень 5: 16x
Уровень 6: 32x
РЕКОМЕНДУЕТСЯ Максимум 6 уровней усреднения (настраивается в pyramiding)
Кастомизация входов
Пример модификации для агрессивной тактики:
// Вход только на 3-м усреднении с 5% депозита
if averaging_condition and strategy.opentrades == 2
strategy.entry("BuyAggressive", strategy.long, qty=base_order_size*5)
Можно поставить параметр пираммидинг 1 и получать больше сигналов на младших тайм фреймах
Управление рисками
Стоп-лосс: Не используется (заменен усреднением)
Перевод в безубыток: Активируйте вручную при +0.5%
Максимальная просадка: Рекомендуется Ограничивать 6 уровнями усреднения
Комиссии: Учтены (0.1% от объема сделки)
Критические предупреждения:
"Вчера ≠ Сегодня"
Стратегия оптимизирована под историческую волатильность. Регулярно тестируйте на новых данных (режим "Перед тест" в TV).
Опасность усреднения
Экспоненциальный рост объема требует:
Глубокого расчета риска на уровень
Минимум 20% свободного маржи
Ликвидный инструмент (спред < 0.5% от ATR)
Рыночные условия
Максимальная эффективность в:
Трендовых рынках с коррекциями 2-4%
Инструментах с ATR > дневного диапазона 1.5%
💡 Рекомендации по использованию:
Для фьючерсов: Рассчитайте контракты через (капитал * 0.01) / (цена * пункт_стоимости)
При 50% достижении цели прибыли - закройте 50% позиции
Отключайте усреднение при выходе макро-новостей
pie
title Распределение риска
"Первый вход" : 10
"Уровень 2" : 20
"Уровень 3" : 30
"Уровень 4" : 40
ВАЖНО: Эта стратегия требует дисциплины! Прекращайте усреднение при отклонении рынка от исторических паттернов. Всегда имейте резервный капитал для экстренных случаев.
Scalping EMA Crossover (EMA 9 / EMA 21 + EMA 200)scalping ema crossover u can change ema
ema 9
ema 21
ema 200
Smart Trader Bot V0.5All-in-One Configurable Strategy – UT Bot + STC with Smart Position Management
This invite-only strategy combines proven indicators and unique filtering logic to offer a powerful, rules-based approach to trend trading. Designed for versatility across various markets and timeframes, it’s built to give traders full control over entries, exits, and risk logic.
⚙️ Core Logic
Primary Entry : UT Bot signal engine
Trend Confirmation : Schaff Trend Cycle (STC)
Optional Filters :
MA Cross (choose from 17 types)
Trend Breakout Filter
McGinley Dynamic Filter
🧩 Position Management Features
Stop Loss Options: ATR-based, Swing High/Low, Fixed %, Trailing SL
Take Profit Options: Fixed TP, Trailing TP with offset
Trade Flip Mode: Optional feature to auto-flip positions on opposite signals
Includes custom-built sideways-market detection logic
Suppresses unnecessary flips in ranging/choppy conditions
Designed to sustain win rate by avoiding premature trade reversals
🔧 Customization
17 selectable moving average types
Configurable signal logic and exit types
Adaptive SL/TP behavior across assets and timeframes
Compatible with crypto, forex, indices, and more
🧠 How It Works
Trade entries are based on UT Bot signals confirmed by STC trend logic
Optional confirmation from MA Cross, McGinley, or Trend Breakout logic
Once in position, SL/TP methods dynamically manage exits
Position flip logic enables trend continuation or reversal trading — enhanced by a unique sideways-market filter to limit noise in non-trending environments
🔍 Real-Time Strategy Configurations
Users granted access to this script can also view and use our shared TradingView charts configured across BTC, ETH, SOL, XRP, and more — on timeframes such as 1H, 30M, 15M, and 5M. These charts are live-linked and synced: any change in the strategy’s properties section will update instantly across all user views.
📌 Best Suited For
Traders who prefer rule-based, logic-driven automation
Scalpers and swing traders using TradingView alerts
Crypto, forex, and index market participants
Disclaimer: This is a closed-source strategy intended for experienced traders. No performance claims are made; past results are not indicative of future performance. Users are expected to evaluate and backtest strategy configurations to suit their own risk profile and market.
Access is provided for a limited evaluation period, during which users may review live chart configurations and strategy behavior in real time.
EMA Hierarchy Alternating Alert MarkersThis script allows you to set EMA 5, 13 & 26 in a single indicator.
It allows you to set an alert when PCO or NCO happens where 5>13>26 (PCO) or 5<13<26 (NCO).
It has been designed in such a way that the alert will only be sounded on the first PCO or NCO.
Once a PCO has happened then the next PCO alert will only come after the NCO has happened.
This feature helps you to avoid getting multiple alerts specially if you are using a lower timeframe.
Scripts: Equities, F&O, Commodity, Crypto, Currency
Time Frame: All
By TrustingOwl83470
ATR_SM + RSI(ema) Strategy (ikulahli)Title: ATR Smoothed + RSI EMA Strategy with Time-Based Exit
This strategy combines volatility-based trend detection (via a smoothed ATR trailing stop) with a momentum filter (using an EMA applied to RSI). It only enters trades when both trend and momentum are aligned, aiming to reduce false signals and improve entry quality.
Entry Logic:
Long entry: When an ATR-based BUY signal is detected and the RSI's EMA(9) crosses above a defined threshold (default: 55).
Short entry: When an ATR-based SELL signal is detected and the RSI's EMA(9) crosses below a defined threshold (default: 45).
Exit Logic:
Trades are automatically closed after a defined number of bars (default: 20), regardless of price action.
Parameters are fully customizable, including:
ATR length and multiplier
RSI length and its MA type (EMA/SMA/etc.)
RSI cross levels
Maximum trade duration (in bars)
⚠️ Note: Please use this strategy on standard chart types only (e.g., Candles or Bars) to ensure correct backtesting results, as required by TradingView.
This tool is intended for educational and research purposes. Always validate results with live testing and proper risk management.