PaddingThe Padding library is a comprehensive and flexible toolkit designed to extend time series data within TradingView, making it an indispensable resource for advanced signal processing tasks such as FFT, filtering, convolution, and wavelet analysis. At its core, the library addresses the common challenge of edge effects by "padding" your data—that is, by appending additional data points beyond the natural boundaries of your original dataset. This extension not only mitigates the distortions that can occur at the endpoints but also helps to maintain the integrity of various transformations and calculations performed on the series. The library accomplishes this while preserving the ordering of your data, ensuring that the most recent point always resides at index 0.
Central to the functionality of this library are two key enumerations: Direction and PaddingType. The Direction enum determines where the padding will be applied. You can choose to extend the data in the forward direction (ahead of the current values), in the backward direction (behind the current values), or in both directions simultaneously. The PaddingType enum defines the specific method used for extending the data. The library supports several methods—including symmetric, reflect, periodic, antisymmetric, antireflect, smooth, constant, and zero padding—each of which has been implemented to suit different analytical scenarios. For instance, symmetric padding mirrors the original data across its boundaries, while reflect padding continues the trend by reflecting around endpoint values. Periodic padding repeats the data, and antisymmetric padding mirrors the data with alternating signs to counterbalance it. The antireflect and smooth methods take into account the derivatives of your data, thereby extending the series in a way that preserves or smoothly continues these derivative values. Constant and zero padding simply extend the series using fixed endpoint values or zeros. Together, these enums allow you to fine-tune how your data is extended, ensuring that the padding method aligns with the specific requirements of your analysis.
The library is designed to work with both single variable inputs and array inputs. When using array-based methods—particularly with the antireflect and smooth padding types—please note that the implementation intentionally discards the last data point as a result of the delta computation process. This behavior is an important consideration when integrating the library into your TradingView studies, as it affects the overall data length of the padded series. Despite this, the library’s structure and documentation make it straightforward to incorporate into your existing scripts. You simply provide your data source, define the length of your data window, and select the desired padding type and direction, along with any optional parameters to control the extent of the padding (using both_period, forward_period, or backward_period).
In practical application, the Padding library enables you to extend historical data beyond its original range in a controlled and predictable manner. This is particularly useful when preparing datasets for further signal processing, as it helps to reduce artifacts that can otherwise compromise the results of your analytical routines. Whether you are an experienced Pine Script developer or a trader exploring advanced data analysis techniques, this library offers a robust solution that enhances the reliability and accuracy of your studies by ensuring your algorithms operate on a more complete and well-prepared dataset.
Library "Padding"
A comprehensive library for padding time series data with various methods. Supports both single variable and array inputs, with flexible padding directions and periods. Designed for signal processing applications including FFT, filtering, convolution, and wavelets. All methods maintain data ordering with most recent point at index 0.
symmetric(source, series_length, direction, both_period, forward_period, backward_period)
Applies symmetric padding by mirroring the input data across boundaries
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with symmetric padding applied
method symmetric(source, direction, both_period, forward_period, backward_period)
Applies symmetric padding to an array by mirroring the data across boundaries
Namespace types: array
Parameters:
source (array) : Array of values to pad
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to array length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to array length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with symmetric padding applied
reflect(source, series_length, direction, both_period, forward_period, backward_period)
Applies reflect padding by continuing trends through reflection around endpoint values
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with reflect padding applied
method reflect(source, direction, both_period, forward_period, backward_period)
Applies reflect padding to an array by continuing trends through reflection around endpoint values
Namespace types: array
Parameters:
source (array) : Array of values to pad
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to array length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to array length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with reflect padding applied
periodic(source, series_length, direction, both_period, forward_period, backward_period)
Applies periodic padding by repeating the input data
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with periodic padding applied
method periodic(source, direction, both_period, forward_period, backward_period)
Applies periodic padding to an array by repeating the data
Namespace types: array
Parameters:
source (array) : Array of values to pad
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to array length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to array length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with periodic padding applied
antisymmetric(source, series_length, direction, both_period, forward_period, backward_period)
Applies antisymmetric padding by mirroring data and alternating signs
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with antisymmetric padding applied
method antisymmetric(source, direction, both_period, forward_period, backward_period)
Applies antisymmetric padding to an array by mirroring data and alternating signs
Namespace types: array
Parameters:
source (array) : Array of values to pad
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to array length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to array length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with antisymmetric padding applied
antireflect(source, series_length, direction, both_period, forward_period, backward_period)
Applies antireflect padding by reflecting around endpoints while preserving derivatives
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with antireflect padding applied
method antireflect(source, direction, both_period, forward_period, backward_period)
Applies antireflect padding to an array by reflecting around endpoints while preserving derivatives
Namespace types: array
Parameters:
source (array) : Array of values to pad
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to array length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to array length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with antireflect padding applied. Note: Last data point is lost when using array input
smooth(source, series_length, direction, both_period, forward_period, backward_period)
Applies smooth padding by extending with constant derivatives from endpoints
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with smooth padding applied
method smooth(source, direction, both_period, forward_period, backward_period)
Applies smooth padding to an array by extending with constant derivatives from endpoints
Namespace types: array
Parameters:
source (array) : Array of values to pad
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to array length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to array length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with smooth padding applied. Note: Last data point is lost when using array input
constant(source, series_length, direction, both_period, forward_period, backward_period)
Applies constant padding by extending endpoint values
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with constant padding applied
method constant(source, direction, both_period, forward_period, backward_period)
Applies constant padding to an array by extending endpoint values
Namespace types: array
Parameters:
source (array) : Array of values to pad
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to array length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to array length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with constant padding applied
zero(source, series_length, direction, both_period, forward_period, backward_period)
Applies zero padding by extending with zeros
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with zero padding applied
method zero(source, direction, both_period, forward_period, backward_period)
Applies zero padding to an array by extending with zeros
Namespace types: array
Parameters:
source (array) : Array of values to pad
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to array length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to array length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with zero padding applied
pad_data(source, series_length, padding_type, direction, both_period, forward_period, backward_period)
Generic padding function that applies specified padding type to input data
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
padding_type (series PaddingType) : Type of padding to apply (see PaddingType enum)
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with specified padding applied
method pad_data(source, padding_type, direction, both_period, forward_period, backward_period)
Generic padding function that applies specified padding type to array input
Namespace types: array
Parameters:
source (array) : Array of values to pad
padding_type (series PaddingType) : Type of padding to apply (see PaddingType enum)
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to array length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to array length if not specified
Returns: Array ordered with most recent point at index 0, containing original data with specified padding applied. Note: Last data point is lost when using antireflect or smooth padding types
make_padded_data(source, series_length, padding_type, direction, both_period, forward_period, backward_period)
Creates a window-based padded data series that updates with each new value. WARNING: Function must be called on every bar for consistency. Do not use in scopes where it may not execute on every bar.
Parameters:
source (float) : Input value to pad from
series_length (int) : Length of the data window
padding_type (series PaddingType) : Type of padding to apply (see PaddingType enum)
direction (series Direction) : Direction to apply padding
both_period (int) : Optional - periods to pad in both directions. Overrides forward_period and backward_period if specified
forward_period (int) : Optional - periods to pad forward. Defaults to series_length if not specified
backward_period (int) : Optional - periods to pad backward. Defaults to series_length if not specified
Returns: Array ordered with most recent point at index 0, containing windowed data with specified padding applied
Indicators and strategies
Major moving AveragesA combination of major moving averages both simple and exponential with cross signals on 2 of the SMAs and EMAs, great for assessing trend direction and strength at a glance.
Entering a position for continuation from a retracement to one of the longer period averages can offer a great R:R and win rate, using this in combination with a traditional oscillator such as RSI or MFI can further increase the effectiveness.
Best for use on higher timeframes (4H and above)
Default settings:
Period:
200 SMA, 50 SMA 20SMA (Bollinger band center), 7SMA
200 EMA, 50 EMA, 21EMA, 10EMA
Visual:
Lighter = larger period Darker = smaller period
7 SMA = thin white 10 EMA = thin yellow
Thick = SMA Thin = EMA
Whale Supertrend (V1.2)The script "Whale Supertrend (V1.2)" is an advanced trend indicator that uses multiple Supertrends with different factors to determine entry and exit points in the market. The Supertrend is a popular indicator that combines price and volatility to help identify trend direction. The script displays buy and sell signals based on the confluence of Supertrends.
How the script works
Configuring Supertrends
The script configures six Supertrends with different factors (factor, factor1, factor2, factor3, factor4, factor5) while using the same ATR period (atrPeriod = 10).
Supertrend 1: factor = 3
Supertrend 2: factor1 = 4
Supertrend 3: factor2 = 6
Supertrend 4: factor3 = 9
Supertrend 5: factor4 = 13
Supertrend 6: factor5 = 18
For each Supertrend, the bullish (blue) and bearish (purple) trend conditions are plotted on the chart.
Signal Calculation
The script calculates the number of Supertrends in bullish and bearish trend:
bullishCount: Number of Supertrends indicating a bullish trend.
bearishCount: Number of Supertrends indicating a bearish trend.
Signal Detection
The script triggers a buy or sell signal when at least three of the six Supertrends indicate the same trend:
Buy Signal (buySignal): Triggers when bullishCount is greater than or equal to 3.
Sell Signal (sellSignal): Triggers when bearishCount is greater than or equal to 3.
To avoid repetition, signals are only displayed when the state changes:
triggerBuy: Buy signal only when buySignal becomes true for the first time.
triggerSell: Sell signal only when sellSignal becomes true for the first time.
Candle Coloring:
Candles now change color based on signals:
Green: When a Buy Signal is active.
Red: When a Sell Signal is active.
This provides a clearer visualization of market trends directly on the chart.
Dynamic Settings for Supertrends:
You can customize the ATR Period and Factor for each of the 6 Supertrends via the settings panel.
Each Supertrend has independent parameters:
ATR Period: Controls the ATR calculation period.
Factor: Adjusts the Supertrend sensitivity.
Benefits:
Enhanced Readability: Candle colors help identify buy and sell zones at a glance.
Greater Customization: Tailor Supertrend settings to your trading strategy or market conditions.
Kess EMA MagicKess EMA Magic - Indicator Description
The Kess EMA Magic indicator is a powerful tool designed to enhance trend analysis by plotting four key Exponential Moving Averages (EMAs): 8, 21, 50, and 200. These EMAs help traders identify short-term, medium-term, and long-term trends with clarity.
- 8 EMA (Blue): Represents short-term price movement, often used for quick trend shifts.
- 21 EMA (Purple): Acts as a dynamic support/resistance level and a key trend-following indicator.
- 50 EMA (Orange): A widely-used medium-term trend filter, helping traders confirm trend strength.
- 200 EMA (Red): A crucial long-term trend indicator, often defining bullish or bearish market conditions.
This indicator is ideal for traders looking to refine their trend-following strategies by visually identifying confluence zones where multiple EMAs interact. By integrating the Kess EMA Magic, users can improve their market timing, optimize trade entries/exits, and gain deeper insights into price momentum. 🚀
Nifty 1-Min Advanced Scalping - 9Nifty 1-Min Advanced Scalping
Best Indicators for Nifty 1-Min Scalping 🔥
1️⃣ VWAP (Volume Weighted Average Price)
Acts as an intraday support/resistance.
Above VWAP → Buy Bias 📈
Below VWAP → Sell Bias 📉
Best Used For: Trend confirmation & re-entry after pullbacks.
2️⃣ SuperTrend (10, 2) for Trend Confirmation
Green SuperTrend → Uptrend (Look for Buy)
Red SuperTrend → Downtrend (Look for Sell)
Works well with VWAP for high-probability trades.
3️⃣ EMA 20 (Exponential Moving Average)
Fast-moving trend filter.
Price above EMA 20 → Bullish momentum
Price below EMA 20 → Bearish momentum
Best Used For: Entry confirmation & trend alignment.
4️⃣ RSI (Relative Strength Index, 14)
Avoids false entries in choppy markets.
Above 50 → Uptrend Bias
Below 50 → Downtrend Bias
Best Used For: Filtering weak trades.
5️⃣ ATR (Average True Range, 14)
Measures market volatility.
Use 1.5x ATR for Stop-Loss placement.
Best Used For: Setting SL dynamically.
6️⃣ Parabolic SAR
Confirms trend direction.
Dots below price → Uptrend (Buy)
Dots above price → Downtrend (Sell)
Best Used For: Trade confirmation & early exits.
7️⃣ Bollinger Bands (20, 2)
Identifies volatility expansion.
Buy when price bounces off the lower band.
Sell when price rejects the upper band.
Best Used For: Scalping breakouts & reversals.
8️⃣ Pivot Points
Key support & resistance levels.
Look for breakouts near R1/R2 or S1/S2.
Best Used For: Setting Take-Profit targets.
📌 Ideal Scalping Strategy for 1-Min Nifty Trading
✅ Buy Setup:
Price above VWAP & EMA 20.
SuperTrend is Green.
RSI > 50 (Avoid overbought levels > 80).
Price above Mid Bollinger Band.
Parabolic SAR dots below price.
🎯 Take Profit: Exit near Pivot Levels or 1.5x ATR
🛑 Stop Loss: Below recent swing low or 1.5x ATR.
❌ Sell Setup:
Price below VWAP & EMA 20.
SuperTrend is Red.
RSI < 50 (Avoid oversold < 20).
Price below Mid Bollinger Band.
Parabolic SAR dots above price.
🎯 Take Profit: Exit near Pivot Levels or 1.5x ATR.
🛑 Stop Loss: Above recent swing high or 1.5x ATR.
⏰ Best Time for Nifty 1-Min Scalping
9:15 AM - 10:30 AM → High Volatility (Best for breakouts).
2:30 PM - 3:15 PM → Momentum moves before market close.
Avoid 12:30 PM - 1:30 PM (low liquidity).
Simple Market Metrics v5// ***************************************** ATTENTION ************************************************
//
// These metrics are not to be reproduced, copied, or distributed to anyone besides the original owner.
// Doing so is in direct violation of Simple Market Metrics policies, and penalties will apply.
//
// simplemarketmetrics.gumroad.com
//
// ****************************************************************************************************
//@version=5
indicator("Simple Market Metrics v5", max_lines_count=500, max_labels_count=500, behind_chart=false) // SMM v5
// ________ Rules and FAQ text ___________________________
var const string titleRules = "***** Simple Market Metrics Trading Rules *****"
var const string signalRules = " 1. How to enter a trade: • Wait for a Buy or Sell signal to appear"
var const string entryRules = " • If the signal remains when the candle closes, enter the trade with a market or limit order"
var const string tpRules = " 2. How to exit a trade: • Take profit when the price reaches the profit target line"
var const string exitRules = " • Stop out of the trade if the white dot remains on the opposite side of the profit wave only when the candle has closed."
var const string exitExample = " e.g. If you are in a long trade, and a candle closes with the white dot below the profit wave, close the trade."
var const string tradingRules = titleRules + signalRules + entryRules + tpRules + exitRules + exitExample
var const string faq = "--------| Frequently Asked Questions |--------"
var const string faq1 = " 1. What markets can this be traded with? • Simple Market Metrics works with any market, but the ES & NQ Futures are the preferred markets to trade this system with."
var const string faq2 = " 2. What candle type should be used? • Simple Market Metrics was designed to be used on Heikin Ashi candles."
var const string faq3 = " 3. What are the preferred trading hours? • The preferred hours to trade are during the New York session between 10:00am EST and 3:00pm EST."
var const string faq4 = " 4. What timeframe should I trade? • The 1 and 2 minute timeframes are preferred with ES & NQ Futures"
var const string faq5 = " 5. What should I set the profit targets to? • ES - 1 min: 4 • ES - 2 min: 8 • NQ - 1 min: 20 • NQ - 2 min: 40"
var const string faq6 = " 6. How many contracts should I start trading with prop firm accounts? • 50k - 5 micros on MES or MNQ • 150k - 2 minis on ES or NQ"
var const string faqText = faq + faq1 + faq2 + faq3 + faq4 + faq5 + faq6
var const string finalNotes = "Some final notes: The Simple Market Metrics trading system has been built specifically for trading the ES & NQ Futures markets, with the goal of small but consistent daily profits."
var const string finalNotes1 = " Although you may trade any market and timeframe you wish, it is up to you to determine the best settings for other markets and timeframes."
var const string finalNotes2 = " Trading is risky, do not trade with money you are not comfortable losing. Control your risk by managing your position size accordingly, and please practice on a sim account before using real money."
var const string finalNotes3 = " If you need further assistance, contact us at simplemarketmetrics@gmail.com"
var const string notesText = finalNotes + finalNotes1 + finalNotes2 + finalNotes3
// ________ All Inputs Here ___________________________
var const string startHereGroup = "------------------> START HERE <------------------"
rulesCheck = input.bool(false, title="Please Read The Trading Rules ----->", group=startHereGroup, tooltip=tradingRules)
faqCheck = input.bool(false, title="Frequently Asked Questions ------->", group=startHereGroup, tooltip=faqText)
notesCheck = input.bool(false, title="Final Notes & Contact Info --------->", group=startHereGroup, tooltip=notesText)
var bool disableWarning = false
//Signals Inputs
var signalsGroupName = '----- Signal Settings -----'
enableBuySellSignals = input.bool(true,title='Enable Buy & Sell Signals', group=signalsGroupName)
startHour = input.int(9, title="Start Time (HH:mm)", minval=0, maxval=23, group=signalsGroupName, inline="startTime")
startMinute = input.int(0, title=":", minval=0, maxval=59, group=signalsGroupName, inline="startTime", tooltip="This time is based on timezone of the exchange, NOT the timezone your chart is set to. So please adjust accordingly. e.g. The exchange for NQ & ES are in the Central Timezone.")
endHour = input.int(11, title="End Time (HH:mm)", minval=0, maxval=23, group=signalsGroupName, inline="endTime")
endMinute = input.int(0, title=":", minval=0, maxval=59, group=signalsGroupName, inline="endTime")
buySignalColor = input.color(color.new(#4caf50, 0),'Buy Signal Color', group=signalsGroupName)
sellSignalColor = input.color(color.new(#b22833, 0), 'Sell Signal Color', group=signalsGroupName)
enableBuySellPrice = input.bool(true,title='Enable Buy & Sell Price', group=signalsGroupName)
enableChopFilter = input.bool(true, title='Enable Chop Filter', group=signalsGroupName, tooltip='This helps to reduce signals during choppy markets, and will produce less signals overall when enabled.')
enableMaFilter = input.bool(true, 'Enable MA Filter',group=signalsGroupName)
maFilterType = input.string("EMA","MA Filter Type", options = ,group=signalsGroupName)
maFilterLength = input.int(200, 'MA Filter Period', minval=1,group=signalsGroupName)
maFilterColor = input.color(color.new(color.white, 0), 'MA Filter Color', group=signalsGroupName)
// Profit Inputs
var profitWaveGroupName = '----- Profit Settings -----'
enableProfitLines = input.bool(true, title='Enable Profit Target Lines', group=profitWaveGroupName)
profitTarget = input.int(20, title='Profit Target (Ticks/Pips/Cents)', group=profitWaveGroupName, tooltip='Profit target value is based on the minimum move of the instrument. For Futures that is ticks, FX is pips, Stocks are cents, etc.')
profitTargetMaxLines = input.int(10, title='Max Profit Target Lines', group=profitWaveGroupName, tooltip='Maximum amount of profit target lines to display on your chart.')
profitTargetColor = input.color(color.new(color.yellow, 0),'Profit Target Lines Color', group=profitWaveGroupName)
enableProfitWave = input.bool(true, "Enable Profit Wave", group=profitWaveGroupName)
profitWaveUpperBullishColor = input.color(color.new(#00ff8480, 50),'Profit Wave Bullish Top Color', group=profitWaveGroupName)
profitWaveLowerBullishColor = input.color(color.new(color.green, 50), 'Profit Wave Bullish Bottom Color', group=profitWaveGroupName)
profitWaveLowerBearishColor = input.color(color.new(#8c0000, 50), 'Profit Wave Bearish Top Color', group=profitWaveGroupName)
profitWaveUpperBearishColor = input.color(color.new(#ff0000, 50),'Profit Wave Bearish Bottom Color', group=profitWaveGroupName)
// Background Trend Inputs
var backgroundTrendGroupName = '----- Background Trend Settings -----'
enableBgColor = input.bool(true, "Enable Background Trend Color", group=backgroundTrendGroupName)
bgTrendBullishCol = input.color(color.new(#66ff00, 70),'Bullish Background Color', group=backgroundTrendGroupName)
bgTrendBearishCol = input.color(color.new(#ff0000, 70), 'Bearish Background Color', group=backgroundTrendGroupName)
// Candle Coloring Inputs
var candleSettings = "----- Candle Settings -----"
bullishCandleColor = input.color(color.new(#089981, 0),'Bullish Candle Color', group=candleSettings)
bearishCandleColor = input.color(color.new(#f23645, 0), 'Bearish Candle Color', group=candleSettings)
enableTrendCandleColoring = input.bool(true,title='Enable Candle Color Matching', group=candleSettings)
candleColoringType = input.string("Profit Wave",title='Match Candle Colors To', options= , group=candleSettings)
// Support / Resistance Inputs
var sdGroupName = '----- Support & Resistance Settings -----'
ensr = input.bool(true,title='Enable Support & Resistance Lines', group=sdGroupName)
resistanceColor = input.color(#ff0000,'Resistance Lines Color', group=sdGroupName)
supportColor = input.color(#66ff00,'Support Lines Color', group=sdGroupName)
srStyle = input.string("Dotted", options= , title="Support & Resistance Lines Style", group=sdGroupName)
srLineWidth = input.int(2, "Support & Resistance Lines Width", minval=1, maxval=5, step=1, group=sdGroupName)
extendLinesType = input.string('Close', title='Extend Lines Until', options= , group=sdGroupName, tooltip='Extend the lines until price touches them or a candle closes beyond them.')
pivotchopSensitivity = 20
maxSrLines = 50
// Real Price Inputs
var rplGroupName = '----- Real Price Settings -----'
showrealprice = input(false, title="Enable Real Price Line", group=rplGroupName)
extendLine = input(false, title="Extend Real Price Line", group=rplGroupName)
showrealpricelinecolor = input(color.new(color.white, 0), title="Real Price Line Color", group=rplGroupName)
realpricewidth = input.string("Thin", options= , title="Real Price Line Width", group=rplGroupName)
realpricestyle = input.string("Dotted", options= , title="Real Price Line Style", group=rplGroupName)
plotrealsrcClosedots = input.bool(true, title="Enable Real Close Price Dots", group=rplGroupName)
realsrcClosecolour = input(color.new(color.white, 0), title="Real Close Price Dot Color", group=rplGroupName)
size = input.string("Small", options= , title="Real Close Price Dot Size", group=rplGroupName)
// Matrix Inputs
var matrixGroupName = '----- Matrix Settings -----'
var matrixInlineName = "matrixInlineName"
matrixStyle = input.string("Horizontal", "Layout Style", options= , group=matrixGroupName)
matrixPosition = input.string("Bottom Right", "Location On Chart", options= , group=matrixGroupName)
matrixTimeframeColor = input.color(color.purple,'Timeframe Cell Color', group=matrixGroupName, inline="matrixTimeframeColors")
matrixTimeframeTextColor = input.color(color.white,'Text Color', group=matrixGroupName, inline="matrixTimeframeColors")
enableMatrixTF1 = input.bool(true, "Enable Matrix Timeframe 1", group=matrixGroupName, inline="matrixRow1")
matrixTF1 = input.timeframe("1", "", group=matrixGroupName, inline="matrixRow1")
enableMatrixTF2 = input.bool(true, "Enable Matrix Timeframe 2", group=matrixGroupName, inline="matrixRow2")
matrixTF2 = input.timeframe("2", "", group=matrixGroupName, inline="matrixRow2")
enableMatrixTF3 = input.bool(true, "Enable Matrix Timeframe 3", group=matrixGroupName, inline="matrixRow3")
matrixTF3 = input.timeframe("5", "", group=matrixGroupName, inline="matrixRow3")
matrixColumn1 = input.bool(true, "Show Avg True Range (ATR)", group=matrixGroupName)
matrixAtrLength = input.int(defval=3, minval=1, title="Avg True Range (ATR) Length", group=matrixGroupName)
matrixAtrColor = input.color(color.blue,'ATR Cell Color', group=matrixGroupName, inline="matrixAtrColors")
matrixAtrTextColor = input.color(color.white,'Text Color', group=matrixGroupName, inline="matrixAtrColors")
matrixColumn2 = input.bool(true, "Show Current Candle Column", group=matrixGroupName)
matrixColumn3 = input.bool(true, "Show Trend Column", group=matrixGroupName)
matrixColumn4 = input.bool(true, "Show Profit Wave Column", group=matrixGroupName)
matrixColumn5 = input.bool(true, "Show Money Flow Column", group=matrixGroupName)
matrixHeaderColor = input.color(color.black,'Header Cell Color', group=matrixGroupName, inline="matrixHeaderColors")
matrixHeaderTextColor = input.color(color.white,'Text Color', group=matrixGroupName, inline="matrixHeaderColors")
matrixBullishColor = input.color(color.green,'Bullish Cell Color', group=matrixGroupName, inline="matrixBullishColors")
matrixBullishTextColor = input.color(color.white,'Text Color', group=matrixGroupName, inline="matrixBullishColors")
matrixBearishColor = input.color(color.red,'Bearish Cell Color', group=matrixGroupName, inline="matrixBearishColors")
matrixBearishTextColor = input.color(color.white,'Text Color', group=matrixGroupName, inline="matrixBearishColors")
// Dashboard Inputs
var dashboardSettings = "----- Dashboard Settings -----"
positionMatrixOnTop = input.bool(true, "Show Matrix History Above Money Flow?", group=dashboardSettings)
enableMatrixDashboard1 = input.bool(true, "Enable Matrix History for Timeframe 1", group=dashboardSettings)
enableMatrixDashboard2 = input.bool(true, "Enable Matrix History for Timeframe 2", group=dashboardSettings)
enableMatrixDashboard3 = input.bool(true, "Enable Matrix History for Timeframe 3", group=dashboardSettings)
enableMatrixDashboardLabels = input.bool(true, "Enable Matrix Timeframe Labels", group=dashboardSettings)
enableDashboard = input.bool(true, "Enable Money Flow Display", group=dashboardSettings)
enableDashboardBuySellSignals = input.bool(false,title='Enable Buy & Sell Signals on Dashboard', group=dashboardSettings)
showInsideLines = input.bool(false, "Enable Level Lines", group=dashboardSettings)
levelLinesStyle = input.string("Solid", options= , title="Level Lines Style", group=dashboardSettings)
trendDotsSize = input.int(1, "trendSwitch Dots Size", minval=1, maxval=10, step=1, group=dashboardSettings)
crossoverDotsSize = input.int(3, "Signal Dots Size", minval=3, maxval=10, step=1, group=dashboardSettings)
mfiBullishColor = input.color(color.lime,'Money Flow Bullish Color', group=dashboardSettings)
mfiBearishColor = input.color(color.red,'Money Flow Bearish Color', group=dashboardSettings)
// Others
disableWarning := input.bool(false, title="Disable Heikin Ashi Warning", group="Other Settings")
// ----------------------------------------------------------------------------------------------------------------------------------
startTime = timestamp(year, month, dayofmonth, startHour, startMinute)
endTime = timestamp(year, month, dayofmonth, endHour, endMinute)
isValidTimeRange = (time >= startTime and time < endTime)
// ________ Price & Candle Logic ___________________________
var isHAChartType = chart.is_heikinashi
var label myLabel = na
labelDisplayed = false
var const string warningText = " ⚠️ WARNING!!! ⚠️ You MUST set the chart candle type to Heikin Ashi for the signals to display correctly. This message will disappear when you've done so. "
if not isHAChartType and not disableWarning and not labelDisplayed
enableBgColor := false
enableBuySellSignals := false
enableProfitLines := false
enableTrendCandleColoring := false
enableProfitWave := false
ensr := false
// plotrealsrcClosedots := false
middle_price = (high + low) / 2
visible_bar_count = bar_index - ta.valuewhen(time == chart.left_visible_bar_time, bar_index, 0)
middle_bar_index = bar_index
if na(myLabel)
myLabel := label.new(x=middle_bar_index, y=middle_price, text=warningText, xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_center, color=color.red, textcolor=color.white, size=size.huge, textalign=text.align_center, force_overlay=true)
else
myLabel.set_x(middle_bar_index)
myLabel.set_y(middle_price)
labelDisplayed := true
else if isHAChartType or disableWarning
myLabel := na
srcHlc3 = hlc3
srcOpen = open
srcHigh = high
srcLow = low
srcClose = close
real_price = ticker.new(prefix=syminfo.prefix, ticker=syminfo.ticker)
real_close = request.security(symbol=real_price, timeframe='', expression=close, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_off)
profitWaveEmaFast = ta.ema(srcClose, 8)
profitWaveEmaMedium = ta.ema(srcClose, 13)
profitWaveEmaSlow = ta.ema(srcClose, 21)
chopSensitivity = 1
trueRange = math.max(math.max(high-low, math.abs(high-nz(close ))), math.abs(low-nz(close )))
diPlusCalculation = high-nz(high ) > nz(low )-low ? math.max(high-nz(high ), 0): 0
diMinusCalculation = nz(low )-low > high-nz(high ) ? math.max(nz(low )-low, 0): 0
smoothedTrueRange = 0.0
smoothedTrueRange := nz(smoothedTrueRange ) - (nz(smoothedTrueRange )/chopSensitivity) + trueRange
smoothedDiPlus = 0.0
smoothedDiPlus := nz(smoothedDiPlus ) - (nz(smoothedDiPlus )/chopSensitivity) + diPlusCalculation
smoothedDiMinus = 0.0
smoothedDiMinus := nz(smoothedDiMinus ) - (nz(smoothedDiMinus )/chopSensitivity) + diMinusCalculation
diPlus = smoothedDiPlus / smoothedTrueRange * 100
diMinus = smoothedDiMinus / smoothedTrueRange * 100
dx = math.abs(diPlus-diMinus) / (diPlus+diMinus)*100
ADX = ta.sma(dx, chopSensitivity)
GetTrendDirection(srcHigh, srcLow) =>
Up = (srcHigh + srcLow) / 2 - (1.3 * ta.atr(8))
Dn = (srcHigh + srcLow) / 2 + (1.3 * ta.atr(8))
float trendUp = na
float trendDown = na
trendSwitch = 0
trendUp := srcClose > trendUp ? math.max(Up,trendUp ) : Up
trendDown := srcClose < trendDown ? math.min(Dn,trendDown ) : Dn
trendSwitch := srcClose > trendDown ? 1: srcClose < trendUp ? -1: nz(trendSwitch ,1)
trendDirection = trendSwitch == 1 ? trendUp : trendDown
= GetTrendDirection(srcHigh, srcLow)
bullishTrend = trendDirection == trendUp
bearishTrend = trendDirection == trendDown
maFilter = switch maFilterType
"EMA" => ta.ema(srcClose, maFilterLength)
"SMA" => ta.sma(srcClose, maFilterLength)
"VWMA" => ta.vwma(srcClose, maFilterLength)
"RMA" => ta.rma(srcClose, maFilterLength)
"Hull" => ta.wma(2*ta.wma(srcClose, maFilterLength/2)-ta.wma(srcClose, maFilterLength), math.floor(math.sqrt(maFilterLength)))
=> na
plot(enableMaFilter ? maFilter : na, force_overlay=true, title = "Filter MA", color=maFilterColor, linewidth=2)
// ________ Background Trend Logic ___________________________
backgroundTrendColor = color.white
if (trendDirection == trendUp)
backgroundTrendColor := bgTrendBullishCol
else if (trendDirection == trendDown)
backgroundTrendColor := bgTrendBearishCol
else
backgroundTrendColor := backgroundTrendColor
bgcolor(enableBgColor ? backgroundTrendColor : na, force_overlay = true)
// Base Candle coloring
candleColor = color.gray
candleColor := if (srcClose > srcOpen)
bullishCandleColor
else if (srcClose < srcOpen)
bearishCandleColor
else
candleColor
if (enableTrendCandleColoring and candleColoringType == "Trend")
candleColor := if (backgroundTrendColor == bgTrendBullishCol)
bullishCandleColor
else if (backgroundTrendColor == bgTrendBearishCol)
bearishCandleColor
else
candleColor
else if (enableTrendCandleColoring and candleColoringType == "Profit Wave")
candleColor := if (real_close > profitWaveEmaSlow)
bullishCandleColor
else if (real_close < profitWaveEmaSlow)
bearishCandleColor
else
candleColor
plotcandle(srcOpen, srcHigh, srcLow, srcClose, "SMM Candles", color=candleColor, wickcolor=candleColor, bordercolor=candleColor, force_overlay=true)
// ________ Signals Logic ___________________________
var bool buySignal = false
var bool sellSignal = false
buySignal := trendDirection == trendUp
sellSignal := trendDirection == trendDown
mfl = ta.mfi(srcHlc3, 10)
enum Mode
buy = "Buy Mode"
sell = "Sell Mode"
none = "none"
var Mode currentMode = Mode.none
if (backgroundTrendColor != backgroundTrendColor )
currentMode := Mode.none
strongBullishCandle = srcClose > srcOpen and math.floor(srcOpen) == math.floor(srcLow) and real_close > profitWaveEmaFast and real_close > profitWaveEmaSlow
strongBearishCandle = srcClose < srcOpen and math.floor(srcOpen) == math.floor(srcHigh) and real_close < profitWaveEmaFast and real_close < profitWaveEmaSlow
realClosePriceText = enableBuySellPrice ? " $" + str.tostring(real_close, format.mintick) : ""
bool canBuy = true
bool canSell = true
if (enableChopFilter)
canBuy := math.floor(diPlus) > math.floor(diMinus) and math.floor(diPlus) >= 45
canSell := math.floor(diMinus) > math.floor(diPlus) and math.floor(diMinus) >= 45
else
canBuy := true
canSell := true
var int currentSignalBarIndex = na
// Bullish signals
maFilterBuy = enableMaFilter ? srcOpen > maFilter : true
mfiBuy = enableChopFilter ? mfl > 52 : true
buy_con = buySignal and backgroundTrendColor == bgTrendBullishCol and strongBullishCandle and currentMode != Mode.buy and mfiBuy and canBuy
if (buy_con and enableBuySellSignals)
currentMode := Mode.buy
if isValidTimeRange and maFilterBuy
label.new(bar_index, low, style=label.style_label_up, color=buySignalColor, size=size.normal, yloc=yloc.belowbar, text="Buy"+realClosePriceText, textcolor=color.white, force_overlay=true)
currentSignalBarIndex := bar_index
// Bearish signals
maFilterSell = enableMaFilter ? srcOpen < maFilter : true
mfiSell = enableChopFilter ? mfl < 52 : true
sell_con = sellSignal and backgroundTrendColor == bgTrendBearishCol and strongBearishCandle and currentMode != Mode.sell and mfiSell and canSell
if (sell_con and enableBuySellSignals)
currentMode := Mode.sell
if isValidTimeRange and maFilterSell
label.new(bar_index, high, style=label.style_label_down, color=sellSignalColor, size=size.normal, yloc=yloc.abovebar, text="Sell"+realClosePriceText, textcolor=color.white, force_overlay=true)
currentSignalBarIndex := bar_index
// Profit Target lines
var line targetLines = array.new_line(0)
var label targetLabels = array.new_label(0)
var float targetPrice = na
if (((buy_con and maFilterBuy) or (sell_con and maFilterSell)) and enableBuySellSignals and enableProfitLines)
if array.size(targetLines) >= profitTargetMaxLines
oldestLine = array.get(targetLines, 0)
oldestLabel = array.get(targetLabels, 0)
line.delete(oldestLine)
label.delete(oldestLabel)
array.remove(targetLines, 0)
array.remove(targetLabels, 0)
targetPrice := buy_con ? real_close + (profitTarget * syminfo.mintick) : sell_con ? real_close - (profitTarget * syminfo.mintick) : na
if isValidTimeRange
newLine = line.new(bar_index-7, targetPrice, bar_index + 5, targetPrice, color=profitTargetColor, width=2, force_overlay=true)
array.push(targetLines, newLine)
newLabel = label.new(bar_index-3, targetPrice, text="$"+str.tostring(targetPrice, format.mintick), style=label.style_none, textcolor=profitTargetColor, force_overlay=true)
array.push(targetLabels, newLabel)
// Reset for more signals within continuous trend
if (currentMode == Mode.buy and real_close < profitWaveEmaSlow and srcClose < profitWaveEmaSlow)
currentMode := Mode.none
currentSignalBarIndex := na
if (currentMode == Mode.sell and real_close > profitWaveEmaSlow and srcClose > profitWaveEmaSlow)
currentMode := Mode.none
currentSignalBarIndex := na
profitTargetCondition = if not na(currentSignalBarIndex) and bar_index > currentSignalBarIndex
currentMode == Mode.buy ? srcHigh >= targetPrice : currentMode == Mode.sell ? srcLow <= targetPrice : na
// Signal Alerts
alertcondition(condition=buy_con and canBuy,title='Buy alert', message='Buy')
alertcondition(condition=sell_con and canSell,title='Sell alert', message='Sell')
alertcondition(condition=enableBuySellSignals and enableProfitLines ? profitTargetCondition : na, title="Profit Target", message="Profit Target Hit!")
if profitTargetCondition
targetPrice := na
currentSignalBarIndex := na
// ________ Profit Wave Logic ___________________________
pwPlot1 = plot(enableProfitWave ? profitWaveEmaFast : na, title="Profit Wave Line 1", color=color.new(color.white, 100), linewidth=1, force_overlay = true)
pwPlot2 = plot(enableProfitWave ? profitWaveEmaMedium : na, title="Profit Wave Line 2", color=color.new(color.white, 100), linewidth=1, force_overlay = true)
pwPlot3 = plot(enableProfitWave ? profitWaveEmaSlow : na, title="Profit Wave Line 3", color=color.new(color.white, 100), linewidth=1, force_overlay = true)
pwUpperBullishColor = real_close > profitWaveEmaSlow ? profitWaveUpperBullishColor : color.new(color.lime, 100)
pwLowerBullishColor = real_close > profitWaveEmaSlow ? profitWaveLowerBullishColor : color.new(color.green, 100)
fill(pwPlot1, pwPlot2, pwUpperBullishColor)
fill(pwPlot2, pwPlot3, pwLowerBullishColor)
pwUpperBearishColor = real_close < profitWaveEmaSlow ? profitWaveUpperBearishColor : color.new(#ff0000, 100)
pwLowerBearishColor = real_close < profitWaveEmaSlow ? profitWaveLowerBearishColor : color.new(#8c0000, 100)
fill(pwPlot1, pwPlot2, pwUpperBearishColor)
fill(pwPlot2, pwPlot3, pwLowerBearishColor)
// ________ Support / Resistance Logic ___________________________
srLineStyle = switch srStyle
"Solid" => line.style_solid
"Dotted" => line.style_dotted
"Dashed" => line.style_dashed
// Identify pivot highs and pivot lows
pivotHigh = ta.pivothigh(srcHigh, pivotchopSensitivity, pivotchopSensitivity)
pivotLow = ta.pivotlow(srcLow, pivotchopSensitivity, pivotchopSensitivity)
// Initialize arrays to store the lines
var line resistanceLines = array.new_line(0)
var line supportLines = array.new_line(0)
var int resistanceTouchBars = array.new_int(0)
var int supportTouchBars = array.new_int(0)
lookbackchopSensitivity = 500
// Function to manage line limits (removing the oldest line if limit is exceeded)
f_manage_line_limit(array linesArray, array touchBarsArray) =>
if array.size(linesArray) > maxSrLines
// Delete the first (oldest) line
line.delete(array.shift(linesArray))
// Remove the first touch bar value
array.shift(touchBarsArray)
// Draw new resistance line if a new pivot high is detected
if (ensr and not na(pivotHigh) and bar_index >= bar_index - lookbackchopSensitivity)
pivotHighPrice = srcHigh
pivotHighBar = bar_index
resistanceLine = line.new(pivotHighBar, pivotHighPrice, bar_index + 1, pivotHighPrice, style=srLineStyle, width=srLineWidth, color=resistanceColor, extend=extend.right, force_overlay=true)
array.push(resistanceLines, resistanceLine)
array.push(resistanceTouchBars, na) // No touch yet
f_manage_line_limit(resistanceLines, resistanceTouchBars) // Manage the line limit
// Draw new support line if a new pivot low is detected
if (ensr and not na(pivotLow) and bar_index >= bar_index - lookbackchopSensitivity)
pivotLowPrice = srcLow
pivotLowBar = bar_index
supportLine = line.new(pivotLowBar, pivotLowPrice, bar_index + 1, pivotLowPrice, style=srLineStyle, width=srLineWidth, color=supportColor, extend=extend.right, force_overlay=true)
array.push(supportLines, supportLine)
array.push(supportTouchBars, na) // No touch yet
f_manage_line_limit(supportLines, supportTouchBars) // Manage the line limit
// Loop through the resistance lines and stop their extension if the price touches them
if array.size(resistanceLines) > 0
resLineStop = extendLinesType == 'Close' ? srcClose : srcHigh
for i = 0 to array.size(resistanceLines) - 1
line currentResistanceLine = array.get(resistanceLines, i)
resistancePrice = line.get_y1(currentResistanceLine)
touchBar = array.get(resistanceTouchBars, i)
// Update the line to the current candle unless already touched
if na(touchBar)
line.set_x2(currentResistanceLine, bar_index)
line.set_extend(currentResistanceLine, extend.none)
// Check if the price touches the resistance and we haven't already stopped the line
if na(touchBar) and resLineStop >= resistancePrice
line.set_x2(currentResistanceLine, bar_index)
line.set_extend(currentResistanceLine, extend.none)
array.set(resistanceTouchBars, i, bar_index) // Store the bar where the price touched
// Loop through the support lines and stop their extension if the price touches them
if array.size(supportLines) > 0
supLineStop = extendLinesType == 'Close' ? srcClose : srcLow
for i = 0 to array.size(supportLines) - 1
line currentSupportLine = array.get(supportLines, i)
supportPrice = line.get_y1(currentSupportLine)
touchBar = array.get(supportTouchBars, i)
// Update the line to the current candle unless already touched
if na(touchBar)
line.set_x2(currentSupportLine, bar_index)
line.set_extend(currentSupportLine, extend.none)
// Check if the price touches the support and we haven't already stopped the line
if na(touchBar) and supLineStop <= supportPrice
line.set_x2(currentSupportLine, bar_index)
line.set_extend(currentSupportLine, extend.none)
array.set(supportTouchBars, i, bar_index) // Store the bar where the price touched
// ________ Real Price Logic ___________________________Original open source code from Real Price + Dots by PHVNTOM_TRADER
showrealpricemicrodotsauto = (plotrealsrcClosedots and size=="Auto" ? display.all : display.none)
showrealpricemicrodotssmall = (plotrealsrcClosedots and size=="Small" ? display.all : display.none)
showrealpricedotslarge = (plotrealsrcClosedots and size=="Large" ? display.all : display.none)
_width = switch realpricewidth
"Thin" => 1
"Thick" => 2
// Real Price Line
if(showrealprice and (realpricestyle == "Solid"))
real_price_line = line.new(bar_index , real_close, bar_index, real_close, xloc.bar_index, (extendLine ? extend.both : extend.right), showrealpricelinecolor, line.style_solid, _width, force_overlay = true)
line.delete(real_price_line )
if(showrealprice and (realpricestyle == "Dotted"))
real_price_line = line.new(bar_index , real_close, bar_index, real_close, xloc.bar_index, (extendLine ? extend.both : extend.right), showrealpricelinecolor, line.style_dotted, _width, force_overlay = true)
line.delete(real_price_line )
if(showrealprice and (realpricestyle == "Dashed"))
real_price_line = line.new(bar_index , real_close, bar_index, real_close, xloc.bar_index, (extendLine ? extend.both : extend.right), showrealpricelinecolor, line.style_dashed, _width, force_overlay = true)
line.delete(real_price_line )
// Real Price srcClose Dots
plotchar(series=real_close, title="Real Close dots", location=location.absolute, color=realsrcClosecolour, editable=false, char="•", size=size.auto, display=showrealpricemicrodotsauto, force_overlay = true)
plotchar(series=real_close, title="Real Close dots", location=location.absolute, color=realsrcClosecolour, editable=false, char="•", size=size.tiny, display=showrealpricemicrodotssmall, force_overlay = true)
plotshape(series=real_close, title="Real Close dots", location=location.absolute, color=realsrcClosecolour, editable=false, style=shape.circle, size=size.auto, display=showrealpricedotslarge, force_overlay = true)
// ________ Dashboard Oscillator Logic ___________________________
hlineStyle = switch levelLinesStyle
"Dotted" => hline.style_dotted
"Dashed" => hline.style_dashed
=> hline.style_solid
top_1 = hline(enableDashboard ? 100 : na,color=color.new(#ff1b1b,50),linestyle=hline.style_solid)
top_2 = hline(enableDashboard ? 90 : na,color=color.new(#ff2626,50),linestyle=hline.style_solid)
top_3 = hline(enableDashboard ? 80 : na,color=color.new(#ff3f3f,50),linestyle=hline.style_solid)
top_4 = hline(showInsideLines and enableDashboard ? 70 : na,color=color.new(#ff5050,50),linestyle=hlineStyle)
top_5 = hline(showInsideLines and enableDashboard ? 60 : na,color=color.new(#ff6464,50),linestyle=hlineStyle)
top_6 = hline(showInsideLines and enableDashboard ? 50 : na,color=color.new(#ff6464,100),linestyle=hlineStyle)
bottom_1 = hline(enableDashboard ? 0 : na,color=color.new(#047200,50),linestyle=hline.style_solid)
bottom_2 = hline(enableDashboard ? 10 : na,color=color.new(#047e00,50),linestyle=hline.style_solid)
bottom_3 = hline(enableDashboard ? 20 : na,color=color.new(#048900,50),linestyle=hline.style_solid)
bottom_4 = hline(showInsideLines and enableDashboard ? 30 : na,color=color.new(#059f00,50),linestyle=hlineStyle)
bottom_5 = hline(showInsideLines and enableDashboard ? 40 : na,color=color.new(#06b200,50),linestyle=hlineStyle)
bottom_6 = hline(showInsideLines and enableDashboard ? 50 : na,color=color.new(#06b200,100),linestyle=hlineStyle)
fill(top_1, top_2, color=color.new(#ff1b1b,20), title="Overbought Extreme Background")
fill(top_2, top_3, color=color.new(#ff2626,40), title="Overbought Start Background")
fill(bottom_1, bottom_2, color=color.new(#047200,10), title="Oversold Start Background")
fill(bottom_3, bottom_2, color=color.new(#047e00,40), title="Oversold Extreme Background")
dotsColor = bullishTrend ? #66ff00 : #ff0000
plot(enableDashboard ? 50 : na,color=dotsColor,style= plot.style_circles, title="Dashboard Center Line trendSwitch Dots", linewidth=trendDotsSize)
plotDashboardBuy = buy_con and enableDashboardBuySellSignals and canBuy and isValidTimeRange and maFilterBuy
plotDashboardSell = sell_con and enableDashboardBuySellSignals and canSell and isValidTimeRange and maFilterSell
plotshape(plotDashboardBuy and enableDashboard ? 10 : na,title='Dashboard Buy Signal',style=shape.labelup,location=location.absolute,text='Buy',textcolor=color.white,color=buySignalColor)
plotshape(plotDashboardSell and enableDashboard ? 90 : na,title='Dashboard Sell Signal',style=shape.labeldown,location=location.absolute,text='Sell',textcolor=color.white,color=sellSignalColor)
mfiTrendColor = if (mfl > 50)
mfiBullishColor
else if (mfl < 50)
mfiBearishColor
else
color.white
plot(enableDashboard ? mfl : na, "Dashboard Money Flow Line", color=mfiTrendColor, style=plot.style_stepline)
plot(plotDashboardBuy and enableDashboard ? 50 : na, color=#66ff00, style=plot.style_circles,linewidth=crossoverDotsSize,title='Dashboard Crossover Up Dots')
plot(plotDashboardSell and enableDashboard ? 50 : na, color=#ff0000, style=plot.style_circles,linewidth=crossoverDotsSize,title='Dashboard Crossover Down Dots')
// ________ Matrix Data Table Logic ___________________________
getMatrixRealClose(ticker, timeframe) =>
request.security(ticker, timeframe, close, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_off)
getMatrixTrendData(timeframe) =>
= request.security(syminfo.tickerid, timeframe, GetTrendDirection(srcHigh, srcLow))
mBackgroundTrendColor = color.gray
mTrendTextColor = color.white
mTrendStatus = ""
if (mTrendDirection == mTrendUp)
mBackgroundTrendColor := matrixBullishColor
mTrendTextColor := matrixBullishTextColor
mTrendStatus := "Bullish"
else if (mTrendDirection == mTrendDown)
mBackgroundTrendColor := matrixBearishColor
mTrendTextColor := matrixBearishTextColor
mTrendStatus := "Bearish"
else
mBackgroundTrendColor := mBackgroundTrendColor
mTrendTextColor := mTrendTextColor
mTrendStatus := mTrendStatus
getMatrixProfitWaveData(timeframe, realClose) =>
mProfitWaveEmaSlow = request.security(syminfo.tickerid, timeframe, ta.ema(srcClose, 21))
mProfitWaveColor = color.gray
mProfitWaveTextColor = color.white
mProfitWaveStatus = ""
if realClose > mProfitWaveEmaSlow
mProfitWaveColor := color.new(matrixBullishColor,0)
mProfitWaveTextColor := matrixBullishTextColor
mProfitWaveStatus := "Bullish"
else if realClose < mProfitWaveEmaSlow
mProfitWaveColor := color.new(matrixBearishColor,0)
mProfitWaveTextColor := matrixBearishTextColor
mProfitWaveStatus := "Bearish"
else
mProfitWaveColor := mProfitWaveColor
mProfitWaveTextColor := mProfitWaveTextColor
mProfitWaveStatus := mProfitWaveStatus
getMatrixCandleData(timeframe, trendStatus, profitWaveStatus) =>
= request.security(syminfo.tickerid, timeframe, )
mCandleColor = color.gray
mCandleStatus = ""
if (mClose > mOpen)
mCandleColor := matrixBullishColor
mCandleStatus := "↑"
else if (mClose < mOpen)
mCandleColor := matrixBearishColor
mCandleStatus := "↓"
else
mCandleColor := mCandleColor
mCandleStatus := mCandleStatus
if (enableTrendCandleColoring and candleColoringType == "Trend")
if (trendStatus == "Bullish")
mCandleColor := matrixBullishColor
mCandleStatus := "↑"
else if (trendStatus == "Bearish")
mCandleColor := matrixBearishColor
mCandleStatus := "↓"
else
mCandleColor := mCandleColor
mCandleStatus := mCandleStatus
else if (enableTrendCandleColoring and candleColoringType == "Profit Wave")
if (profitWaveStatus == "Bullish")
mCandleColor := matrixBullishColor
mCandleStatus := "↑"
else if (profitWaveStatus == "Bearish")
mCandleColor := matrixBearishColor
mCandleStatus := "↓"
else
mCandleColor := mCandleColor
mCandleStatus := mCandleStatus
getMatrixMfiData(timeframe) =>
mMfi = request.security(syminfo.tickerid, timeframe, ta.mfi(srcHlc3, 10))
mMfiColor = color.gray
mMfiTextColor = color.white
mMfiStatus = ""
if (mMfi > 50)
mMfiColor := matrixBullishColor
mMfiTextColor := matrixBullishTextColor
mMfiStatus := "Bullish"
else if (mMfi < 50)
mMfiColor := matrixBearishColor
mMfiTextColor := matrixBearishTextColor
mMfiStatus := "Bearish"
else
mMfiColor := mMfiColor
mMfiTextColor := mMfiTextColor
mMfiStatus := mMfiStatus
getMatrixAtr(timeframe) =>
atrValue = request.security(syminfo.tickerid, timeframe, ta.atr(matrixAtrLength))
str.tostring(atrValue, "#.#")
getMatrixHeaderCol(col) =>
matrixStyle == "Vertical" ? 0 : col
getMatrixHeaderRow(row) =>
matrixStyle == "Vertical" ? row : 0
getMatrixTfCol(col) =>
matrixStyle == "Vertical" ? col : 0
getMatrixTfRow(tf, row) =>
matrixStyle == "Vertical" ? row : tf
getMatrixDataCol(tf, col) =>
matrixStyle == "Vertical" ? tf : col
getMatrixDataRow(tf, row) =>
matrixStyle == "Vertical" ? row : tf
m1RealClose = getMatrixRealClose(real_price, matrixTF1)
= getMatrixTrendData(matrixTF1)
= getMatrixProfitWaveData(matrixTF1, m1RealClose)
= getMatrixMfiData(matrixTF1)
m2RealClose = getMatrixRealClose(real_price, matrixTF2)
= getMatrixTrendData(matrixTF2)
= getMatrixProfitWaveData(matrixTF2, m2RealClose)
= getMatrixMfiData(matrixTF2)
m3RealClose = getMatrixRealClose(real_price, matrixTF3)
= getMatrixTrendData(matrixTF3)
= getMatrixProfitWaveData(matrixTF3, m3RealClose)
= getMatrixMfiData(matrixTF3)
if enableMatrixTF1 or enableMatrixTF2 or enableMatrixTF3
tablePosition = switch matrixPosition
"Top Left" => position.top_left
"Top Center" => position.top_center
"Top Right" => position.top_right
"Bottom Left" => position.bottom_left
"Bottom Center" => position.bottom_center
=> position.bottom_right
var columns = 6
var rows = 4
if matrixStyle == "Vertical"
columns := 4
rows := 6
var table matrixDataTable = table.new(position=tablePosition, columns=columns, rows=rows, frame_color=color.gray, frame_width=1, border_width=1, bgcolor=color.new(color.gray, 0), force_overlay=true)
table.cell(matrixDataTable, 0, 0, text="TimeFrame", text_color=matrixHeaderTextColor, bgcolor=matrixHeaderColor)
if matrixColumn1
atrText = "ATR(" + str.tostring(matrixAtrLength) + ")"
table.cell(matrixDataTable, getMatrixHeaderCol(1), getMatrixHeaderRow(1), text=atrText, text_color=matrixHeaderTextColor, bgcolor=matrixHeaderColor)
if matrixColumn2
table.cell(matrixDataTable, getMatrixHeaderCol(2), getMatrixHeaderRow(2), text="Candle", text_color=matrixHeaderTextColor, bgcolor=matrixHeaderColor)
if matrixColumn3
table.cell(matrixDataTable, getMatrixHeaderCol(3), getMatrixHeaderRow(3), text="Background", text_color=matrixHeaderTextColor, bgcolor=matrixHeaderColor)
if matrixColumn4
table.cell(matrixDataTable, getMatrixHeaderCol(4), getMatrixHeaderRow(4), text="Profit Wave", text_color=matrixHeaderTextColor, bgcolor=matrixHeaderColor)
if matrixColumn5
table.cell(matrixDataTable, getMatrixHeaderCol(5), getMatrixHeaderRow(5), text="Money Flow", text_color=matrixHeaderTextColor, bgcolor=matrixHeaderColor)
if enableMatrixTF1
m1Atr = getMatrixAtr(matrixTF1)
= getMatrixCandleData(matrixTF1, m1TrendStatus, m1ProfitWaveStatus)
table.cell(matrixDataTable, getMatrixTfCol(1), getMatrixTfRow(1, 0), text=matrixTF1, text_color=matrixTimeframeTextColor, bgcolor=matrixTimeframeColor)
if matrixColumn1
table.cell(matrixDataTable, getMatrixDataCol(1,1), getMatrixDataRow(1,1), text=m1Atr, text_color=matrixAtrTextColor, bgcolor=matrixAtrColor)
if matrixColumn2
table.cell(matrixDataTable, getMatrixDataCol(1,2), getMatrixDataRow(1,2), text=m1CandleStatus, text_color=color.white, bgcolor=m1CandleColor)
if matrixColumn3
table.cell(matrixDataTable, getMatrixDataCol(1,3), getMatrixDataRow(1,3), text=m1TrendStatus, text_color=m1TrendTextColor, bgcolor=color.new(m1BackgroundTrendColor,0))
if matrixColumn4
table.cell(matrixDataTable, getMatrixDataCol(1,4), getMatrixDataRow(1,4), text=m1ProfitWaveStatus, text_color=m1ProfitWaveTextColor, bgcolor=m1ProfitWaveColor)
if matrixColumn5
table.cell(matrixDataTable, getMatrixDataCol(1,5), getMatrixDataRow(1,5), text=m1MfiStatus, text_color=m1MfiTextColor, bgcolor=m1MfiColor)
if enableMatrixTF2
m2Atr = getMatrixAtr(matrixTF2)
= getMatrixCandleData(matrixTF2, m2TrendStatus, m2ProfitWaveStatus)
table.cell(matrixDataTable, getMatrixTfCol(2), getMatrixTfRow(2, 0), text=matrixTF2, text_color=matrixTimeframeTextColor, bgcolor=matrixTimeframeColor)
if matrixColumn1
table.cell(matrixDataTable, getMatrixDataCol(2,1), getMatrixDataRow(2,1), text=m2Atr, text_color=matrixAtrTextColor, bgcolor=matrixAtrColor)
if matrixColumn2
table.cell(matrixDataTable, getMatrixDataCol(2,2), getMatrixDataRow(2,2), text=m2CandleStatus, text_color=color.white, bgcolor=m2CandleColor)
if matrixColumn3
table.cell(matrixDataTable, getMatrixDataCol(2,3), getMatrixDataRow(2,3), text=m2TrendStatus, text_color=m2TrendTextColor, bgcolor=color.new(m2BackgroundTrendColor,0))
if matrixColumn4
table.cell(matrixDataTable, getMatrixDataCol(2,4), getMatrixDataRow(2,4), text=m2ProfitWaveStatus, text_color=m2ProfitWaveTextColor, bgcolor=m2ProfitWaveColor)
if matrixColumn5
table.cell(matrixDataTable, getMatrixDataCol(2,5), getMatrixDataRow(2,5), text=m2MfiStatus, text_color=m2MfiTextColor, bgcolor=m2MfiColor)
if enableMatrixTF3
m3Atr = getMatrixAtr(matrixTF3)
= getMatrixCandleData(matrixTF3, m3TrendStatus, m3ProfitWaveStatus)
table.cell(matrixDataTable, getMatrixTfCol(3), getMatrixTfRow(3, 0), text=matrixTF3, text_color=matrixTimeframeTextColor, bgcolor=matrixTimeframeColor)
if matrixColumn1
table.cell(matrixDataTable, getMatrixDataCol(3,1), getMatrixDataRow(3,1), text=m3Atr, text_color=matrixAtrTextColor, bgcolor=matrixAtrColor)
if matrixColumn2
table.cell(matrixDataTable, getMatrixDataCol(3,2), getMatrixDataRow(3,2), text=m3CandleStatus, text_color=color.white, bgcolor=m3CandleColor)
if matrixColumn3
table.cell(matrixDataTable, getMatrixDataCol(3,3), getMatrixDataRow(3,3), text=m3TrendStatus, text_color=m3TrendTextColor, bgcolor=color.new(m3BackgroundTrendColor,0))
if matrixColumn4
table.cell(matrixDataTable, getMatrixDataCol(3,4), getMatrixDataRow(3,4), text=m3ProfitWaveStatus, text_color=m3ProfitWaveTextColor, bgcolor=m3ProfitWaveColor)
if matrixColumn5
table.cell(matrixDataTable, getMatrixDataCol(3,5), getMatrixDataRow(3,5), text=m3MfiStatus, text_color=m3MfiTextColor, bgcolor=m3MfiColor)
lw_plots = 4
plotStyle = plot.style_stepline
var int md1Trend = enableMatrixDashboard1 ? -10 : 0
var int md1Profit = enableMatrixDashboard1 ? -15 : 0
var int md1Mfi = enableMatrixDashboard1 ? -20 : 0
var int md2Trend = enableMatrixDashboard2 ? md1Mfi - 10 : md1Trend
var int md2Profit = enableMatrixDashboard2 ? md2Trend - 5 : md1Profit
var int md2Mfi = enableMatrixDashboard2 ? md2Profit - 5 : md1Mfi
var int md3Trend = enableMatrixDashboard3 ? md2Mfi - 10 : 0
var int md3Profit = enableMatrixDashboard3 ? md3Trend - 5 : 0
var int md3Mfi = enableMatrixDashboard3 ? md3Profit - 5 : 0
if positionMatrixOnTop
md1Trend := enableMatrixDashboard1 ? md1Profit + 5 : 100
md1Profit := enableMatrixDashboard1 ? md1Mfi + 5 : 100
md1Mfi := enableMatrixDashboard1 ? md2Trend + 10 : 100
md2Trend := enableMatrixDashboard2 ? md2Profit + 5 : md3Trend
md2Profit := enableMatrixDashboard2 ? md2Mfi + 5 : md3Profit
md2Mfi := enableMatrixDashboard2 ? md3Trend + 10 : md3Mfi
md3Trend := enableMatrixDashboard3 ? 120 : 100
md3Profit := enableMatrixDashboard3 ? 115 : 100
md3Mfi := enableMatrixDashboard3 ? 110 : 100
var label md1TrendLabel = na
var label md1ProfitLabel = na
var label md1MfiLabel = na
var label md2TrendLabel = na
var label md2ProfitLabel = na
var label md2MfiLabel = na
var label md3TrendLabel = na
var label md3ProfitLabel = na
var label md3MfiLabel = na
if barstate.islast and enableMatrixDashboardLabels
if enableMatrixDashboard1 and na(md1TrendLabel)
md1TrendLabel := label.new(x=bar_index , y=md1Trend, text="Background - "+matrixTF1, style=label.style_label_left, textcolor=color.white, color=color.new(color.white, 100), size=size.tiny)
md1ProfitLabel := label.new(x=bar_index , y=md1Profit, text="Profit Wave - "+matrixTF1, style=label.style_label_left, textcolor=color.white, color=color.new(color.white, 100), size=size.tiny)
md1MfiLabel := label.new(x=bar_index , y=md1Mfi, text="Money Flow - "+matrixTF1, style=label.style_label_left, textcolor=color.white, color=color.new(color.white, 100), size=size.tiny)
else if enableMatrixDashboard1
label.set_x(md1TrendLabel, bar_index )
label.set_x(md1ProfitLabel, bar_index )
label.set_x(md1MfiLabel, bar_index )
if enableMatrixDashboard2 and na(md2TrendLabel)
md2TrendLabel := label.new(x=bar_index , y=md2Trend, text="Background - "+matrixTF2, style=label.style_label_left, textcolor=color.white, color=color.new(color.white, 100), size=size.tiny)
md2ProfitLabel := label.new(x=bar_index , y=md2Profit, text="Profit Wave - "+matrixTF2, style=label.style_label_left, textcolor=color.white, color=color.new(color.white, 100), size=size.tiny)
md2MfiLabel := label.new(x=bar_index , y=md2Mfi, text="Money Flow - "+matrixTF2, style=label.style_label_left, textcolor=color.white, color=color.new(color.white, 100), size=size.tiny)
else if enableMatrixDashboard2
label.set_x(md2TrendLabel, bar_index )
label.set_x(md2ProfitLabel, bar_index )
label.set_x(md2MfiLabel, bar_index )
if enableMatrixDashboard3 and na(md3TrendLabel)
md3TrendLabel := label.new(x=bar_index , y=md3Trend, text="Background - "+matrixTF3, style=label.style_label_left, textcolor=color.white, color=color.new(color.white, 100), size=size.tiny)
md3ProfitLabel := label.new(x=bar_index , y=md3Profit, text="Profit Wave - "+matrixTF3, style=label.style_label_left, textcolor=color.white, color=color.new(color.white, 100), size=size.tiny)
md3MfiLabel := label.new(x=bar_index , y=md3Mfi, text="Money Flow - "+matrixTF3, style=label.style_label_left, textcolor=color.white, color=color.new(color.white, 100), size=size.tiny)
else if enableMatrixDashboard3
label.set_x(md3TrendLabel, bar_index )
label.set_x(md3ProfitLabel, bar_index )
label.set_x(md3MfiLabel, bar_index )
else
label.delete(md1TrendLabel)
md1TrendLabel := na
label.delete(md1ProfitLabel)
md1ProfitLabel := na
label.delete(md1MfiLabel)
md1MfiLabel := na
label.delete(md2TrendLabel)
md2TrendLabel := na
label.delete(md2ProfitLabel)
md2ProfitLabel := na
label.delete(md2MfiLabel)
md2MfiLabel := na
label.delete(md3TrendLabel)
md3TrendLabel := na
label.delete(md3ProfitLabel)
md3ProfitLabel := na
label.delete(md3MfiLabel)
md3MfiLabel := na
plot(series=enableMatrixDashboard1 ? md1Trend : na, title="Trend", color=m1BackgroundTrendColor, linewidth=lw_plots, style=plotStyle, editable=false)
plot(series=enableMatrixDashboard1 ? md1Profit : na, title="Profit Wave", color=m1ProfitWaveColor, linewidth=lw_plots, style=plotStyle, editable=false)
plot(series=enableMatrixDashboard1 ? md1Mfi : na, title="MFI", color=m1MfiColor, linewidth=lw_plots, style=plotStyle, editable=false)
plot(series=enableMatrixDashboard2 ? md2Trend : na, title="Trend 2", color=m2BackgroundTrendColor, linewidth=lw_plots, style=plotStyle, editable=false)
plot(series=enableMatrixDashboard2 ? md2Profit : na, title="Profit Wave 2", color=m2ProfitWaveColor, linewidth=lw_plots, style=plotStyle, editable=false)
plot(series=enableMatrixDashboard2 ? md2Mfi : na, title="MFI 2", color=m2MfiColor, linewidth=lw_plots, style=plotStyle, editable=false)
plot(series=enableMatrixDashboard3 ? md3Trend : na, title="Trend 3", color=m3BackgroundTrendColor, linewidth=lw_plots, style=plotStyle, editable=false)
plot(series=enableMatrixDashboard3 ? md3Profit : na, title="Profit Wave 3", color=m3ProfitWaveColor, linewidth=lw_plots, style=plotStyle, editable=false)
plot(series=enableMatrixDashboard3 ? md3Mfi : na, title="MFI 3", color=m3MfiColor, linewidth=lw_plots, style=plotStyle, editable=false)
Customizable EMA By Rehan Khan This TradingView indicator plots four customizable Exponential Moving Averages (EMAs) to help traders identify trends and potential entry/exit points. Users can modify the period lengths for better adaptability to different trading strategies.
4 Adjustable EMAs – Customize the EMA periods (default: 20, 50, 100, and 200).
Trader’s Note for Risk Management – Displays humorous yet insightful trading advice to remind traders about the importance of stop-loss and capital protection.
Trend indicator, customizable EMA crossover | javieresfelizThis indicator is designed to help traders identify trend changes by crossing two exponential moving averages (EMAs). It is not an automated trading strategy nor does it generate buy/sell signals on its own; It is a complementary tool for technical analysis.
Characteristics
✅ Customizable EMA Crossover – Users can define the Fast EMA and Slow EMA periods to fit their strategy.
✅ Trend Identification – Visually shows if the price is in an up, down or neutral trend.
✅ Crossover Alerts – Optionally, traders can activate alerts when a bullish or bearish crossover occurs.
How does it work?
When the fast EMA crosses above the slow EMA, it is considered a possible bullish trend signal.
When the fast EMA crosses below the slow EMA, it may indicate a possible reversal to a downtrend.
Suggestions for using fast/slow EMA in different times:
1m - 5m: 9 EMA / 21 EMA
30m - 1h: 20 EMA / 50 EMA
4h: 50 EMA / 200 EMA
1D: 50 EMA / 200 EMA
1S: 21 EMA / 50 EMA
Limitations:
⚠️ This indicator does not guarantee profitability and must be used in conjunction with other analysis factors.
⚠️ It does not incorporate commissions, slippage or risk management, since it is not a backtesting strategy.
⚠️ It should not be interpreted as an investment recommendation.
This script is designed to improve visual interpretation of the market and facilitate informed decision making within technical analysis. 🚀📊
--------------------------------------------------------------------------------
Este indicador está diseñado para ayudar a los traders a identificar cambios de tendencia mediante el cruce de dos medias móviles exponenciales (EMA). No es una estrategia de trading automatizada ni genera señales de compra/venta por sí sola; es una herramienta complementaria para el análisis técnico.
Características
✅ Cruce de EMAs personalizable – Los usuarios pueden definir los períodos de la EMA rápida y la EMA lenta para ajustarse a su estrategia.
✅ Identificación de tendencias – Muestra visualmente si el precio se encuentra en una tendencia alcista, bajista o neutral.
✅ Alertas de cruce – Opcionalmente, los traders pueden activar alertas cuando ocurre un cruce alcista o bajista.
¿Cómo funciona?
Cuando la EMA rápida cruza por encima de la EMA lenta, se considera una posible señal de tendencia alcista.
Cuando la EMA rápida cruza por debajo de la EMA lenta, puede indicar un posible cambio a tendencia bajista.
Sugerencias de uso de EMA rapida/lenta en distintas temporalidades:
1m - 5m: 9 EMA / 21 EMA
30m - 1h: 20 EMA / 50 EMA
4h: 50 EMA / 200 EMA
1D: 50 EMA / 200 EMA
1S: 21 EMA / 50 EMA
Limitaciones:
⚠️ Este indicador no garantiza rentabilidad y debe utilizarse junto con otros factores de análisis.
⚠️ No incorpora comisiones, deslizamiento ni gestión de riesgo, ya que no es una estrategia de backtesting.
⚠️ No se debe interpretar como una recomendación de inversión.
Este script está diseñado para mejorar la interpretación visual del mercado y facilitar la toma de decisiones informadas dentro del análisis técnico. 🚀📊
NK trader Next candle predictionNK Trader Next Candle Prediction
this script predicts the next candle direction using trend candlestick patterns and valume it provides real time buy sell signals for small time frame suitable for binary and short term trading
Developed by NK trader
Waldo Momentum Cloud Bollinger Bands (WMCBB)
Title: Waldo Momentum Cloud Bollinger Bands (WMCBB)
Description:
Introducing the "Waldo Momentum Cloud Bollinger Bands (WMCBB)," an innovative trading tool crafted for those who aim to deepen their market analysis by merging two dynamic technical indicators: Dynamic RSI Bollinger Bands and the Waldo Cloud.
What is this Indicator?
WMCBB integrates the volatility-based traditional Bollinger Bands with a momentum-sensitive approach through the Relative Strength Index (RSI). Here’s how it works:
Dynamic RSI Bollinger Bands: These bands dynamically adjust according to the RSI, which tracks the momentum of price movements. By scaling the RSI to align with price levels, we generate bands that not only reflect market volatility but also the underlying momentum, offering a refined view of overbought and oversold conditions.
Waldo Cloud: This feature adds a layer of traditional Bollinger Bands, visualized as a 'cloud' on your chart. It employs standard Bollinger Band methodology but enhances it with additional moving average layers to better define market trends.
The cloud's color changes dynamically based on various market conditions, providing visual signals for trend direction and potential trend reversals.
Why Combine These Indicators?
Combining Dynamic RSI Bollinger Bands with the Waldo Cloud in WMCBB aims to:
Enhance Trend Identification: The Waldo Cloud's color-coded system aids in recognizing the overarching market trend, while the Dynamic RSI Bands give insights into momentum changes within that trend, offering a comprehensive view.
Improve Volatility and Momentum Analysis: While traditional Bollinger Bands measure market volatility, integrating RSI adds a layer of momentum analysis, potentially leading to more accurate trading signals.
Visual Clarity: The unified color scheme for both sets of bands, which changes according to RSI levels, moving average crossovers, and price positioning, simplifies the process of gauging market sentiment at a glance.
Customization: Users have the option to toggle the visibility of moving averages (MA) through the settings, allowing for tailored analysis based on individual trading strategies.
Usage:
Utilize WMCBB to identify potential trend shifts by observing price interactions with the dynamic bands or changes in the Waldo Cloud's color.
Watch for divergences between price movements and RSI to forecast potential market reversals or continuations.
This combination shines in sideways markets where traditional indicators might fall short, as it provides additional context through RSI momentum analysis.
Settings:
Customize parameters for both the Dynamic RSI and Waldo Cloud Bollinger Bands, including the calculation source, standard deviation factors, and moving average lengths.
WMCBB is perfect for traders seeking to enhance their market analysis through the synergy of momentum and volatility, all while maintaining visual simplicity. Trade with greater insight using the Waldo Momentum Cloud Bollinger Bands!
RSI Custom CloudsThis script enhances the standard RSI by adding moving average smoothing, visual cues (gradient fills), and optional divergence calculations, making it easier to spot potential trading opportunities based on RSI trends.
DMI and MACDاستخدام DMI و TSI في السكريبت:
🔹 DMI (Directional Movement Index): يساعد في تحديد قوة الاتجاه—كلما زادت الفجوة بين +DI و -DI، كان الاتجاه أقوى.
🔹 TSI (True Strength Index): يستخدم لقياس زخم السعر وتأكيد الاتجاهات، مما يساعد في تجنب الإشارات الوهمية.
📌 كيف يؤثران على الإشارات؟
✅ عند توافق DMI و TSI مع إشارات EMA، تزداد دقة إشارات الشراء والبيع.
❌ إذا كانا متعارضين، فقد يشير ذلك إلى ضعف الاتجاه أو احتمال انعكاس السعر.
Nearest EMA Levels (Multi-Timeframe)This indicator identifies the closest upper and lower EMA levels across multiple timeframes, helping traders spot trend direction and key support/resistance zones.
📌 Key Features:
✔ Multi-Timeframe Support: Works across 1min to 1W timeframes.
✔ Customizable EMAs:
1min & 5min: Only 200 EMA.
Other timeframes: 20, 50, 100, and 200 EMA.
✔ Auto Detection: Highlights the nearest EMA levels above and below price.
✔ Customizable Display: Adjustable line style, thickness, and colors.
✔ Clear Labels: Shows EMA value and timeframe for easy interpretation.
🛠 How to Use:
Enable preferred timeframes and adjust visual settings.
Nearest EMA levels are plotted automatically.
Labels indicate timeframe and EMA value.
⚠ Note:
For technical analysis only, not financial advice.
1M timeframe removed due to TradingView API limits.
Too many EMAs may clutter the chart—enable only needed timeframes.
🚀 Perfect for:
✔ Trend Identification
✔ Support & Resistance Analysis
✔ Short & Long-Term Market Tracking
VMA [Extreme Advanced Custom Table for BTCUSD]This indicator implements a Variable Moving Average (VMA) with a 33-period length—selected in homage to the Tesla 369 concept—to dynamically adjust to market conditions. It not only calculates the adaptive VMA but also displays a custom table of key metrics directly on the chart. Here’s how to use it:
Apply to Your Chart:
Add the indicator to your chart (optimized for BTCUSD, though it can be used on other symbols) and choose your desired source (e.g., close).
Customize Your Visuals:
Trend & Price Lines: Toggle the trend colors, price line, and bar coloring based on the VMA’s direction.
Channels & Slope: Enable the volatility channel and slope line to visualize market volatility and the VMA’s momentum.
Pivot Points & Super VMA: Activate pivot high/low markers for potential reversal points and a Super VMA (SMA of VMA) for an extra smoothing layer.
Table Customization: Adjust the table’s position, colors, and font sizes as needed for your viewing preference.
Monitor Key Metrics:
The dynamic table displays essential information:
VMA Value & Trend: See the current VMA and whether the trend is Bullish, Bearish, or Neutral.
Volatility Index (vI) & Slope: Quickly assess market volatility and the VMA’s slope (both absolute and percentage).
Price-VMA Difference & Correlation: Evaluate how far the price is from the VMA and its correlation.
Higher Timeframe VMA: Compare the current VMA with its higher timeframe counterpart (set via the “Higher Timeframe” input).
Alerts for Key Conditions:
Built-in alert conditions notify you when:
The trend changes (bullish/bearish).
The VMA slope becomes extreme.
The price and VMA correlation falls below a defined threshold.
The VMA crosses its higher timeframe average.
How to Use the Script:
Add to Your Chart:
Open TradingView and apply the indicator to your BTCUSD (or any other) chart.
The indicator will overlay on your chart, plotting the VMA along with optional elements such as the price line, volatility channels, and higher timeframe VMA.
Customize Your Settings:
Inputs:
Choose your data source (e.g., close price).
Adjust the VMA length (default is 33) if desired.
Visual Options:
Toggle trend colors, bar coloring, and additional visuals (price line, volatility channels, slope line, pivot points, and Super VMA) to suit your trading style.
Table Customization:
Set the table position, colors, border width, and font size to ensure key metrics are easily visible.
Higher Timeframe:
You can change the higher timeframe input (default is Daily) to better fit your analysis routine.
Interpret the Indicator:
Trend Analysis:
Watch the color-coded VMA line. A rising (orange) VMA suggests bullish momentum, while a falling (red) one indicates bearish conditions.
What Sets This Script Apart:
Dynamic Adaptation:
Unlike a fixed-period moving average, the VMA adjusts its sensitivity in real time by integrating a volatility measure, making it more adaptive to market swings.
Multi-Layered Analysis:
With integrated volatility channels, pivot points, slope analysis, and a higher timeframe VMA, this tool gives you a fuller picture of market dynamics.
Immediate Data at a Glance:
The real-time table consolidates multiple key metrics into one view, saving time and reducing the need for additional indicators.
Custom Alerts:
Pre-built alert conditions allow for timely notifications, ensuring you don’t miss critical market changes.
Custom Ichimoku (EMA + SMA)custom Ichimoku Cloud
13 EMA (Exponential Moving Average) as Tenkan-sen (Conversion Line) → Reacts quickly to price changes.
34 SMA (Simple Moving Average) as Kijun-sen (Base Line) → Smooths out trends for better confirmation.
Fibonacci numbers (13, 34) instead of 9 & 26 → Aligns better with natural market movements.
Buy Signal: 13 EMA crosses above 34 SMA.
Sell Signal: 13 EMA crosses below 34 SMA.
This makes it more responsive than the standard Ichimoku, better for crypto and fast-moving markets.
Bull and Bear V7 + SMA 35 bull and bear
Ideally made of Renko
Trend indicator with buy sell signals
with 35 filter
Happy trades to all
Sideways Scalper Peak and BottomUnderstanding the Indicator
This indicator is designed to identify potential peaks (tops) and bottoms (bottoms) within a market, which can be particularly useful in a sideways or range-bound market where price oscillates between support and resistance levels without a clear trend. Here's how it works:
RSI (Relative Strength Index): Measures the speed and change of price movements to identify overbought (above 70) and oversold (below 30) conditions. In a sideways market, RSI can help signal when the price might be due for a reversal within its range.
Moving Averages (MAs): The Fast MA and Slow MA provide a sense of the short-term and longer-term average price movements. In a sideways market, these can help confirm if the price is at the upper or lower extremes of its range.
Volume Spike: Looks for significant increases in trading volume, which might indicate a stronger move or a potential reversal point when combined with other conditions.
Divergence: RSI divergence occurs when the price makes a new high or low, but the RSI does not, suggesting momentum is weakening, which can be a precursor to a reversal.
How to Use in a Sideways Market
Identify the Range: First, visually identify the upper resistance and lower support levels of the sideways market on your chart. This indicator can help you spot these levels more precisely by signaling potential peaks and bottoms.
Peak Signal :
When to Look: When the price approaches the upper part of the range.
Conditions: The indicator will give a 'Peak' signal when:
RSI is over 70, indicating overbought conditions.
There's bearish divergence (price makes a higher high, but RSI doesn't).
Volume spikes, suggesting strong selling interest.
Price is above both Fast MA and Slow MA, indicating it's at a potentially high point in the range.
Action: This signal suggests that the price might be at or near the top of its range and could reverse downwards. A trader might consider selling or shorting here, expecting the price to move towards the lower part of the range.
Bottom Signal:
When to Look: When the price approaches the lower part of the range.
Conditions: The indicator will give a 'Bottom' signal when:
RSI is below 30, indicating oversold conditions.
There's bullish divergence (price makes a lower low, but RSI doesn't).
Volume spikes, suggesting strong buying interest.
Price is below both Fast MA and Slow MA, indicating it's at a potentially low point in the range.
Action: This signal suggests that the price might be at or near the bottom of its range and could reverse upwards. A trader might consider buying here, expecting the price to move towards the upper part of the range.
Confirmation: In a sideways market, false signals can occur due to the lack of a strong trend. Always look for confirmation:
Volume Confirmation: A significant volume spike can add confidence to the signal.
Price Action: Look for price action like candlestick patterns (e.g., doji, engulfing patterns) that confirm the reversal.
Time Frame: Consider using this indicator on multiple time frames. A signal on a shorter time frame (like 15m or 1h) might be confirmed by similar conditions on a longer time frame (4h or daily).
Risk Management: Since this is designed for scalping in a sideways market:
Set Tight Stop-Losses: Due to the quick nature of reversals in range-bound markets, place stop-losses close to your entry to minimize loss.
Take Profit Levels: Set profit targets near the opposite end of the range or use a trailing stop to capture as much of the move as possible before it reverses again.
Practice: Before trading with real money, practice with this indicator on historical data or in a paper trading environment to understand how it behaves in different sideways market scenarios.
Key Points for New Traders
Patience: Wait for all conditions to align before taking a trade. Sideways markets require patience as the price might hover around these levels for a while.
Not All Signals Are Equal: Sometimes, even with all conditions met, the market might not reverse immediately. Look for additional context or confirmation.
Continuous Learning: Understand that this indicator, like any tool, isn't foolproof. Learn from each trade, whether it's a win or a loss, and adjust your strategy accordingly.
By following these guidelines
Slim Fib 1.1 Customized script based on the script from KivancOzbilgic, thx for that. My script is kind of messy, since 'm not a programmer. Approch was to make it slim, because its for a bigger indicator i'm working on and i want it as clean as possible.
Changes: - calculation on Pivots, automatic change when a new pivot appears
- Global Pivot Settings for every Timeframe, looks fresh on every Timeframe
- Scalable Ote Box for Goldenzone and more extreme 0.71 level ( if you know you know;))
- Minimalized visualization
- Alerts for breaking Fiblevel
still work in progress
that's all i need
Cheers
Fixed: Time frame 1m didn't work
Quality of life: fixed pivot length dropdown menu, I'm lazy you know and it worked, pivots are in Fibonacci numbers, i will see how it will fit me, maybe i change it back to manually typestyle
Time frames higher than 1D refer to 1 hour. Is it a bug or a feature?
Issue: sadly it didn't work like expected to make the higher timeframe kind of visible on lower timeframe, pivot selection could probably help to adjust the range on the current timeframe.
Will definitly try the MTF selection soon.