EMA Golden Cross by BiraEMA Crossover Status Panel
This Pine Script v6 indicator provides a comprehensive overview of Exponential Moving Average (EMA) crossovers across multiple timeframes, displayed conveniently in a customizable panel on your chart. It helps traders quickly identify bullish or bearish trends based on the relationship between a fast EMA (default 50) and a slow EMA (default 200).
Features:
Multi-Timeframe Analysis: Monitors EMA50/EMA200 crossovers on 2-hour, 4-hour, 12-hour, 1-day, 1-week, and 2-week timeframes.
Visual Status Panel: A clear, concise panel (positioned in the middle-right by default) shows the latest crossover status for each timeframe:
"Bullish" (Green): Indicates the fast EMA has crossed above the slow EMA.
"Bearish" (Red): Indicates the fast EMA has crossed below the slow EMA.
"N/A" (Gray): No recent significant crossover detected or data unavailable.
Customizable EMAs: Easily adjust the fast and slow EMA periods (e.g., EMA20 and EMA100) via the indicator's input settings to suit your trading strategy.
Clean and Commented Code: The script is well-structured, commented, and designed for easy modification.
How to Use:
Simply add this indicator to your TradingView chart. The panel will automatically appear, providing real-time EMA crossover status across the selected timeframes, aiding in your multi-timeframe analysis and trend identification.
Penunjuk dan strategi
SL + 2 Entradas (50/50) + 2 TPs – Estratégia Manual By M.LolasIndicador criado dentro de uma estrategia específica, baseada em backtest real.
By M.Lolas
three_line_strike_lib"three_line_strike_lib"
This script is a Pine Script v5 library that identifies and visualizes classic candlestick reversal patterns—Three Line Strike and Engulfing Candles—for use in custom indicators or strategies.
Key Features
Candle Color Detection: Determines whether each candle is bullish (+1), bearish (-1), or neutral/doji (0).
Engulfing Logic:
Bearish Engulfing: A green candle followed by a larger red candle.
Bullish Engulfing: A red candle followed by a larger green candle.
The body size comparison ensures that only meaningful engulfing events are flagged.
Three Line Strike (3LS):
Bearish 3LS: Three consecutive bullish candles followed by a bearish engulfing candle.
Bullish 3LS: Three consecutive bearish candles followed by a bullish engulfing candle.
Customizable Plots:
Choose between standard shapes or fun meme icons (🍆 for bullish, 🍑 for bearish) to mark detected patterns on the chart.
Toggle display of Three Line Strike patterns and “Big A$$” (Engulfing) candles independently.
Alert Support: Signals can be tied to TradingView alerts for real-time notifications.
Usage
Import this library into your own Pine Script to access the exported functions:
candleColorIndex(barIndex) – returns candle color index.
isEngulfing(checkBearish) – checks for engulfing patterns.
isBearishEngulfing() / isBullishEngulfing() – shortcut functions.
is3LSBear() / is3LSBull() – detects Three Line Strike signals.
With the provided input toggles and plotting logic, traders can quickly highlight potential reversal or trend continuation points on any timeframe. This tool is especially useful for price action traders and scalpers seeking visual confirmation of these well-known candlestick setups.
Swing Cross NotifierThis indicator identifies swing highs and lows on the chart and draws horizontal lines at these levels.
It is designed to send an alert when the price first crosses a swing level and then closes with a reversal candle within a user-defined number of bars.
**How to Use for Alerts:**
1. Add the indicator to your chart.
2. Create an Alert.
3. In the "Condition" dropdown, select this script's name.
4. Choose "Any alert() function call".
5. Set the trigger to "Once Per Bar Close".
Daily Low Risk Calculator + ATR % CheckStoploss indicator for swing traders, I can't really explain any further
BTC RSI 35 이하 + 음봉 직후 양봉 (중복방지, 일봉 20일선 위)//@version=5
indicator("BTC RSI 35 이하 + 음봉 직후 양봉 (중복방지, 일봉 20일선 위)", overlay=true)
// === 일봉 기준 조건 ===
dailyClose = request.security(syminfo.tickerid, "D", close) // 일봉 종가
dailyMA20 = request.security(syminfo.tickerid, "D", ta.sma(close, 20)) // 일봉 20일선
aboveDailyMA = dailyClose > dailyMA20 // 일봉 종가가 20일선 위일 때만 true
// === RSI 계산 (1시간봉) ===
rsiLength = 14
rsi = ta.rsi(close, rsiLength)
// === 상태 변수 ===
var bool armed = false
var bool locked = false
// RSI 35 이하 → 무장(armed)
if (rsi <= 35)
armed := true
// RSI 40 이상 → 리셋
if (rsi >= 40)
armed := false
locked := false
// === BUY 조건 정의 (1시간봉 + 일봉 조건) ===
bearishPrev = close < open // 직전 봉 음봉
bullishNow = close > open // 현재 봉 양봉
buySignal = armed and not locked and bearishPrev and bullishNow and aboveDailyMA
// BUY 발생 시 잠금
if (buySignal)
locked := true
// === 차트 표시 ===
plotshape(buySignal, title="BUY", location=location.belowbar,
color=color.lime, style=shape.labelup, text="BUY", size=size.tiny)
// === 얼러트 조건 ===
alertcondition(buySignal, title="BUY Alert",
message="RSI 35 이하 + 음봉 직후 양봉 + 일봉 20일선 위 (1시간)")
Real Yields vs Gold vs DXYThis indicator overlays U.S. real yields, gold prices, and the U.S. Dollar Index (DXY) on the same chart, with optional normalization (raw values, Z-Score, or % change since start). It pulls macroeconomic data directly from the Federal Reserve Economic Data (FRED) (TIPS yields, nominal Treasuries, and breakeven inflation) and compares it against market feeds for gold and the dollar.
⸻
📌 What it shows you
1. Real Yields (teal line):
• The inflation-adjusted interest rate.
• Higher real yields typically reduce gold’s appeal (since gold doesn’t yield anything).
• Lower real yields usually support gold, as holding non-yielding assets becomes more attractive.
2. Gold (orange line, with optional MA):
• Spot gold (or futures) price series.
• Often moves inversely to real yields, but can diverge when inflation fears or safe-haven demand dominate.
3. U.S. Dollar Index (DXY) (blue line):
• The strength of the U.S. dollar versus major currencies.
• A strong USD often pressures gold (since it’s priced in dollars).
• Weakness in the USD often supports gold.
4. Reference Lines (0, +3, –3):
• In Z-Score mode, these act as statistical boundaries.
• Movements beyond +3 or –3 standard deviations usually signal extreme, unsustainable conditions.
📌 Why it matters for macro outlook
This indicator lets you see the three most important macro forces on gold in one pane:
• Real yields → reflect Fed policy, inflation expectations, and bond market pricing.
• DXY → reflects capital flows into or out of the USD.
• Gold → reacts to both, serving as a hedge, safe-haven, or inflation play.
By watching how these move together or diverge, you can answer key macro questions:
• Is gold moving inversely to real yields (normal regime)?
• Is gold rising even when real yields rise (inflation stress or risk aversion)?
• Is the dollar breaking the relationship (e.g., strong USD pushing gold lower despite falling yields)?
• Are we at statistical extremes (beyond ±3 Z-score), signaling stretched positioning?
⸻
✅ In short: This indicator is a macro overlay tool. It tells the story of how bond markets (real yields), currency markets (USD), and commodities (gold) interact — and whether gold’s behavior is consistent with macro fundamentals or signaling something unusual.
ema_stoploss_libLibrary "ema_stoploss_lib"
This library derives stop-loss levels from a dynamic list of EMA lengths. It computes each EMA internally (so dynamic lengths are allowed), keeps strict side filtering (long: only EMAs below the source; short: only EMAs above), sorts by distance to the source, and returns the n-th nearest value plus the original index of that EMA length.
get_stop_loss(index)
Initializes (once) a default length list:
21, 50, 100, 200, 250, 500, 750, 1000.
Returns:
sl_buy / sl_sell: selected EMA values
nearest_buy_idx / nearest_sell_idx: 0-based indices in the original lensArr
Parameters & Notes
Index (input in the example; default 2) is 0-based:
0 = nearest, 1 = second nearest, 2 = third, etc.
If there aren’t enough EMAs on the requested side, the value becomes na (plot will skip that bar).
Strict filtering means no fallback to the opposite side.
Performance:
EMA updates are O(n) per bar (n = number of lengths).
Sorting is O(k²) (k = candidates on the chosen side) — negligible for small lists.
Indicador de Confluência - M. LolasIndicador com finalidade específica em um projeto específico. By M. Lolas.
ema_stoplossLibrary "ema_stoploss"
What it does
A small library that builds stop-loss levels from dynamically computed EMAs. It finds EMAs strictly on the desired side of price (long: below; short: above), sorts them by distance to price, and returns the n-th nearest as your stop.
How it works
sortEMAsByDistanceStrictDyn(signal, lensArr, src, ascending)
Computes each EMA internally with the alpha formula (alpha = 2/(len+1)), so you can pass a dynamic array of lengths.
Strict side filter:
signal = 1 → only EMAs < src (below)
signal = -1 → only EMAs > src (above)
Sorts candidates by distance to src (default: nearest → farthest) and returns two arrays: EMA values and their lengths.
get_stop_loss(index) (exported)
Builds a default length array: 21, 50, 100, 200, 250, 500, 750, 1000.
Long side uses low to find the index-th nearest lower EMA.
Short side uses high to find the index-th nearest upper EMA.
Returns .
Plots
Stop-Loss Long (green): the selected lower EMA (based on low).
Stop-Loss Short (red): the selected upper EMA (based on high).
Input
Index (default 2): 0-based.
0 = nearest, 1 = second nearest, 2 = third, etc.
If there aren’t enough EMAs on the required side, the function returns na (no plot).
Why internal EMA calc?
ta.ema() doesn’t accept a series length; by updating each EMA with its alpha step every bar, the library supports arbitrary dynamic length arrays and stays bar-consistent.
Customize
Edit the list in get_stop_loss() to use your own EMA lengths.
Change ascending in sortEMAsByDistanceStrictDyn if you prefer farthest → nearest.
Use a different src if needed (e.g., close, hlc3, etc.).
The example intentionally uses low for long stops and high for short stops.
Notes
Strict side filtering: EMAs on the wrong side are ignored (no fallback).
If no EMA qualifies on a side, you’ll get na for that side.
Complexity is O(n²) for sorting, which is negligible for small EMA lists.
Weekly MAA combination of 3 weekly simple moving averages.
These moving averages are also displayed on the daily chart.
Stochastic Arrows Crossover [TED]This indicator plots the classic Stochastic Oscillator with customizable parameters (K, D, Smooth). It highlights bullish and bearish crossovers between %K and %D lines with small, subtle triangle arrows on the momentum panel. The arrows are color-coded with muted green (bullish) and muted red (bearish) for better visibility in dark mode. A middle band at 50 helps identify neutral momentum levels, alongside the standard overbought (80) and oversold (20) zones.
Ted
Dual Best MA Strategy AnalyzerDual Best MA Strategy Analyzer (Lookback Window)
What it does
This indicator scans a range of moving-average lengths and finds the single best MA for long crossovers and the single best MA for short crossunders over a fixed lookback window. It then plots those two “winner” MAs on your chart:
Best Long MA (green): The MA length that would have made the highest total profit using a simple “price crosses above MA → long; exit on cross back below” logic.
Best Short MA (red): The MA length that would have made the highest total profit using “price crosses below MA → short; exit on cross back above.”
You can switch between SMA and EMA, set the min/max length, choose a step size, and define the lookback window used for evaluation.
How it works (brief)
For each candidate MA length between Min MA Length and Max MA Length (stepping by Step Size), the script:
Builds the MA (SMA or EMA).
Simulates a naïve crossover strategy over the last Lookback Window candles:
Long model: enter on crossover, exit on crossunder.
Short model: enter on crossunder, exit on crossover.
Sums simple P&L in price units (no compounding, no fees/slippage).
Picks the best long and best short lengths by total P&L and plots those two MAs.
Note: Long and short are evaluated independently. The script plots MAs only; it doesn’t open positions.
Inputs
Min MA Length / Max MA Length – Bounds for MA search.
Step Size – Spacing between tested lengths (e.g., 10 tests 10, 20, 30…).
Use EMA instead of SMA – Toggle average type.
Lookback Window (candles) – Number of bars used to score each MA. Needs enough history to be meaningful.
What the plots mean
Best Long MA (green): If price crosses above this line (historically), that MA length produced the best long-side results over the lookback.
Best Short MA (red): If price crosses below this line (historically), that MA length produced the best short-side results.
These lines can change over time as new bars enter the lookback window. Think of them as adaptive “what worked best recently” guides, not fixed signals.
Practical tips
Timeframe matters: Run it on the timeframe you trade; the “best” length on 1h won’t match 1m or 1D.
Step size trade-off: Smaller steps = more precision but heavier compute. Larger steps = faster scans, coarser choices.
Use with confirmation: Combine with structure, volume, or volatility filters. This is a single-factor tester.
Normalization: P&L is in raw price units. For cross-symbol comparison, consider using one symbol at a time (or adapt the script to percent P&L).
Limitations & assumptions
No fees, funding, slippage, or position sizing.
Simple “in/out” on the next crossover; no stops/targets/filters.
Results rely on lookback choice and will repaint historically as the “best” length is re-selected with new data (the plot is adaptive, not forward-fixed).
The script tests up to ~101 candidates internally (bounded by your min/max/step).
Good uses
Quickly discover a recently effective MA length for trend following.
Compare SMA vs EMA performance on your market/timeframe.
Build a playbook: note which lengths tend to win in certain regimes (trending vs choppy).
Not included (by design)
Alerts, entries/exits, or a full strategy report. It’s an analyzer/overlay.
If you want alerts, you can add simple conditions like:
ta.crossover(close, plotLongMA) for potential long interest
ta.crossunder(close, plotShortMA) for potential short interest
Changelog / Notes
v1: Initial release. Array-based scanner, SMA/EMA toggle, adaptive long/short best MA plots, user-set lookback.
Disclaimer
This is educational tooling, not financial advice. Test thoroughly and use proper risk management.
EMA+RSI Buy/Sell with Fibonacci GuideSingle-Instance EUR/USD & GBP/USD Trend+MACD ATR EA
Purpose:
This EA is designed for automated Forex trading on EUR/USD and GBP/USD. It identifies trend-based trading opportunities, dynamically calculates position sizes based on your available capital and risk percentage, and manages trades with ATR-based stop-loss and take-profit levels, including optional trailing stops.
Key Features:
Auto Pair Selection:
Compares the trend strength of EUR/USD vs GBP/USD using a combination of EMA slopes and MACD direction.
Automatically trades the stronger trending pair.
Trend & Signal Detection:
Uses Fast EMA / Slow EMA crossover for trend direction.
Confirms trend with MACD line vs signal line.
Generates long and short signals only when trend and MACD align.
Dynamic SL/TP:
Stop-loss and take-profit are calculated based on ATR (Average True Range).
Supports optional trailing stops to lock in profits.
Position Sizing:
Automatically calculates micro-lot sizes based on your capital and risk percentage.
Ensures risk per trade does not exceed the defined % of your account equity.
Chart Visualization:
Plots Fast EMA / Slow EMA.
Displays SL and TP levels on the chart.
Shows a label indicating the active pair currently being traded.
Alerts:
Generates alerts for long and short signals.
Can be used with TradingView alerts to notify or trigger webhooks.
Single Strategy Instance:
Fully compatible with Pine Script v6.
Only one strategy instance runs on the chart to prevent “too many strategies” errors.
DEV (%)Deviation from MMA5 (%)
- MMA = (High + Low) / 2
- Calculates 5-day SMA of MMA (MMA5)
- Plots deviation (%) of current Mid Price from MMA5
- Above 0% → price above MMA5
- Below 0% → price below MMA5
Piano Frequency LevelsPiano Frequency Levels
This indicator applies the mathematical principles of musical harmony to market analysis, creating support and resistance levels based on authentic piano frequency ratios. Drawing from centuries-old musical theory, it maps the precise mathematical relationships between piano keys to price levels.
How It Works: The indicator uses the exact frequency ratios from equal temperament tuning - the same mathematical system that makes pianos sound harmonious. Each level represents an actual piano key frequency, scaled proportionally to your chosen anchor price.
Key Features:
• Piano-Based Ratios: Uses authentic 12-tone equal temperament frequency relationships (1.05946 ratio between semitones)
• Directional Intelligence: Automatically creates ascending levels from lows (resistance) or descending levels from highs (support)
• Musical Note Labels: Optional display of actual piano key names (C4, D#5, F6, etc.) alongside price levels
• Black Key Subdivisions: Toggle authentic sharp/flat keys between natural notes for additional precision
• Octave Color Coding: Each musical octave displays in a different color for easy visual identification
• Anchor Reference: Bright green line clearly marks your C-note reference point
Musical Foundation: Every level corresponds to an actual piano key. The anchor point represents "C" (the musical root), with levels progressing through the natural musical sequence: C, D, E, F, G, A, B, then repeating in higher octaves. This creates proportional spacing that mirrors the harmonic relationships musicians have used for centuries.
Usage:
1. Set your anchor to a significant market high or low
2. Choose your desired number of levels (typically 12-24 for 1-2 octaves)
3. Enable "Add Black Keys" for additional intermediate levels
4. Enable "Show Note Names" to see which piano key each level represents
The Theory: Musical harmony is based on precise mathematical ratios that create pleasing relationships between frequencies. These same mathematical principles may manifest in market movements, as price action often exhibits proportional relationships similar to musical intervals.
Unique Advantages:
• Based on established mathematical principles rather than arbitrary ratios
• Provides both major levels (white keys) and intermediate levels (black keys)
• Automatically adapts direction based on anchor type (high vs low)
• Maintains authentic musical relationships across all timeframes and price ranges
Important Note: This indicator presents a theoretical framework for market analysis. Like all technical analysis tools, it should be used in conjunction with other forms of analysis and proper risk management. The musical ratios provide a unique perspective on potential support and resistance levels, but past performance does not guarantee future results.
Transform your charts into a musical instrument and discover the hidden harmonies in market movements.
MMAMMA (Midpoint Moving Average)
Similar to SMA but calculated using (High + Low) / 2 instead of Close.
Helps reduce noise by smoothing out candlestick wicks.
Useful for identifying trend direction, support/resistance, and combining with other indicators.
Moving averages applied: 5, 10, 20, 50, 100, 200
Short-term: 5, 10, 20 → captures quick price action
Mid-term: 50, 100 → identifies medium trend
Long-term: 200 → widely used global trend benchmark
Color Scheme (Red → Orange → Yellow → Green → Blue → Navy)
Red: 5 / Orange: 10 / Yellow: 20 / Green: 50 / Blue: 100 / Navy: 200
Transparency: 50% → keeps chart clean when lines overlap
Line Thickness: 1 → minimal, non-intrusive visual
Expected Value Monte CarloI created this indicator after noticing that there was no Expected Value indicator here on TradingView.
The EVMC provides statistical Expected Value to what might happen in the future regarding the asset you are analyzing.
It uses 2 quantitative methods:
Historical Backtest to ground your analysis in long-term, factual data.
Monte Carlo Simulation to project a cone of probable future outcomes based on recent market behavior.
This gives you a data-driven edge to quantify risk, and make more informed trading decisions.
The indicator includes:
Dual analysis: Combines historical probability with forward-looking simulation.
Quantified projections: Provides the Expected Value ($ and %), Win Rate, and Sharpe Ratio for both methods.
Asset-aware: Automatically adjusts its calculations for Stocks (252 trading days) and Crypto (365 days) for mathematical accuracy.
The projection cone shows the mean expected path and the +/- 1 standard deviation range of outcomes.
No repainting
Calculation:
1. Historical Expected Value:
This is a systematic backtest over thousands of bars. It calculates the return Rᵢ for N past trades (buy-and-hold). The Historical EV is the simple average of these returns, giving a baseline performance measure.
Historical EV % = (Σ Rᵢ) / N
2. Monte Carlo Projection:
This projection uses the Geometric Brownian Motion (GBM) model to simulate thousands of future price paths based on the market's recent behavior.
It first measures the drift (μ), or recent trend, and volatility (σ), or recent risk, from the Projection Lookback period. It then projects a final return for each simulation using the core GBM formula:
Projected Return = exp( (μ - σ²/2)T + σ√T * Z ) - 1
(Where T is the time horizon and Z is a random variable for the simulation.)
The purple line on the chart is the average of all simulated outcomes (the Monte Carlo EV). The cone represents one standard deviation of those outcomes.
The dashed lines represent one standard deviation (+/- 1σ) from the average, forming a cone of probable outcomes. Roughly 68% of the simulated paths ended within this cone.
This projection answers the question: "If the recent trend and volatility continue, where is the price most likely to go?"
Here's how to read the indicator
Expected Value ($/%): Is my average trade profitable?
Win Rate: How often can I expect to be right?
Sharpe Ratio: Am I being adequately compensated for the risk I'm taking?
User Guide
Max trade duration (bars): This is your analysis timeframe. Are you interested in the probable outcome over the next month (21 bars), quarter (63 bars), or year (252 bars)?
Position size ($): Set this to your typical trade size to see the Expected Value in real dollar terms.
Projection lookback (bars): This is the most important input for the Monte Carlo model. A short lookback (e.g., 50) makes the projection highly sensitive to recent momentum. Use this to identify potential recency bias. A long lookback (e.g., 252) provides a more stable, long-term projection of trend and volatility.
Historical Lookback (bars): For the historical backtest, more data is always better. Use the maximum that your TradingView plan allows for the most statistically significant results.
Use TP/SL for Historical EV: Check this box to see how the historical performance would have changed if you had used a simple Take Profit and Stop Loss, rather than just holding for the full duration.
I hope you find this indicator useful and please let me know if you have any suggestions. 😊
Volume Profile Auto POC📌 Overview
Volume Profile Auto POC is a trend-following strategy that uses the automatically calculated Point of Control (POC) from the volume profile, combined with ATR zones, to capture reversals and breakouts.
By basing decisions on volume concentration, it dynamically visualizes the price levels most watched by market participants.
⚠️ This strategy is provided for educational and research purposes only.
Past performance does not guarantee future results.
🎯 Strategy Objectives
Automatically detect the volume concentration area (POC) to improve entry accuracy
Optimize risk management through ATR-based volatility adjustment
Provide early and consistent signals when trends emerge
✨ Key Features
Automatic POC Detection : Updates the volume profile over a defined lookback window in real time
ATR Zone Integration : Defines a POC ± 0.5 ATR zone to clarify potential reversals/breakouts
Visual Support : Plots the POC line and zones on the chart for intuitive decision-making
📊 Trading Rules
Long Entry:
Price breaks above the POC + 0.5 ATR zone
Volume is above average to support the breakout
Short Entry:
Price breaks below the POC - 0.5 ATR zone
Volume is above average to support the downside move
Exit (or Reverse Position):
Price returns to the POC area
Or touches the ATR band
⚙️ Trading Parameters & Considerations
Indicator Name: Volume Profile Auto POC
Parameters:
Lookback Bars: 50
Bins for Volume Profile: 24
ATR Length: 14
ATR Multiplier: 2.0
🖼 Visual Support
POC line plotted in red
POC ± 0.5 ATR zone displayed as a semi-transparent box
ATR bands plotted in blue for confirmation
🔧 Strategy Improvements & Uniqueness
This strategy is inspired by traditional Volume Profile + ATR analysis,
while adding the improvement of a sliding-window mechanism for automatic POC updates.
Compared with conventional trend-following approaches,
its strength lies in combining both price and volume perspectives for decision-making.
✅ Summary
Volume Profile Auto POC automatically extracts key market levels (POC) and combines them with ATR-based zones,
providing a responsive trend-following method.
It balances clarity with practicality, aiming for both usability and reproducibility.
⚠️ This strategy is based on historical data and does not guarantee future profits.
Always use proper risk management when applying it.