Chaikin Money Flow//@version=5
indicator("WTI Short Breakout Alert", overlay=true)
// === Input Parameters ===
supportLevel = input.float(65.50, title="Breakout Support Level", step=0.01) rsiLength = input.int(14, title="RSI Length") emaLength = input.int(21, title="EMA Length")
// === Calculations ===
ema = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)
// === Conditions ===
belowEMA = close < ema
rsiBearish = rsi < 50
breakSupport = close < supportLevel
// === Final Alert Condition ===
shortSetup = belowEMA and rsiBearish and breakSupport
// === Plotting ===
plot(supportLevel, title="Support Level", color=color.red, linewidth=1, style=plot.style_line) plotshape(shortSetup, title="Short Entry", location=location.belowbar, color=color.red, style=shape.labeldown, text="SHORT")
// === Alert ===
alertcondition(shortSetup, title="Short Breakout Alert", message="WTI SHORT Setup: Price < EMA21, RSI < 50, and breaking below support!")
指標和策略
SPY Hybrid ORE Strategy v3This Pine Script strategy implements a SPY Hybrid Opening Range Expansion (ORE) Strategy that trades breakouts from the daily opening range during specific market hours (9:30-11:30 AM). The strategy identifies "sucker moves" - situations where the opening range is unusually large compared to historical volatility (ATR) - and then trades breakouts in the opposite direction of the initial move.
For long positions, it enters when price breaks above the previous bar's high after a large opening range in bullish market conditions (price above 50-day SMA), using the opening low as a stop loss and targeting a profit equal to half the opening range. For short positions, it enters on breaks below the previous bar's low during bearish conditions (price significantly below 50-day SMA with bearish momentum), using more aggressive stops and partial profit-taking. The strategy incorporates multiple filters including volatility (ATR), volume, RSI momentum, and includes risk management through position sizing based on account equity and stop distance, along with time-based exits and cooldown periods between trades.
Beta calculatorCalculates the market beta for the stock that is on your screen. You may change the parameters by changing the symbol you are using as benchmark to calculate market beta in the settings. This will affect the market beta you get. VTI is used since it has a theoretical market beta of 1.
Stock-Specific SMA200 Volatility NormalizedIt is used for swing treding it is shows for 0 to 100 range for every stock
moving_averages_library_public🔍 Overview
A comprehensive open‑source Pine Script library offering a wide variety of moving average functions, including dynamic int-series support for variable-length MA calculations
Reddit
✨ Features
Dozens of moving averages supported:
SMA, EMA, WMA, TMA
Advanced types: ALMA, VRAMA, EFRAMA, EHMA, THMA, etc.
Each function supports both fixed-length and series-length input
Easily integrated into other indicators and strategies via dynamic length parameters
⚙️ How to Use
Import the library:
import T69/Moving_Averages/1 as ma
Call your desired MA function using source and length:
ma.hma(src, len)
ma.frama(src, len)
For dynamic integration, use an input type and pass to the matching function.
🛠 Example Code
src = input.source(close, "Source")
len = input.int(14, "Length")
type = input.string("HMA", "MA Type", options= )
ma_value = switch type
"EMA" => ma.ema(src,len)
"HMA" => ma.hma(src,len)
"FRAMA" => ma.frama(src,len)
=> na
plot(ma_value, color=color.blue)
⚠️ Limitations
Internal calculation precision may differ slightly from TradingView’s built‑in MA functions
Users must manually map input strings to MA functions
Does not include built‑in GUI dropdowns for selecting type
💡 Tips
Use adaptive MAs like VIDYA, JMA, or KAMA for volatility-aware smoothing
Combine with oscillators or ATR bands to define trend strength or entry zones
Utilize series‑based MA inputs for backtesting variability or optimization
📘 Credits
Author: MightyZinger
Published: June 2022 (Public Library), regularly updated
License: Open‑source. Reuse subject to TradingView House Rules
//====================TECHNICAL STUFFS====================
Library "moving_averages_library_public"
TODO: add library description here
new_def_teyoparams()
get_all_ma_enums()
get_ma_out(p_type, src, len, update_instances)
TODO: add function description here
Parameters:
p_type (series ma_type)
src (float) : TODO: Source of the candle for computation
len (simple int) : TODO: Length of lookback of the candle for computation
update_instances (teyo_parameters)
Returns: TODO: add what function returns
==============================================================================
Moving Average Selector
==============================================================================
teyo_parameters
Fields:
p1 (series float)
p2 (series float)
p3 (series float)
p4 (series float)
p5 (series float)
p6 (series float)
p7 (series float)
p8 (series float)
p9 (series float)
p10 (series float)
p11 (series float)
p12 (series float)
p13 (series float)
p14 (series float)
p15 (series float)
p16 (series float)
p17 (series float)
p18 (series float)
p19 (series float)
p20 (series float)
BB with Heikin Ashi + Reversal CheckThis indicator combines Bollinger Bands (BB) with Heikin Ashi candles to detect potential reversal points after price breaks the BB boundaries. It works on any symbol and timeframe, retrieving Heikin Ashi data via request.security().
Core Features
Heikin Ashi Candle Plot
Smooths price action by using Heikin Ashi candles instead of regular candles.
Candles are plotted directly on the chart with green (bullish) and red (bearish) colors.
Bollinger Bands (BB)
Calculated from Heikin Ashi close price.
Includes Basis (MA), Upper Band, and Lower Band, with customizable MA type, length, and standard deviation multiplier.
Break & Reversal Detection
The indicator tracks whether the price has broken above the Upper Band (p1) or below the Lower Band (p2).
It remembers the last breakout direction until the opposite breakout occurs (mutually exclusive logic).
Signal Logic
Long Signal (▲):
Price was previously below the Lower Band and then reversed upward (BB Lower rising + Heikin Ashi candle rising).
Short Signal (▼):
Price was previously above the Upper Band and then reversed downward (BB Upper falling + Heikin Ashi candle falling).
Alerts
Custom alert conditions trigger when Long or Short signals occur, allowing automated notifications or bot integration.
Use Cases
✅ Swing Trading / Trend Reversal – Identify potential bottom/top reversals after BB breakouts.
✅ Mean Reversion Strategies – Enter trades when the price reverts to the BB mean after an extreme breakout.
✅ Multi-Timeframe Analysis – Works with any timeframe and symbol via request.security().
Customization
MA Type: SMA, EMA, RMA, WMA, VWMA
BB Length & StdDev Multiplier
Timeframe & Symbol Selection
Common DMAs with LabelsHere's a short description for publishing:
Common Daily Moving Averages (DMA) Indicator with Smart Labels
Displays the most widely-used moving averages that professional traders watch: 5, 10, 20, 50, 100, and 200 DMAs with clear color-coding and descriptive labels.
Key Features:
Smart Labels - Each DMA shows its trading purpose (Day Trading, Swing Trading, Bull/Bear Line, etc.)
Customizable Display - Toggle any DMA on/off individually
Golden/Death Cross Alerts - Optional 50/200 crossover signals
Live Status Table - Shows current DMA values vs price with up/down arrows
Professional Styling - Color-coded lines with appropriate thickness (200 DMA emphasized)
Perfect for:
Multi-timeframe trend analysis
Support/resistance identification
Bull/bear market confirmation
Entry/exit timing
Usage: Add to chart, customize which DMAs to display in settings. Labels appear on the right showing each average's trading significance. Enable the status table for quick price-vs-DMA reference.
Ideal for both beginners learning key moving averages and experienced traders wanting a clean, informative DMA setup.
DTA Seven-Candle Trend IndicatorSeven candles Trend Identifier
📊 Output:
* Trend shown in table: "Uptrend", "Downtrend", or "Sideways"
* Strength level:
* "Strong" = 10+ confirmations (HH/HL or LL/LH)
* "Moderate" = 6–9 confirmations
* "Weak" = anything else (Sideways)
* All colors sync with background and label styles
The yellow background color in the script indicates a sideways trend — meaning:
🟨 Yellow Background = Sideways Market
This occurs when:
* The last 7 candles do not form a clear uptrend (higher highs & higher lows)
* And also do not form a clear downtrend (lower highs & lower lows)
🔍 Why It Happens:
* Mixed candle structure
* Price is oscillating in a range
* No dominant directional momentum
* Often seen before breakouts or during consolidation
✅ Example:
Imagine the last 7 candles had highs and lows like this:
Bar High Low
1 100 95
2 98 94
3 101 96
4 100 95
5 99 93
6 102 97
7 100 95
In this case:
* Not consistently making higher highs/lows (so not uptrend)
* Not consistently making lower highs/lows (so not downtrend)
➡️ Therefore, the script marks it as sideways, and the background turns yellow.
Nasdaq 1m - Asia Resaltada + Manipulación + CHOCH + EMA200Strategy that will help you take some entry only with the nasqad
XRP Scalping Bot v2 (Freq-Boost + Risk Mgmt)sumn i made with help from ai. uses bollinger, adx, atr, macd, rsi, ema. originally for XRP/USDC for 3commas. just trying to get something right
US Index First 30m Candle Strategy (10m Chart)Strategy Description for Publishing
Title: US Index First 30-Minute Candle Strategy (10m Chart)
Overview:
This Pine Script implements a trading strategy designed to capitalize on price movements within the first 30 minutes of the U.S. stock market opening. It is specifically tailored for use on a 15-minute chart and is optimized for trading U.S. indices during regular market hours.
Features:
Session Time Configuration: The strategy operates within the U.S. market hours, specifically from 9:30 AM to 4:00 PM (Eastern Time).
First 30-Minute Candle Aggregation: The script identifies the high and low of the first 30-minute candle, which is considered a critical time frame for market momentum.
Single Trade Per Day: To minimize risk, the strategy is designed to execute only one trade per day based on the established range of the first 30 minutes.
Dynamic Trade Conditions: Buy and sell signals are generated when the price breaks above the high or below the low of the first 30-minute candle, with defined stop-loss and take-profit levels based on a customizable risk-reward ratio.
How It Works:
Initialization:
At the start of each trading day, the script resets the high and low values for the first 30 minutes.
Range Locking: After the first 30 minutes, the high and low values are locked, allowing for trade entries based on these levels.
Trade Execution:
Long Entry: Triggered when the price moves above the locked high.
Short Entry: Triggered when the price drops below the locked low.
Risk Management: Each trade comes with a stop-loss and take-profit mechanism to manage potential losses and secure profits.
Visuals:
The script also plots the locked high and low levels on the chart, providing a visual reference for traders.
Conclusion:
This strategy leverages the volatility often seen in the first 30 minutes of trading, aiming to capture significant price movements while maintaining a disciplined trading approach. It is suitable for traders looking to implement a systematic strategy based on early market behavior.
Usage:
To use this strategy, simply add the script to your TradingView chart, set your desired parameters, and monitor for trade signals during the specified market hours. Adjust the risk-reward ratio as needed to align with your trading style.
4H Box+ m15 Separador4-Hour Boxed Period Separator for H4 Candlestick Analysis by Liquidity Collection
with TimeZone and M15 Period Separator
[Pandora] Laguerre Ultimate Explorations MulticatorIt's time to begin demonstrations differentiating the difference between known and actual feasibility beyond imagination... Welcome to my algorithmic twilight zone .
INTRODUCTION:
Hot off my press, I present this Laguerre multicator employing PSv6.0, originally formulated by John Ehlers for TASC - July 2025 Traders Tips. Basically I transcended Ehlers' notions of transversal filtration with an overhaul of his Laguerre design with my "what if" Pandora notions included. Striving beyond John Ehlers' original intended design. This action packed indicator is a radically revamped version of his original filter using novel techniques. My aim was to explore whether providing even more enhanced responsiveness and lesser lag is possible and how. Presented here is my mind warping results to witness.
EHLERS' LAGUERRE EXPLAINED:
First and foremost, the concept of Ehlers' Laguerre-izing method deserves a comprehensive deep dive. Ehlers' Laguerre filter design, as it functions originally, begins with his Ultimate Smoother (US) followed by a gang of four LERP (jargon for Linear intERPolation) filters. Following a myriad of cascading LERPs is a window-like FIR filter tapped into the LERP delay values to provide extra smoothness via the output.
On a side note, damping factor controlled LERP filters resemble EMAs indeed, but aren't exactly "periodic" filters that would have a period/length parameter and their subsequent calculations. I won't go into fine-grained relationship details, but EMA and LERP are indeed related in approach, being cousins of similar pedigree.
EXAMINING LAGUERRE:
I focused firstly on US initialization obstacles at Pine's bar_index==0 with nz() in abundance. The next primary notion of intrigue I mostly wondered about was, why are there four LERP elements instead of fewer or more. Why not three or why not two LERPs, etc... 1-4-6-4-1, I remember seeing those coefficients before in high pass filters.
Gathering my thoughts from that highpass knowledge base, I devised other tapped configuration modes to inspect their behavior out of curiosity. Eureka! There is actually more to Laguerre than Ehlers' mind provided, now that I had formulated additional modes. Each mode exhibits it's own lag/smoothness characteristics better than the quad LERPed version. I narrowed it down to a total of 5 modes for exploration. Mode 0 is just the raw US by itself.
ANALYZING FILTER BEHAVIORS:
Which option might be possibly superior, and how may I determine that? Fortunately, I have a custom-built analyzer allowing me to thoroughly examine transient responses across multiple periodicities simultaneously, providing remarkable visual insights.
While Ehlers has meagerly touched upon presenting general frequency responses in his books, I have excelled far beyond that. This robust filter analysis capability enables me to observe finer aspects hidden to others, ultimately leading to the deprecation of numerous existing filters. Not only this, but inventing entirely new species of filtration whether lowpass, highpass, or bandpass is already possible with a thorough comprehensive evaluation.
Revealing what's quirky with each filter and having the ability to discover what filters may be lacking in performance, is one of it's implications. I'm just going to explain this: For example US has a little too much overshoot to my liking, along with nonconformant cutoff frequency compliance with the period parameter. Perhaps Ehlers should inspect US coefficients a bit closer... I hope stating this is not received in an ill manner, as it's not my intention here.
What this technically eludes to is that UltimateSmoother can be further improved, analogous to my Laguerre alterations described above. I will also state Laguerre can indeed be reformulated to an even greater extent concerning group delay, from what I have already discussed. Another exciting time though... More investigative research is warranted.
LAGUERRE CONCLUSIONS:
After analyzing Laguerre's frequency compliance, transient responses, amplitudes, lag, symmetry across periodicities, noise rejection, and smoothness... I favor mode 3 for a multitude of reasons over the mode 4 configuration, but mostly superb smoothing with less lag, AND I also appreciated mode 1 & 2 for it's lower lag performance options.
Each mode and lag (phase shift) damping value has it's own unique characteristics at extremes, yet they demonstrate additional finesse in it's new hybrid form without adding too much more complexity. This multicator has a bunch of Laguerre filters in the overlay chart over many periodicities so you can easily witness it's differing periodic symmetries on an input signal while adjusting lag and mode.
LAGUERRE OSCILLATOR:
The oscillator is integrated into the laguerreMulti() function for the intention of posterity only. I performed no evaluation on it, only providing the code in Pine. That wasn't part of my intended exploration adventure, as I'm more TREND oriented for the time being, focusing my efforts there.
Market analysis has two primary aspects in my observations, one cyclic while the other is trending dynamics... There's endless oscillators, but my expectations for trend analysis seems a little lesser explored in my opinion, hence my laborious trend endeavors. Ehlers provided both indicator facets this time around, and I hope you find the filtration aspect more intriguing after absorption of this reading.
FUNCTION MODULES EXPLAINED:
The Ultimate Smoother is an advanced IIR lowpass smoothing filter intended to minimize noise in time series data with minimal group delay, similar to a traditional biquad filter. This calculation helps to create a smoother version of the original signal without the distortions of short-term fluctuations and with minimal lag, adjustable by period.
The Modified Laguerre Lowpass Filter (MLLF) enhances the functionality of US by introducing a Laguerre mode parameter along side the lag parameter to refine control over the amount of additional smoothing/lag applied to the signal. By tethering US with this LERPed lag mechanism, MLLF achieves an effective balance between responsiveness and smoothness, allowing for customizable lag adjustments via multiple inputs. This filter ends with selecting from a choice of weighted averages derived from a gang of up to four cascading LERP calculations, resulting with smoother representations of the data.
The Laguerre Oscillator is a momentum-like indicator derived from the output of US and a singular LERPed lowpass filter. It calculates the difference between the US data and Laguerre filter data, normalizing it by the root mean square (RMS). This quasi-normalization technique helps to assess the intensity of the momentum on any timeframe within an expected bound range centered around 0.0. When the Laguerre Oscillator is positive, it suggests that the smoothed data is trending upward, while a negative value indicates a downward trend. Adjustability is controlled with period, lag, Laguerre mode, and RMS period.
Pre-Market High and LowThis indicator automatically tracks and plots the daily pre-market high and low levels on your chart for U.S. stocks. It monitors the pre-market session from 4:30 AM to 9:30 AM Eastern Time (New York) and captures the highest and lowest prices during this period.
At exactly 9:30 AM ET, when the regular market opens, the indicator draws dashed horizontal lines representing the pre-market high and pre-market low, extending them forward for better visibility throughout the trading day.
MVRV Altcoins📌 Technical Description of Indicator: MVRV Altcoins
This advanced script calculates the Market Value to Realized Value (MVRV) ratio across multiple cryptocurrencies simultaneously. It offers two analytical modes: Normal and Z-Score, optimized for visual comparison and real-time monitoring of up to 13 predefined assets. If a user applies the indicator to a symbol that is not among the 13 programmed assets, the default behavior displays the Bitcoin chart as a fallback reference.
🔍 What Is MVRV and Why Is It Important?
MVRV is an on-chain metric designed to assess whether a cryptocurrency is overvalued or undervalued by comparing its market capitalization to its realized capitalization.
- Market Cap: The total circulating supply multiplied by the current market price.
- Realized Cap: The sum value of all coins based on the price at the time they last moved on-chain, offering a time-weighted valuation.
Normal Calculation:
MVRV_Normal = Market Cap / Realized Cap
This version reflects investor profitability and identifies potential accumulation or distribution zones.
📊 Z-Score Calculation:
MVRV_ZScore = (Market Cap − Realized Cap) / Standard Deviation of Market Cap
This formula evaluates how extreme the current market conditions are compared to historical norms. It normalizes the difference using statistical dispersion, turning it into a volatility-aware metric that better reflects valuation extremes.
🔎 How Market Cap Is Computed
Unlike conventional indicators relying on consolidated feeds, this script uses modular components from CoinMetrics to construct the active capitalization more accurately, especially for altcoins. Here's the breakdown:
Active Capitalization = MARKETCAPFF + MARKETCAPACTSPLY
Realized Capitalization = MARKETCAPREAL
Component Definitions:
- MARKETCAPFF: Market Cap Free Float — total valuation based only on truly circulating coins.
- MARKETCAPACTSPLY: Capitalization from actively circulating supply — filters dormant or locked coins.
- MARKETCAPREAL: Realized Cap — historical valuation weighted by the last on-chain movement of each coin.
This method offers enhanced precision and compatibility across assets that may lack comprehensive data from centralized providers.
⚙️ User-Configurable Parameters
- MVRV Mode: Choose between Normal and Z-Score.
- Percentage Scale View: If enabled, visual output is scaled using predefined divisors (100 / 3.5 or 100 / 6).
- Thresholds for Analysis:
- Normal mode: Define overbought and oversold levels (default 1.0 and 3.5).
- Z-Score mode: Configure statistical boundaries (default 0.0 and 6.0).
- Table Controls:
- Adjustable position on screen (9 options).
- Font size customization: tiny, small, normal, large.
- Color scheme personalization:
- Header: text and background
- Body: text and background
- Central column separator color
📊 Multicrypto Table Architecture
The indicator renders a high-performance visual table displaying data from up to 13 assets simultaneously. Each asset is represented as a vertical column featuring eigth historical data points plus the most recent value.
- Assets are displayed in two blocks separated by a decorative column.
- Each value is rounded to one decimal place for clarity.
- Cells are styled dynamically based on user settings.
🎨 Decorative Column Separator
Since the entire table is built as a unified structure, a color-configurable empty column is inserted mid-table to act as a visual divider. This approach improves readability and aesthetic balance without duplicating code or splitting table logic.
🔁 Default Behavior on Unsupported Assets
If the active chart is not one of the 13 predefined assets, the indicator will automatically display Bitcoin’s data. This ensures the chart remains functional and informative even outside the target asset group.
🎯 Color Interpretation by Condition
The MVRV value for each asset is highlighted using a traffic light system:
- Green: Undervalued (below oversold threshold)
- Red: Overvalued (above overbought threshold)
- Yellow: Neutral zone
This coding simplifies decision-making and visual scanning across assets.
Final Notes
This indicator is modular and fully adaptable, with well-commented sections designed for efficient customization. Its multiactive architecture makes it a valuable tool for crypto analysts tracking diversified portfolios beyond Bitcoin and Ethereum.
It supports visual storytelling across assets, comparative historical evaluation, and identification of strategic zones — whether for accumulation, distribution, or monitoring on-chain sentiment.
MACD 衰减信号For Max's MACD Decay Signal
A non-repainting signal based on MACD histogram momentum decay combined with price structure divergence. This script helps traders identify potential trend reversal points using multi-wave analysis.
📈 Bullish Signal
Triggered when:
MACD histogram prints three weakening red waves (histogram bars are rising toward zero)
Price makes lower lows, while MACD histogram rises (bullish divergence)
Histogram just turns green
🟢 Label: "MACD多头" appears below the candle
📢 Alert: "MACD 多头信号"
📉 Bearish Signal
Triggered when:
MACD histogram prints three weakening green waves (histogram bars falling toward zero)
Price makes higher highs, while MACD histogram falls (bearish divergence)
Histogram just turns red
🔴 Label: "MACD空头" appears above the candle
📢 Alert: "MACD 空头信号"
⚙️ Features
Adjustable MACD parameters: Fast, Slow, Signal lengths
Uses arrays to track momentum and price shift patterns
Built to avoid repainting, works on all timeframes
Comes with alert conditions for automation or manual notifications
✅ Best For
Catching early trend reversal opportunities
Combining with price action or support/resistance levels
Traders who value momentum + structure-based signals
Confirmed Entry Grid Pro//@version=5
indicator("Confirmed Entry Grid Pro", overlay=true,
max_lines_count=500, max_labels_count=500,
title="Confirmed Entry Grid Pro")
// === إعدادات المستخدم ===
showImpulse = input.bool(true, "Show Impulse Wave")
showShrinkWarning = input.bool(true, "Shrink Warning")
minConfirmations = input.int(5, "Minimum Confirmations", minval=3, maxval=10)
// === المتوسطات ===
ma9 = ta.sma(close, 9)
ma21 = ta.sma(close, 21)
ma200 = ta.sma(close, 200)
// === الاتجاه ===
trendBull = close > ma200
trendBear = close < ma200
// === الزخم ===
rsi = ta.rsi(close, 14)
rsiBull = rsi > 50
rsiBear = rsi < 50
// === الحجم ===
volMA = ta.sma(volume, 20)
volHigh = volume > volMA
// === شموع ابتلاعية ===
bullEngulf = close > open and open < close and close > open
bearEngulf = close < open and open > close and close < open
// === بولنجر باند ===
basis = ta.sma(close, 20)
dev = ta.stdev(close, 20)
upper = basis + 2 * dev
lower = basis - 2 * dev
bbBreakUp = close > upper
bbBreakDown = close < lower
// === دعم / مقاومة ديناميكية ===
support = ta.lowest(low, 20)
resistance = ta.highest(high, 20)
nearSupport = math.abs(close - support) / close < 0.015
nearResistance = math.abs(close - resistance) / close < 0.015
// === تقاطع المتوسطات ===
crossUp = ta.crossover(ma9, ma21)
crossDown = ta.crossunder(ma9, ma21)
// === ATR ===
atr = ta.atr(14)
atrActive = atr > ta.sma(atr, 14)
// === SMC: BOS + CHOCH + Impulsive Wave ===
bosUp = high > high and low > low
bosDown = low < low and high < high
chochUp = close > high and close < high
chochDown = close < low and close > low
smcBuy = bosUp and chochUp
smcSell = bosDown and chochDown
// === الموجة الدافعة (مؤشر اختياري لإشارة دخول قوية)
impulseWaveSell = close <= close and close <= close and close <= close and close < open
impulseWave = close >= close and close >= close and close >= close and close > open
// === مناطق السيولة ===
liqHigh = ta.highest(high, 30)
liqLow = ta.lowest(low, 30)
liquidityBuyZone = close < liqLow
liquiditySellZone = close > liqHigh
// === حساب النقاط لكل صفقة ===
buyScore = (trendBull ? 1 : 0) + (rsiBull ? 1 : 0) + (volHigh ? 1 : 0) + (bullEngulf ? 1 : 0) + (smcBuy ? 1 : 0) + (bbBreakUp ? 1 : 0) + (nearSupport ? 1 : 0) + (crossUp ? 1 : 0) + (atrActive ? 1 : 0) + (liquidityBuyZone ? 1 : 0)
sellScore = (trendBear ? 1 : 0) + (rsiBear ? 1 : 0) + (volHigh ? 1 : 0) + (bearEngulf ? 1 : 0) + (smcSell ? 1 : 0) + (bbBreakDown ? 1 : 0) + (nearResistance ? 1 : 0) + (crossDown ? 1 : 0) + (atrActive ? 1 : 0) + (liquiditySellZone ? 1 : 0)
// === شروط الإشارات مع منع التكرار خلال آخر 5 شموع ===
var int lastBuyBar = na
var int lastSellBar = na
canBuy = buyScore >= 5 and impulseWave and (na(lastBuyBar) or bar_index - lastBuyBar > 3)
canSell = sellScore >= 5 and impulseWaveSell and (na(lastSellBar) or bar_index - lastSellBar > 3)
if canBuy
lastBuyBar := bar_index
if canSell
lastSellBar := bar_index
showBuy = canBuy and buyScore >= minConfirmations
showSell = canSell and sellScore >= minConfirmations
// === طول الخطوط ===
var int lineLen = 5
// === رسم الإشارات ===
plotshape(showBuy, title="BUY", location=location.belowbar, style=shape.triangleup, size=size.small, color=color.green)
plotshape(showImpulse and impulseWave, title="Impulsive Buy", location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.lime, text="IB")
plotshape(showSell, title="SELL", location=location.abovebar, style=shape.triangledown, size=size.small, color=color.red)
plotshape(showImpulse and impulseWaveSell, title="Impulsive Sell", location=location.abovebar, style=shape.labeldown, size=size.tiny, color=color.maroon, text="IS")
// === خطوط الصفقة ===
var line buyLines = array.new_line(0)
var line sellLines = array.new_line(0)
if (showBuy)
entry = close
label.new(bar_index, entry, "Entry " + str.tostring(entry, format.mintick), style=label.style_label_left, textcolor=color.white, size=size.normal)
tpLevels = array.from(0.618, 1.0, 1.272, 1.618, 2.0)
for i = 0 to array.size(tpLevels) - 1
fib = array.get(tpLevels, i)
tp = entry + fib * atr
fibLabel = "TP" + str.tostring(i + 1) + " - Fib " + str.tostring(fib)
line = line.new(bar_index, tp, bar_index + lineLen, tp, color=color.green)
label.new(bar_index + lineLen, tp, fibLabel + " " + str.tostring(tp, format.mintick), style=label.style_label_right, textcolor=color.lime, size=size.normal)
array.push(buyLines, line)
sl = entry - 0.618 * atr
slLine = line.new(bar_index, sl, bar_index + lineLen, sl, color=color.red)
label.new(bar_index + lineLen, sl, "SL " + str.tostring(sl, format.mintick), style=label.style_label_right, textcolor=color.red, size=size.normal)
array.push(buyLines, slLine)
if (showSell)
entry = close
label.new(bar_index, entry, "Entry " + str.tostring(entry, format.mintick), style=label.style_label_left, textcolor=color.white, size=size.normal)
tpLevels = array.from(-0.618, -1.0, -1.272, -1.618, -2.0)
for i = 0 to array.size(tpLevels) - 1
fib = array.get(tpLevels, i)
tp = entry + fib * atr
fibLabel = "TP" + str.tostring(i + 1) + " - Fib " + str.tostring(math.abs(fib))
line = line.new(bar_index, tp, bar_index + lineLen, tp, color=color.green)
label.new(bar_index + lineLen, tp, fibLabel + " " + str.tostring(tp, format.mintick), style=label.style_label_right, textcolor=color.green, size=size.normal)
array.push(sellLines, line)
sl = entry + 0.618 * atr
slLine = line.new(bar_index, sl, bar_index + lineLen, sl, color=color.red)
label.new(bar_index + lineLen, sl, "SL " + str.tostring(sl, format.mintick), style=label.style_label_right, textcolor=color.red, size=size.normal)
array.push(sellLines, slLine)
400 EMA 1min and 5min Collision Alert//@version=5
indicator("400 EMA 1min and 5min Collision Alert", overlay=true)
// === Inputs ===
len = input.int(400, title="EMA Length")
threshold = input.float(0.1, title="Collision Threshold", tooltip="Max difference between EMAs to trigger alert")
// === EMAs ===
// 400 EMA on 1-minute timeframe
ema_1min = request.security(syminfo.tickerid, "1", ta.ema(close, len))
// 400 EMA on 5-minute timeframe
ema_5min = request.security(syminfo.tickerid, "5", ta.ema(close, len))
// === Plot EMAs ===
plot(ema_1min, title="400 EMA (1min)", color=color.orange, linewidth=2)
plot(ema_5min, title="400 EMA (5min)", color=color.blue, linewidth=2)
// === Collision Detection ===
collide = math.abs(ema_1min - ema_5min) <= threshold
plotshape(collide, title="Collision!", location=location.abovebar, color=color.red, style=shape.triangleup, size=size.small)
// === Alerts ===
alertcondition(collide, title="EMAs Collide", message="400 EMA (1min) and 400 EMA (5min) have collided.")
Days Since ±1% Move on CloseInterpretation & Use‑Case
The “Days Since ±1% Move” indicator simply tells you how many trading days have passed since the last daily close that moved at least 1% in either direction. Here’s how to put it to work:
Complacency Gauge
A long stretch without a ≥1% move often signals that realized volatility has collapsed and market participants may be under‑positioned for a sudden swing.
Positioning Insight
When institutional hedges and systematic strategies see low recent volatility, they tend to scale back protection (fewer options hedges, tighter risk limits), which can amplify the impact of any eventual volatility pickup.
Mean‑Reversion Signal
After an extended streak (e.g. 20–30 days), a fresh ≥1% move is more likely—and often more violent—because pent‑up positioning flows rush to adjust.
Trend Confirmation
Conversely, a reset in the count (i.e., a new ≥1% move) that coincides with strong volume and follow‑through suggests genuine directional conviction rather than just a volatility “blip.”
MR.Z Strategy Reversal Signal Nadaraya SMA)Nadaraya-Watson Envelope (NW Envelope):
A smoothed, non-linear dynamic envelope that adapts to price structure. It visually identifies price extremes using kernel regression. The upper and lower bands move with the chart and provide reliable dynamic support and resistance.
EMA Levels:
Includes three key exponential moving averages:
EMA 50 (short-term trend)
EMA 100 (medium-term)
EMA 200 (long-term, institutional level)
Fully Scrollable and Responsive:
All lines and envelopes are plotted using plot() so they move with the chart and respond to zoom and pan actions naturally.
🧠 Ideal Use:
Identify reversal zones, dynamic support/resistance, and trend momentum exhaustion.
Combine WTB and NW Envelope for confluence-based entries.
Use EMA structure for trend confirmation or breakout anticipation.
Let me know if you'd like to add:
Divergence detection
Buy/Sell signals
Alerts or signal filtering options
I’ll be happy to extend the description or the script accordingly!
PRO Investing - Apex EnginePRO Investing - Apex Engine
1. Core Concept: Why Does This Indicator Exist?
Traditional momentum oscillators like RSI or Stochastic use a fixed "lookback period" (e.g., 14). This creates a fundamental problem: a 14-period setting that works well in a fast, trending market will generate constant false signals in a slow, choppy market, and vice-versa. The market's character is dynamic, but most tools are static.
The Apex Engine was built to solve this problem. Its primary innovation is a self-optimizing core that continuously adapts to changing market conditions. Instead of relying on one fixed setting, it actively tests three different momentum profiles (Fast, Mid, and Slow) in real-time and selects the one that is most synchronized with the current price action.
This is not just a random combination of indicators; it's a deliberate synthesis designed to create a more robust momentum tool. It combines:
Volatility analysis (ATR) to generate adaptive lookback periods.
Momentum measurement (ROC) to gauge the speed of price changes.
Statistical analysis (Correlation) to validate which momentum measurement is most effective right now.
Classic trend filters (Moving Average, ADX) to ensure signals are only taken in favorable market conditions.
The result is an oscillator that aims to be more responsive in volatile trends and more stable in quiet periods, providing a more intelligent and adaptive signal.
2. How It Works: The Engine's Three-Stage Process
To be transparent, it's important to understand the step-by-step logic the indicator follows on every bar. It's a process of Adapt -> Validate -> Signal.
Stage 1: Adapt (Dynamic Length Calculation)
The engine first measures market volatility using the Average True Range (ATR) relative to its own long-term average. This creates a volatility_factor. In high-volatility environments, this factor causes the base calculation lengths to shorten. In low-volatility, they lengthen. This produces three potential Rate of Change (ROC) lengths: dynamic_fast_len, dynamic_mid_len, and dynamic_slow_len.
Stage 2: Validate (Self-Optimizing Mode Selection)
This is the core of the engine. It calculates the ROC for all three dynamic lengths. To determine which is best, it uses the ta.correlation() function to measure how well each ROC's movement has correlated with the actual bar-to-bar price changes over the "Optimization Lookback" period. The ROC length with the highest correlation score is chosen as the most effective profile for the current moment. This "active" mode is reflected in the oscillator's color and the dashboard.
Stage 3: Signal (Normalized Velocity Oscillator)
The winning ROC series is then normalized into a consistent oscillator (the Velocity line) that ranges from -100 (extreme oversold) to +100 (extreme overbought). This ensures signals are comparable across any asset or timeframe. Signals are only generated when this Velocity line crosses its signal line and the trend filters (explained below) give a green light.
3. How to Use the Indicator: A Practical Guide
Reading the Visuals:
Velocity Line (Blue/Yellow/Pink): The main oscillator line. Its color indicates which mode is active (Fast, Mid, or Slow).
Signal Line (White): A moving average of the Velocity line. Crossovers generate potential signals.
Buy/Sell Triangles (▲ / ▼): These are your primary entry signals. They are intentionally strict and only appear when momentum, trend, and price action align.
Background Color (Green/Red/Gray): This is your trend context.
Green: Bullish trend confirmed (e.g., price above a rising 200 EMA and ADX > 20). Only Buy signals (▲) can appear.
Red: Bearish trend confirmed. Only Sell signals (▼) can appear.
Gray: No clear trend. The market is likely choppy or consolidating. No signals will appear; it is best to stay out.
Trading Strategy Example:
Wait for a colored background. A green or red background indicates the market is in a tradable trend.
Look for a signal. For a green background, wait for a lime Buy triangle (▲) to appear.
Confirm the trade. Before entering, confirm the signal aligns with your own analysis (e.g., support/resistance levels, chart patterns).
Manage the trade. Set a stop-loss according to your risk management rules. An exit can be considered on a fixed target, a trailing stop, or when an opposing signal appears.
4. Settings and Customization
This script is open-source, and its settings are transparent. You are encouraged to understand them.
Synaptic Engine Group:
Volatility Period: The master control for the adaptive engine. Higher values are slower and more stable.
Optimization Lookback: How many bars to use for the correlation check.
Switch Sensitivity: A buffer to prevent frantic switching between modes.
Advanced Configuration & Filters Group:
Price Source: The data source for momentum calculation (default close).
Trend Filter MA Type & Length: Define your long-term trend.
Filter by MA Slope: A key feature. If ON, allows for "buy the dip" entries below a rising MA. If OFF, it's stricter, requiring price to be above the MA.
ADX Length & Threshold: Filters out non-trending, choppy markets. Signals will not fire if the ADX is below this threshold.
5. Important Disclaimer
This indicator is a decision-support tool for discretionary traders, not an automated trading system or financial advice. Past performance is not indicative of future results. All trading involves substantial risk. You should always use proper risk management, including setting stop-losses, and never risk more than you are prepared to lose. The signals generated by this script should be used as one component of a broader trading plan.