Market Structure Trend Targets [ChartPrime]The Market Structure Trend Targets indicator is designed to identify trend direction and continuation points by marking significant breaks in price levels. This approach helps traders track trend strength and potential reversal points. The indicator uses previous highs and lows as breakout triggers, providing a visual roadmap for trend continuation or mean reversion signals.
⯁ KEY FEATURES AND HOW TO USE
⯌ Breakout Points with Numbered Markers :
The indicator identifies key breakout points where price breaks above a previous high (for uptrends) or below a previous low (for downtrends). The initial breakout (zero break) is marked with the entry price and a triangle icon, while subsequent breakouts within the trend are numbered sequentially (1, 2, 3…) to indicate trend continuation.
Example of breakout markers for uptrend and downtrend:
⯌ Percentage Change Display Option :
Traders can toggle on a setting to display the percentage change from the initial breakout point to each subsequent break level, offering an easy way to gauge trend momentum over time. This is particularly helpful for identifying how far price has moved in the current trend.
Percentage change example between break points:
⯌ Dynamic Stop Loss Levels :
In uptrends, the stop loss level is placed below the price to protect against downside moves. In downtrends, it is positioned above the price. If the price breaches the stop loss level, the indicator resets, indicating a potential end or reversal of the trend.
Dynamic stop loss level illustration in uptrend and downtrend:
⯌ Mean Reversion Signals :
The indicator identifies potential mean reversion points with diamond icons. In an uptrend, if the price falls below the stop loss and then re-enters above it, a diamond is plotted, suggesting a possible mean reversion. Similarly, in a downtrend, if the price moves above the stop loss and then falls back below, it indicates a reversion possibility.
Mean reversion diamond signals on the chart:
⯌ Trend Visualization with Colored Zones :
The chart background is shaded to visually represent trend direction, with color changes corresponding to uptrends and downtrends. This makes it easier to see overall market conditions at a glance.
⯁ USER INPUTS
Length : Defines the number of bars used to identify pivot highs and lows for trend breakouts.
Display Percentage : Option to toggle between showing sequential breakout numbers or the percentage change from the initial breakout.
Colors for Uptrend and Downtrend : Allows customization of color zones for uptrends and downtrends to match individual chart preferences.
⯁ CONCLUSION
The Market Structure Trend Targets indicator offers a strategic way to monitor market trends, track breakouts, and manage risk through dynamic stop loss levels. Its clear visual representation of trend continuity, alongside mean reversion signals, provides traders with actionable insights for both trend-following and counter-trend strategies.
指标和策略
Statistical Trend Analysis (Scatterplot) [BigBeluga]Statistical Trend Analysis (Scatterplot) provides a unique perspective on market dynamics by combining the statistical concept of z-scores with scatterplot visualization to assess price momentum and potential trend shifts.
🧿 What is Z-Score?
Definition: A z-score is a statistical measure that quantifies how far a data point is from the mean, expressed in terms of standard deviations.
In this Indicator:
A high positive z-score indicates the price is significantly above the average.
A low negative z-score indicates the price is significantly below the average.
The indicator also calculates the rate of change of the z-score, helping identify momentum shifts in the market.
🧿 Key Features:
Scatterplot Visualization:
Displays data points of z-score and its change across four quadrants.
Quadrants help interpret market conditions:
Upper Right (Strong Bullish Momentum): Most data points here signal an ongoing uptrend.
Upper Left (Weakening Momentum): Data points here may indicate a potential market shift or ranging market.
Lower Left (Strong Bearish Momentum): Indicates a dominant downtrend.
Lower Right (Trend Shift to Bullish/Ranging): Suggests weakening bearish momentum or an emerging uptrend.
Color-Coded Candles:
Candles are dynamically colored based on the z-score, providing a visual cue about the price's deviation from the mean.
Z-Score Time Series:
A line plot of z-scores over time shows price deviation trends.
A gray histogram displays the rate of change of the z-score, highlighting momentum shifts.
🧿 Usage:
Use the scatterplot and quadrant gauges to understand the current market momentum and potential shifts.
Monitor the z-score line plot to identify overbought/oversold conditions.
Utilize the gray histogram to detect momentum reversals and trend strength.
This tool is ideal for traders who rely on statistical insights to confirm trends, detect potential reversals, and assess market momentum visually and quantitatively.
SMA Trend Spectrum [InvestorUnknown]The SMA Trend Spectrum indicator is designed to visually represent market trends and momentum by using a series of Simple Moving Averages (SMAs) to create a color-coded spectrum or heatmap. This tool helps traders identify the strength and direction of market trends across various time frames within one chart.
Functionality:
SMA Calculation: The indicator calculates multiple SMAs starting from a user-defined base period (Starting Period) and increasing by a specified increment (Period Increment). This creates a sequence of moving averages that span from short-term to long-term perspectives.
Trend Analysis: Each segment of the spectrum compares three SMAs to determine the market's trend strength: Bullish (color-coded green) when the current price is above all three SMAs. Neutral (color-coded purple) when the price is above some but not all SMAs. Bearish (color-coded red) when the price is below all three SMAs.
f_col(x1, x2, x3) =>
min = ta.sma(src, x1)
mid = ta.sma(src, x2)
max = ta.sma(src, x3)
c = src > min and src > mid and src > max ? bull : src > min or src > mid or src > max ? ncol : bear
Heatmap Visualization: The indicator plots these trends as a vertical spectrum where each row represents a different set of SMAs, forming a heatmap-like display. The color of each segment in the heatmap directly correlates with market conditions, providing an intuitive view of market sentiment.
Signal Smoothing: Users can choose to smooth the trend signal using either a Simple Moving Average (SMA), Exponential Moving Average (EMA), or leave it as raw data (Signal Smoothing). The length of smoothing can be adjusted (Smoothing Length). The signal is displayed in a scaled way to automatically adjust for the best visual experience, ensuring that the trend is clear and easily interpretable across different chart scales and time frames
Additional Features:
Plot Signal: Optionally plots a line representing the average trend across all calculated SMAs. This line helps in identifying the overall market direction based on the spectrum data.
Bar Coloring: Bars on the chart can be colored according to the average trend strength, providing a quick visual cue of market conditions.
Usage:
Trend Identification: Use the heatmap to quickly assess if the market is trending strongly in one direction or if it's in a consolidation phase.
Entry/Exit Points: Look for shifts in color patterns to anticipate potential trend changes or confirmations for entry or exit points.
Momentum Analysis: The gradient from bearish to bullish across the spectrum can be used to gauge momentum and potentially forecast future price movements.
Notes:
The effectiveness of this indicator can vary based on market conditions, asset volatility, and the chosen SMA periods and increments.
It's advisable to combine this tool with other technical indicators or fundamental analysis for more robust trading decisions.
Disclaimer: Past performance does not guarantee future results. Always use this indicator as part of a broader trading strategy.
Scalping Strategy RSI & ADXThis Pine Script implements a scalping strategy that leverages the Relative Strength Index (RSI) and the Average Directional Index (ADX) to identify short-term trading opportunities. The strategy is designed for traders who aim to profit from quick price movements in highly volatile markets.
Key Components:
RSI (Relative Strength Index):
RSI is used to identify overbought and oversold conditions in the market.
If RSI is below the oversold level (default: 30), the script generates a buy signal.
If RSI is above the overbought level (default: 70), the script generates a sell signal.
ADX (Average Directional Index):
ADX measures the strength of a trend.
The script only triggers buy or sell signals when ADX is above a specified threshold (default: 25), ensuring trades occur only in strong trending markets.
Combined Logic:
A buy condition is met when RSI is below the oversold level and ADX indicates a strong trend.
A sell condition is met when RSI is above the overbought level and ADX indicates a strong trend.
Inputs:
RSI Length: Period for RSI calculation (default: 14).
RSI Overbought Level: Threshold for overbought conditions (default: 70).
RSI Oversold Level: Threshold for oversold conditions (default: 30).
ADX Length: Period for ADX calculation (default: 14).
ADX Smoothing: Smoothing factor for ADX (default: 14).
ADX Threshold: Minimum value for ADX to consider a trend strong (default: 25).
Visual Signals:
Green upward arrows indicate buy signals.
Red downward arrows indicate sell signals.
Strategy Execution:
The script uses strategy.entry to open positions based on the defined conditions.
It plots RSI and ADX values for additional visual confirmation.
How to Use:
Apply this script to your TradingView chart.
Adjust the input parameters to suit your preferred market and timeframe.
Backtest the strategy on historical data to assess its performance.
Use in live markets with appropriate risk management measures.
This strategy is ideal for traders who prefer a systematic and rule-based approach to scalping. However, always test and validate the strategy before using it with real funds.
Range Channel by Atilla YurtsevenThis script creates a dynamic channel around a user-selected moving average (MA). It calculates the relative difference between price and the MA, then finds the average of the positive differences and the negative differences separately. Using these averages, it plots upper and lower bands around the MA as well as a histogram-like oscillator to show when price moves above or below the average thresholds.
How It Works
Moving Average Selection
The indicator allows you to choose among multiple MA types (SMA, EMA, WMA, Linear Regression, etc.). Depending on your preference, it calculates the chosen MA for the selected lookback period.
Relative Difference Calculation
It then computes the percentage difference between the source (typically the closing price) and the MA. (diff = (src / ma - 1) * 100)
Positive & Negative Averages
- Positive differences are averaged and represent how far the price typically moves above the MA.
- Negative differences are similarly averaged for when price moves below the MA.
Range Channel & Oscillator
- The channel is plotted around the MA using the average positive and negative differences (Upper Edge and Lower Edge).
- The “Untrended” histogram plots the difference (diff). Green bars occur when price is above the MA on average, and red bars when below. Two additional lines mark the upper and lower average thresholds on this histogram.
How to Use
Identify Overbought/Oversold Zones: The upper edge can serve as a dynamic overbought level, while the lower edge can suggest potential oversold conditions. When the histogram approaches or crosses these levels, it may signal price extremes relative to its average movement.
Trend Confirmation: Compare price action relative to the channel. If price and the histogram consistently remain above the MA and upper threshold, it could indicate a stronger bullish trend. If they remain below, it might signal a prolonged bearish trend.
Entry/Exit Timings:
- Entry: Traders can look for moments when price breaks back inside the channel from an extreme, anticipating a mean reversion.
- Exit: Watching how price interacts with these dynamic edges can help define stop-loss or take-profit points.
Because these thresholds adapt over time based on actual price behavior, they can be more responsive than fixed-percentage bands. However, like all indicators, it’s most effective when used in conjunction with other technical and fundamental tools.
Disclaimer
This script is provided for educational and informational purposes only. It does not guarantee any specific outcome or profit. Use it at your own discretion and risk.
Trade smart, stay safe.
Atilla Yurtseven
mr.crypto731mr.crypto731 is the user name of My Instagram
it's Enhanced MACD Indicator is a powerful tool designed to provide traders with visual signals for potential market entry and exit points based on the Moving Average Convergence Divergence (MACD) strategy. This customized indicator adds clear and creative strong buy and sell signals within the MACD panel, making it easier to identify key trading opportunities.
Key Features:
MACD Calculation:
Fast Length: 12
Slow Length: 26
Signal Smoothing: 9
The indicator calculates the MACD line, signal line, and histogram using these parameters.
Strong Buy Signal:
Triggered when the MACD line (green) crosses above the signal line (red) and the histogram is positive (above zero).
This signal is marked by a lime-colored triangle pointing up with the text "🚀".
Strong Sell Signal:
Triggered when the signal line (red) crosses above the MACD line (green) and the histogram is negative (below zero).
This signal is marked by a red-colored triangle pointing down with the text "🔻".
Visual Enhancements:
Signal Labels: Creative labels with emojis to highlight the strength of the signals.
Background Color: Highlights the background in lime for strong buy signals and red for strong sell signals to make them stand out.
Integration:
Plots all signals within the MACD indicator panel for clear visualization and easy interpretation.
Usage:
Buy Signal: Look for a strong buy signal when the MACD line crosses above the signal line and the histogram is positive.
Sell Signal: Look for a strong sell signal when the signal line crosses above the MACD line and the histogram is negative.
This enhanced MACD indicator is ideal for traders looking for a straightforward and visually appealing tool to identify potential trading opportunities based on MACD crossovers. Its clear signals and creative styling make it a valuable addition to any trading strategy.
CandlestickThe indicator generates a table that offers a clear visualization of the historical return percentages for each candlestick pattern strategy over a specified time period. This table serves as an organized resource, serving as a launching point for in-depth research into candle formations. It may help to rectify any misconceptions surrounding candlestick patterns, refine trading approaches, and it could be foundation to make informed decisions in trading journey.
EMA Crossover Buy/Sell Signals 29 decbuy when 20 ema crosses above 50 ema and sell when 20 ema crosses below 50 ema
GOLDEN BLOCK VER:4-newBlock indicator is based on breakdown.
When a candle closes above previous highest high or below previous lowest low a block is made.
When a candle closes below previous highest high or above previous lowest low the block continues and just high and low are updated.
This indicator is very useful for supply and demand strategy.
Have much profit with this indicator.
Uptrick: Arbitrage OpportunityINTRODUCTION
This script, titled Uptrick: Arbitrage Monitor, is a Pine Script™ indicator that aims to help traders quickly visualize potential arbitrage scenarios across multiple cryptocurrency exchanges. Arbitrage, in general, involves taking advantage of price differences for the same asset across different trading platforms. By comparing market prices of the same symbol on two user-selected exchanges, as well as scanning a broader list of exchanges, this script attempts to signal areas where you might want to buy on one exchange and sell on another. It includes various graphical tools, calculations, and an optional Automated Detection signal feature, allowing users to incorporate more advanced data scanning into their trading decisions. Keep in mind that transaction fees must also be considered in real-world scenarios. These fees can negate potential profits and, in some cases, result in a net loss.
PURPOSE
The primary purpose of this indicator is to show potential percentage differences between the same cryptocurrency trading pairs on two different exchanges. This difference is displayed numerically, visually as a line chart, and it is also tested against user-defined thresholds. With the threshold in place, buy and sell signals can be generated. The script allows you to quickly gauge how significant a spread is between two exchanges and whether that spread surpasses a specified threshold. This is particularly useful for arbitrage trading, where an asset is bought at a lower price on one exchange and sold at a higher price on another, capitalizing on price discrepancies. By identifying these opportunities, traders can potentially secure profits across different markets.
WHY IT WAS MADE
This script was developed to help traders who frequently look for arbitrage opportunities in the fast-paced cryptocurrency market. Cryptocurrencies sometimes experience quick price divergences across different exchanges. By having an automated approach that compares and displays prices, traders can spend less time manually tracking price discrepancies and more time focusing on actual trading strategies. The script was also made with user customization in mind, allowing you to toggle an optional Automated-based approach and choose different moving average methods to smooth out the displayed price difference.
WHAT ARBITRAGE IS
Arbitrage is the practice of buying an asset on one market (or exchange) at a lower price and simultaneously selling it on another market where the price is higher, thus profiting from the price difference. In cryptocurrency markets, these price differentials can occur across multiple exchanges due to varying liquidity, trading volume, geographic factors, or market inefficiencies. Though sometimes small, these differences can be exploited for profit when approached methodically.
EXPLANATION OF INPUTS
The script includes a variety of user inputs that help tailor the indicator to your specific needs:
1. Compared Symbol 1: This is the primary symbol you want to track (for example, BTCUSDT). Make sure it's written in all capital and make sure that it's price from that exchange is available on Tradingview.
2. Compare Exchange 1: The first exchange on which the script will request pricing data for the chosen symbol.
3. Compared to Exchange: The second exchange, used for the comparison.
4. Opportunity Threshold (%): A percentage threshold that, when exceeded by the price difference, can trigger buy or sell signals.
5. Plot Style?: Allows you to choose between plotting the raw difference line or a moving average of that difference.
6. MA Type: Select among SMA, EMA, WMA, RMA, or HMA for your moving average calculation.
7. MA Length: The lookback period for the selected moving average.
8. Plot Buy/Sell Signals?: Enables or disables the plotting of arrows signaling potential buy or sell zones based on threshold crossovers.
9. Automated Detection?: Toggles an additional multi-exchange data scan feature that calculates the highest and lowest prices for the specified symbol across a predefined list of exchanges.
CALCULATIONS
At its core, the script calculates price1 and price2 using the request.security function to fetch close prices from two selected exchanges. The difference is measured as (price1 - price2) / price2 * 100. This results in a percentage that indicates how much higher or lower price1 is relative to price2. Additionally, the script calculates a slope for this difference, which helps color the line depending on whether it is trending up or down. If you choose the moving average option, the script will replace the raw difference data with one of several moving average calculations (SMA, EMA, WMA, RMA, or HMA).
The script also includes an iterative scan of up to 15 different exchanges for Automated detection, collecting the highest and lowest price across all those exchanges. If the Automated option is enabled, it compiles a potential recommendation: buy at the cheapest exchange price and sell at the most expensive one. The difference across all exchanges (allExDiffPercent) is calculated using (highestPriceAll - lowestPriceAll) / lowestPriceAll * 100.
WHAT AUTOMATED DETECTION SIGNAL DOES
If enabled, the Automated detection feature scans all 15 supported exchanges for the specified symbol. It then identifies the exchange with the highest price and the exchange with the lowest price. The script displays a recommended action: buy on the lowest-exchange price and sell on the highest-exchange price. While called “Automated,” it is essentially a multi-exchange data query that automates a portion of research by consolidating different price points. It does not replace thorough analysis or guaranteed execution; it simply provides an overview of potential extremes.
WHAT ALL-EX-DIFF IS
The variable allExDiffPercent is used to show the overall difference between the highest price and the lowest price found among the 15 pre-chosen exchanges. This figure can be useful for anyone wanting a big-picture view of how large the arbitrage spread might be across the broader market.
SIGNALS AND HOW THEY ARE GENERATED
The script provides two main modes of signal generation:
1. Raw Difference Mode: If the user chooses “Use Normal Line,” the script compares the percentage difference of the two selected exchanges (price1 and price2) to the user-defined threshold. When the difference crosses under the positive threshold, a sell signal is displayed (red arrow). Conversely, when the difference crosses above the negative threshold, a buy signal is displayed (green arrow).
2. Moving Average Mode: If the user selects “Use Moving Average,” the script instead references the moving average values (maValue). The signals fire under similar conditions but use the average line to gauge whether the threshold has been crossed.
HOW TO USE THE INDICATOR
1. Add the script to your chart in TradingView.
2. In the script’s settings panel, configure the symbol you wish to compare (for example, BTCUSDT), choose the two exchanges you want to evaluate, and set your desired threshold.
3. Optionally, pick a moving average type and length if you prefer a smoother representation of the difference.
4. Enable or disable buy/sell signals according to your preference.
5. If you’d like to see potential extremes among a broader list of exchanges, enable Automated Detection. Keep in mind that this feature runs additional security requests, so it might slow down performance on weaker devices or if you already have many scripts running.
EXCHANGES TO USE
The script currently supports up to 15 exchanges: BYBIT, BINANCE, MEXC, BLOFIN, BITGET, OKX, KUCOIN, COINBASE, COINEX, PHEMEX, POLONIEX, GATEIO, BITSTAMP, and KRAKEN. You can choose any two of these for direct comparison, and if you enable the Automated detection, it will attempt to query them all to find extremes in real time.
VISUALS
The exchanges and current prices & differences are all plotted in the table while the colored line represents the difference in the price. The two thresholds colored red are where signals are generated. A cross below the upper threshold is a sell signal and a cross above the lower threshold is a buy signal. In the line at the bottom, purple is a negative slope and aqua is a positive slope.
LIMITATIONS AND POTENTIAL PROBLEMS
If you enable too many visual elements such as signals, additional lines, and the Automated-based scanning table, you may find that your chart becomes cluttered, or text might overlap. One workaround is to remove and reapply the indicator to refresh its display. You may also want to reduce the number of displayed table rows by disabling some features if your chart becomes too crowded. Sometimes there might be an error that the price of an asset is not available on an exchange, to fix this, go and select another exchange to compare it to, or if it happens in Automated detection, choose a different asset, ideally more widely spread.
UNIQUENESS
This indicator stands out due to its multifaceted approach: it doesn’t just look at two exchanges but optionally scans up to 15 exchanges in real time, presenting users with a much broader view of the market. The dual-mode system (raw difference vs. moving average) allows for both immediate, unfiltered signals and smoother, noise-reduced signals depending on user preference. By default, it introduces dynamic visual cues through color changes when the slope of the difference transitions upward or downward. The optional Automated detection, while not a deep learning system, adds a functional intelligence layer by collating extreme price points from multiple exchanges in one place, thereby streamlining the manual research process. This combination of features gives the script a unique edge in the TradingView ecosystem, catering equally to novices wanting a straightforward approach and to advanced users looking for an aggregated multi-exchange analysis.
CONCLUSION
Uptrick: Arbitrage Monitor is a versatile and customizable Pine Script™ indicator that highlights price differences for a specified symbol between two user-selected exchanges. Through signals, threshold-based alerts, and optional Automated detection across multiple exchanges, it aims to support traders in identifying potential arbitrage opportunities quickly and efficiently. This script makes no guarantees of profitability but can serve as a valuable tool to add to your trading toolkit. Always use caution when implementing arbitrage strategies, and be mindful of market risks, exchange fees, and latency.
ADDITIONAL DISCLOSURES
This script is provided for educational and informational purposes only. It does not constitute financial advice or a guarantee of performance. Users are encouraged to conduct thorough research and consider the inherent risks of arbitrage trading. Market conditions can change rapidly, and orders may fail to execute at desired prices, especially when large price discrepancies attract competition from other traders.
AdibXmos// © AdibXmos
//@version=5
indicator('Sood Indicator V2 ', overlay=true, max_labels_count=500)
show_tp_sl = input.bool(true, 'Display TP & SL', group='Techical', tooltip='Display the exact TP & SL price levels for BUY & SELL signals.')
rrr = input.string('1:2', 'Risk to Reward Ratio', group='Techical', options= , tooltip='Set a risk to reward ratio (RRR).')
tp_sl_multi = input.float(1, 'TP & SL Multiplier', 1, group='Techical', tooltip='Multiplies both TP and SL by a chosen index. Higher - higher risk.')
tp_sl_prec = input.int(2, 'TP & SL Precision', 0, group='Techical')
candle_stability_index_param = 0.5
rsi_index_param = 70
candle_delta_length_param = 4
disable_repeating_signals_param = input.bool(true, 'Disable Repeating Signals', group='Techical', tooltip='Removes repeating signals. Useful for removing clusters of signals and general clarity.')
GREEN = color.rgb(29, 255, 40)
RED = color.rgb(255, 0, 0)
TRANSPARENT = color.rgb(0, 0, 0, 100)
label_size = input.string('huge', 'Label Size', options= , group='Cosmetic')
label_style = input.string('text bubble', 'Label Style', , group='Cosmetic')
buy_label_color = input(GREEN, 'BUY Label Color', inline='Highlight', group='Cosmetic')
sell_label_color = input(RED, 'SELL Label Color', inline='Highlight', group='Cosmetic')
label_text_color = input(color.white, 'Label Text Color', inline='Highlight', group='Cosmetic')
stable_candle = math.abs(close - open) / ta.tr > candle_stability_index_param
rsi = ta.rsi(close, 14)
atr = ta.atr(14)
bullish_engulfing = close < open and close > open and close > open
rsi_below = rsi < rsi_index_param
decrease_over = close < close
var last_signal = ''
var tp = 0.
var sl = 0.
bull_state = bullish_engulfing and stable_candle and rsi_below and decrease_over and barstate.isconfirmed
bull = bull_state and (disable_repeating_signals_param ? (last_signal != 'buy' ? true : na) : true)
bearish_engulfing = close > open and close < open and close < open
rsi_above = rsi > 100 - rsi_index_param
increase_over = close > close
bear_state = bearish_engulfing and stable_candle and rsi_above and increase_over and barstate.isconfirmed
bear = bear_state and (disable_repeating_signals_param ? (last_signal != 'sell' ? true : na) : true)
round_up(number, decimals) =>
factor = math.pow(10, decimals)
math.ceil(number * factor) / factor
if bull
last_signal := 'buy'
dist = atr * tp_sl_multi
tp_dist = rrr == '2:3' ? dist / 2 * 3 : rrr == '1:2' ? dist * 2 : rrr == '1:4' ? dist * 4 : dist
tp := round_up(close + tp_dist, tp_sl_prec)
sl := round_up(close - dist, tp_sl_prec)
if label_style == 'text bubble'
label.new(bar_index, low, 'BUY', color=buy_label_color, style=label.style_label_up, textcolor=label_text_color, size=label_size)
else if label_style == 'triangle'
label.new(bar_index, low, 'BUY', yloc=yloc.belowbar, color=buy_label_color, style=label.style_triangleup, textcolor=TRANSPARENT, size=label_size)
else if label_style == 'arrow'
label.new(bar_index, low, 'BUY', yloc=yloc.belowbar, color=buy_label_color, style=label.style_arrowup, textcolor=TRANSPARENT, size=label_size)
label.new(show_tp_sl ? bar_index : na, low, 'TP: ' + str.tostring(tp) + ' SL: ' + str.tostring(sl), yloc=yloc.price, color=color.gray, style=label.style_label_down, textcolor=label_text_color)
if bear
last_signal := 'sell'
dist = atr * tp_sl_multi
tp_dist = rrr == '2:3' ? dist / 2 * 3 : rrr == '1:2' ? dist * 2 : rrr == '1:4' ? dist * 4 : dist
tp := round_up(close - tp_dist, tp_sl_prec)
sl := round_up(close + dist, tp_sl_prec)
if label_style == 'text bubble'
label.new(bear ? bar_index : na, high, 'SELL', color=sell_label_color, style=label.style_label_down, textcolor=label_text_color, size=label_size)
else if label_style == 'triangle'
label.new(bear ? bar_index : na, high, 'SELL', yloc=yloc.abovebar, color=sell_label_color, style=label.style_triangledown, textcolor=TRANSPARENT, size=label_size)
else if label_style == 'arrow'
label.new(bear ? bar_index : na, high, 'SELL', yloc=yloc.abovebar, color=sell_label_color, style=label.style_arrowdown, textcolor=TRANSPARENT, size=label_size)
label.new(show_tp_sl ? bar_index : na, low, 'TP: ' + str.tostring(tp) + ' SL: ' + str.tostring(sl), yloc=yloc.price, color=color.gray, style=label.style_label_up, textcolor=label_text_color)
alertcondition(bull or bear, 'BUY & SELL Signals', 'New signal!')
alertcondition(bull, 'BUY Signals (Only)', 'New signal: BUY')
alertcondition(bear, 'SELL Signals (Only)', 'New signal: SELL')
Twenty-Trend -Boxes (20 Trend)"The 20-Trend indicator is a comprehensive trend-following tool designed primarily for equity markets, focusing on identifying and tracking bullish trends. It integrates price channels, moving averages, volatility-based analysis, and volume dynamics to detect potential breakouts and pyramiding opportunities.
Key features include:
Volatility-based channels: Dynamic price channels calculated using ATR (Average True Range), adapting to market volatility.
Multi-timeframe trend detection: Offers a built-in overview of daily, weekly, and monthly trends for a complete market perspective.
Breakout detection: Identifies price action escaping resistance levels, signaling potential entries.
Pyramiding logic: Highlights opportunities to scale into positions with customizable thresholds for gains and maximum additions.
Visual aids: A "Boxes" system highlights price ranges, key support/resistance zones, and trend direction through intuitive color-coding.
Fully customizable settings: The indicator allows full adjustment of ATR length, price channel factor, box length, and filter channel settings.
While fully customizable, the recommended settings are ATR = 14, Boxes Length = 20, Factor = 2, and Filter Channel = 100.
Complementary tool: For efficient position sizing and risk management, this indicator pairs seamlessly with the Risk Management Table indicator, designed to optimize position control.
This indicator is best suited for trending stocks but can also be applied to other markets exhibiting strong directional movement. With its user-friendly settings, it adapts to various trading styles while maintaining a focus on bullish trends.
Note: This tool is optimized for tracking bullish trends and is not intended for shorting or bearish trend analysis."
Profitability Visualization with Bid-Ask Spread ApproximationOverview
The " Profitability Visualization with Bid-Ask Spread Approximation " indicator is designed to assist traders in assessing potential profit and loss targets in relation to the current market price or a simulated entry price. It provides flexibility by allowing users to choose between two methods for calculating the offset from the current price:
Bid-Ask Spread Approximation: The indicator attempts to estimate the bid-ask spread by using the highest (high) and lowest (low) prices within a given period (typically the current bar or a user-defined timeframe) as proxies for the ask and bid prices, respectively. This method provides a dynamic offset that adapts to market volatility.
Percentage Offset: Alternatively, users can specify a fixed percentage offset from the current price. This method offers a consistent offset regardless of market conditions.
Key Features
Dual Offset Calculation Methods: Choose between a dynamic bid-ask spread approximation or a fixed percentage offset to tailor the indicator to your trading style and market analysis.
Entry Price Consideration: The indicator can simulate an entry price at the beginning of each trading session (or the first bar on the chart if no sessions are defined). This feature enables a more realistic visualization of potential profit and loss levels based on a hypothetical entry point.
Profit and Loss Targets: When the entry price consideration is enabled, the indicator plots profit target (green) and loss target (red) lines. These lines represent the price levels at which a trade entered at the simulated entry price would achieve a profit or incur a loss equivalent to the calculated offset amount.
Offset Visualization: Regardless of whether the entry price is considered, the indicator always displays upper (aqua) and lower (fuchsia) offset lines. These lines represent the calculated offset levels based on the chosen method (bid-ask approximation or percentage offset).
Customization: Users can adjust the percentage offset, toggle the bid-ask approximation and entry price consideration, and customize the appearance of the lines through the indicator's settings.
Inputs
useBidAskApproximation A boolean (checkbox) input that determines whether to use the bid-ask spread approximation (true) or the percentage offset (false). Default is false.
percentageOffset A float input that allows users to specify the percentage offset to be used when useBidAskApproximation is false. The default value is 0.63.
considerEntryPrice A boolean input that enables the consideration of a simulated entry price for calculating and displaying profit and loss targets. Default is true.
Calculations
Bid-Ask Approximation (if enabled): bidApprox = request.security(syminfo.tickerid, timeframe.period, low) Approximates the bid price using the lowest price (low) of the current period. askApprox = request.security(syminfo.tickerid, timeframe.period, high) Approximates the ask price using the highest price (high) of the current period. spreadApprox = askApprox - bidApprox Calculates the approximate spread.
Offset Amount: offsetAmount = useBidAskApproximation ? spreadApprox / 2 : close * (percentageOffset / 100) Determines the offset amount based on the selected method. If useBidAskApproximation is true, the offset is half of the approximated spread; otherwise, it's the current closing price (close) multiplied by the percentageOffset.
Entry Price (if enabled): var entryPrice = 0.0 Initializes a variable to store the entry price. if considerEntryPrice Checks if entry price consideration is enabled. if barstate.isnew Checks if the current bar is the first bar of a new session. entryPrice := close Sets the entryPrice to the closing price of the first bar of the session.
Profit and Loss Targets (if entry price is considered): profitTarget = entryPrice + offsetAmount Calculates the profit target price level. lossTarget = entryPrice - offsetAmount Calculates the loss target price level.
Plotting
Profit Target Line: Plotted in green (color.green) with a dashed line style (plot.style_linebr) and increased linewidth (linewidth=2) when considerEntryPrice is true.
Loss Target Line: Plotted in red (color.red) with a dashed line style (plot.style_linebr) and increased linewidth (linewidth=2) when considerEntryPrice is true.
Upper Offset Line: Always plotted in aqua (color.aqua) to show the offset level above the current price.
Lower Offset Line: Always plotted in fuchsia (color.fuchsia) to show the offset level below the current price.
Limitations
Approximation: The bid-ask spread approximation is based on high and low prices and may not perfectly reflect the actual bid-ask spread of a specific broker, especially during periods of high volatility or low liquidity.
Simplified Entry: The entry price simulation is basic and assumes entry at the beginning of each session. It does not account for specific entry signals or order types.
No Order Execution: This indicator is purely for visualization and does not execute any trades.
Data Discrepancies: The high and low values used for approximation might not always align with real-time bid and ask prices due to differences in data aggregation and timing between TradingView and various brokers.
Disclaimer
This indicator is for educational and informational purposes only and should not be considered financial advice. Trading involves substantial risk, and past performance is not indicative of future results. Always conduct thorough research and consider your own risk tolerance before making any trading decisions. It is recommended to combine this indicator with other technical analysis tools and a well-defined trading strategy.
MomentumGridThis indicator provides a comprehensive view of key market dynamics using a combination of technical tools. It features:
- **VWAP (Volume Weighted Average Price):** A powerful indicator that shows the average price weighted by volume, helping traders identify trends and key price levels for the day.
- **EMA (Exponential Moving Average):** A popular trend-following indicator that highlights the smoothing of price data, making it easier to identify the direction of the market with a focus on more recent prices.
- **Supply and Demand Zones:** Visual markers of key levels where buying and selling pressure have historically been strong. These zones can help traders spot potential reversal points.
- **Volume Analysis:** Volume data displayed alongside price action to provide insights into the strength of price movements and potential market shifts.
This indicator combines these elements to help traders make more informed decisions by providing both trend-following and market structure insights. The VWAP and EMA serve as trend indicators, while the supply and demand zones highlight critical price levels, all supported by volume analysis.
Super Billion VVIPThis Pine Script code is an advanced script designed for TradingView. It integrates supply and demand zones, price action labels, zigzag lines, and a modified ATR-based SuperTrend indicator. Here's a breakdown of its key components:
Key Features
Supply and Demand Zones:
Automatically identifies and plots supply (resistance) and demand (support) zones using swing highs and lows.
Zones are extended dynamically and updated based on market movements.
Prevents overlapping zones by ensuring a minimum ATR-based buffer.
Zigzag Indicator:
Adds zigzag lines to connect significant swing highs and lows.
Helps identify market trends and potential turning points.
SuperTrend Indicator:
A trend-following component using ATR (Average True Range) with configurable periods and multipliers.
Provides buy and sell signals based on trend changes.
Includes alerts for trend direction changes.
Swing High/Low Labels:
Labels significant price action points as "HH" (Higher High), "LL" (Lower Low), etc., for easy visual reference.
Customizable Visuals:
Allows users to customize colors, label visibility, box widths, and more through inputs.
Alerts:
Generates alerts for buy/sell signals and trend direction changes.
Inputs and Settings
Supply and Demand Settings:
Swing length, zone width, and history size.
Visual Settings:
Toggle zigzag visibility, label colors, and highlight styles.
SuperTrend Settings:
ATR periods, multiplier, and signal visibility.
How to Use
Copy the script into the Pine Editor on TradingView.
Customize the input settings as per your trading strategy.
Add the script to your chart to visualize zones, trends, and signals.
Set alerts for buy/sell signals or trend changes.
Notes
Ensure the script complies with TradingView’s limitations (e.g., max objects).
Fine-tune settings based on the asset's volatility and timeframe.
Let me know if you need help optimizing or further explaining specific parts!
BUY & SELL CIPHER (ANDY CANE)Designed to detect and highlight potential trend reversals or momentum shifts in the market. It utilizes the WaveTrend Oscillator (WT) along with a custom RSI+MFI filter to generate actionable signals. Here's a breakdown of its features and functionality.
Green dots: Represent potential buy signals.
Red dots: Represent potential sell signals.
Linear Signal-Based Strategy[Kopottaja]
Strategy Description for "Linear Signal-Based Strategy"
Key Features:
Linear Signal Calculation:
Combines the RSI (or other exogenous variables) with BTC price data using a weighted sum. The weight (signal_alpha) can be adjusted to emphasize either the exogenous variable or price.
Z-Score Normalization:
Standardizes the linear signal into a Z-score, enabling robust threshold-based decisions for long and short trades.
Threshold-Based Entry:
Long Position: Triggered when the Z-score falls below the lower threshold (-risk_adjustment_factor), indicating a potential oversold condition in BTC.
Short Position: Triggered when the Z-score rises above the upper threshold (risk_adjustment_factor), indicating a potential overbought condition in BTC.
Risk Management:
Configurable stop-loss and take-profit levels automatically manage risk and lock in profits for each trade.
Timeframe Focus:
Optimized for 15-minute and 5-minute charts, making it ideal for intraday and high-frequency trading in BTC/USDT.
How It Works:
The strategy calculates a linear signal as a weighted combination of RSI and BTC price data.
It computes the mean and standard deviation of the linear signal over a configurable lookback_period.
A Z-score is calculated to measure how far the current signal deviates from its mean.
Trading signals are generated when the Z-score crosses the specified thresholds:
Long trades: When the Z-score is below -risk_adjustment_factor.
Short trades: When the Z-score is above risk_adjustment_factor.
Trades are closed automatically at take-profit or stop-loss levels.
Customizable Parameters:
lookback_period: Number of bars for calculating moving averages and Z-score.
signal_alpha: Weight assigned to the exogenous variable (RSI) versus BTC price.
take_profit_percent and stop_loss_percent: Define the profit and risk limits for each trade.
risk_adjustment_factor: Controls the sensitivity of the strategy by setting thresholds for entry conditions.
Applications:
This strategy is optimized for BTC/USDT on 15-minute and 5-minute timeframes, making it suitable for intraday and scalping strategies. It is versatile and can be adapted for other cryptocurrencies or volatile assets with high liquidity. The configurable parameters make it adaptable to various market conditions and risk preferences.
Volume Profile with Bull/Bear ColorsI took the Volume Profile from kv4coins and added different colors to identify net bearish and net bullish volume. The original code required me to switch the settings from bullish, bearish, or both, but both was monochromatic, so I couldn't identify the sells from the buys. The author recommended opening up two instances of the script, one for bullish and one for bearish, but I would have to upgrade my TV account to display more scripts. So this combines the two.
Here is the original explanation:
______________________________________________________________________
This is a Volume Profile based on pine script arrays.
The main idea behind this script is from the user IldarAkhmetgaleev .
He created an awesome piece of code for free users on tradingview.
Here are some changes to the main script:
0. Used Pine Script Arrays for doing/storing calculations.
1. The bar labels are replaced with lines.
2. Added a POC line.
3. Bar growing directions changed from right to left.
4. Added an option to change bar width.
Inputs:
0. Volume Lookback Depth : Number of bars to look back for volume calculations.
1. Bar Length Multiplier : Bar length multiplier to make bar long or short.
2. Bar Horizontal Offset : Horizontal distance from the current bar in the right direction.
3. Bar Width : Width of the bars.
4. Show POC Line : Show or hide the POC line.
Happy trading.
Oct 20, 2020
Release Notes
Added option for changing Bar and POC line colors.
Nov 12, 2020
Release Notes
According to the latest update from the Tradingview, now we can define number of drawable lines in the study parameter as 'max_lines_count' up to the 500.
So here are our Volume Profile script with updated features.
Changes:
1. Added option for setting number of bars from 10 to 500.
2. Codes cleaned little bit.
Feb 22, 2021
Release Notes
Added delta option as suggested by @NXT2017.
Options: Both, Bullish and Bearish.
Both: bullish and bearish both candles ae used to calculate volume profile (default).
Bullish: only bullish candles are used.
Bearish: only bearish candles are used.
Feb 22, 2021
Release Notes
For viewing delta in volume profile, add this indicator two times and set delta type to bullish on the first one and bearish on the second one, now set same bar numbers on both.
Dead Zone HighlighterDead Zone Highlighter: A precise tool for marking low-probability trading zones between the daily open and the last 15-minute close of the first 2 hours. Simplify your decision-making by identifying non-trading zones with clear visual cues.
Custom Fibonacci Strategyhi this is my hard area .. I used many times and its very good to win money
Dynamic Support Resistance Strategy @tradingbauhausDynamic Support Resistance Strategy @tradingbauhaus
This script is designed to identify dynamic support and resistance levels on a trading chart based on pivots (highs and lows) detected over a specific period. It also includes a basic strategy logic to generate entry signals when the price breaks these support or resistance levels. Below is a step-by-step explanation of how it works:
How the Script Works:
Pivot Detection:
The script identifies pivots (highs and lows) using the pivothigh and pivotlow functions.
The period for detecting pivots is configurable (Pivot Period).
The source for pivots can be either High/Low (highs and lows) or Close/Open (close and open), depending on user selection.
Creation of Support and Resistance Channels:
The detected pivots are used to create dynamic support and resistance channels.
The maximum channel width is defined as a percentage (Maximum Channel Width %) of the price range over a 300-bar period.
Only channels containing a minimum number of pivots (Minimum Strength) are considered valid.
Visualization of Channels:
Support and resistance channels are plotted on the chart as shaded areas.
Channel colors are customizable:
Resistance: Red.
Support: Blue.
Channel (price inside): Gray.
Optionally, the detected pivots can be displayed on the chart.
Breakout Detection:
The script checks if the price breaks a support or resistance level.
If the price breaks a resistance level, a buy signal is generated.
If the price breaks a support level, a sell signal is generated.
Breakouts are visually marked with triangles (optional) and trigger alerts.
Moving Averages (Optional):
The script allows displaying two moving averages (SMA or EMA) with configurable periods.
These moving averages can be used as additional reference tools for analysis.
Strategy Logic:
When the price breaks a resistance level, the script enters a long position.
When the price breaks a support level, the script enters a short position.
Script Workflow:
Pivot Identification:
The script searches for highs and lows on the chart based on the configurable period.
These pivots are stored in arrays for later use.
Channel Creation:
For each pivot, the script calculates a support/resistance channel, ensuring it meets the maximum width and minimum pivot requirements.
Valid channels are stored and sorted by "strength" (number of included pivots).
Visualization:
Channels are plotted on the chart as shaded areas using the configured colors.
If enabled, pivots are marked on the chart with labels.
Breakout Detection:
The script checks if the price has broken a support or resistance level on the current bar.
If a breakout is detected, a signal is generated and optionally marked on the chart.
Strategy:
If the price breaks a resistance level, a buy signal is triggered.
If the price breaks a support level, a sell signal is triggered.
User Configuration:
The script allows customization of several parameters to adapt it to different trading styles and assets:
Pivot Period: Period for detecting pivots.
Source: Source for pivots (High/Low or Close/Open).
Maximum Channel Width %: Maximum channel width as a percentage of the price range.
Minimum Strength: Minimum number of pivots required to form a channel.
Maximum Number of S/R: Maximum number of channels to display.
Loopback Period: Lookback period for detecting pivots.
Colors: Customization of colors for resistance, support, and channel.
Extras: Options to display pivots, breakouts, and moving averages.
Example Use Case:
Chart Analysis:
On a daily chart, the script identifies key support and resistance levels based on pivots from the last 10 candles.
Channels are plotted as shaded areas, providing a clear visualization of key zones.
Breakout Trading:
If the price breaks a resistance level, the script generates a buy signal.
If the price breaks a support level, the script generates a sell signal.
Moving Averages:
If moving averages are enabled, they can be used as additional confirmation for signals.
Conclusion:
This script is a powerful tool for traders looking to identify dynamic support and resistance levels and capitalize on breakouts as trading signals. Its flexibility and customization make it suitable for a variety of assets and timeframes.
Sunil High-Frequency Strategy with Simple MACD & RSISunil High-Frequency Strategy with Simple MACD & RSI
This high-frequency trading strategy uses a combination of MACD and RSI to identify quick market opportunities. By leveraging these indicators, combined with dynamic risk management using ATR, it aims to capture small but frequent price movements while ensuring tight control over risk.
Key Features:
Indicators Used:
MACD (Moving Average Convergence Divergence): The strategy uses a shorter MACD configuration (Fast Length of 6 and Slow Length of 12) to capture quick price momentum shifts. A MACD crossover above the signal line triggers a buy signal, while a crossover below the signal line triggers a sell signal.
RSI (Relative Strength Index): A shorter RSI length of 7 is used to gauge overbought and oversold market conditions. The strategy looks for RSI confirmation, with a long trade initiated when RSI is below the overbought level (70) and a short trade initiated when RSI is above the oversold level (30).
Risk Management:
Dynamic Stop Loss and Take Profit: The strategy uses ATR (Average True Range) to calculate dynamic stop loss and take profit levels based on market volatility.
Stop Loss is set at 0.5x ATR to limit risk.
Take Profit is set at 1.5x ATR to capture reasonable price moves.
Trailing Stop: As the market moves in the strategy’s favor, the position is protected by a trailing stop set at 0.5x ATR, allowing the strategy to lock in profits as the price moves further.
Entry & Exit Signals:
Long Entry: Triggered when the MACD crosses above the signal line (bullish crossover) and RSI is below the overbought level (70).
Short Entry: Triggered when the MACD crosses below the signal line (bearish crossover) and RSI is above the oversold level (30).
Exit Conditions: The strategy exits long or short positions based on the stop loss, take profit, or trailing stop activation.
Frequent Trades:
This strategy is designed for high-frequency trading, with trade signals occurring frequently as the MACD and RSI indicators react quickly to price movements. It works best on lower timeframes such as 1-minute, 5-minute, or 15-minute charts, but can be adjusted for different timeframes based on the asset’s volatility.
Customizable Parameters:
MACD Settings: Adjust the Fast Length, Slow Length, and Signal Length to tune the MACD’s sensitivity.
RSI Settings: Customize the RSI Length, Overbought, and Oversold levels to better match your trading style.
ATR Settings: Modify the ATR Length and multipliers for Stop Loss, Take Profit, and Trailing Stop to optimize risk management according to market volatility.
Important Notes:
Market Conditions: This strategy is designed to capture smaller, quicker moves in trending markets. It may not perform well during choppy or sideways markets.
Optimizing for Asset Volatility: Adjust the ATR multipliers based on the asset’s volatility to suit the risk-reward profile that fits your trading goals.
Backtesting: It's recommended to backtest the strategy on different assets and timeframes to ensure optimal performance.
Summary:
The Sunil High-Frequency Strategy leverages a simple combination of MACD and RSI with dynamic risk management (using ATR) to trade small but frequent price movements. The strategy ensures tight stop losses and reasonable take profits, with trailing stops to lock in profits as the price moves in favor of the trade. It is ideal for scalping or intraday trading on lower timeframes, aiming for quick entries and exits with controlled risk.
Adaptive Crypto Trading Strategy with Martingale[Kopottaja]
Adaptive Crypto Trading Strategy with Martingale
Key Features:
Autoencoder-Based Smoothing:
Uses a simple moving average (SMA) to smooth price data and reduce market noise.
Momentum Feature Extraction:
Calculates momentum as the difference between the current price and a longer SMA, simulating CNN-like pattern recognition.
Volatility Thresholds:
Combines momentum signals with volatility levels (measured by standard deviation) to filter high-probability trades.
Martingale Position Sizing:
Automatically increases lot size after losing trades using a configurable multiplier (Martingale Multiplier), with a cap (Maximum Lot Size) to limit risk.
Resets the position size after a winning trade.
Risk Management:
Configurable take-profit and stop-loss percentages to ensure disciplined exits.
Designed for BTC/USDT:
Optimized for trading Bitcoin on short-term timeframes (e.g., 15-minute and 5-minute charts).
How It Works:
Smoothing & Feature Extraction:
Smooths price data over a Smoothing Length period to reduce noise.
Extracts momentum signals and evaluates volatility for trade decision-making.
Entry Conditions:
Long Entry: Triggered when momentum is positive, and volatility exceeds the threshold (Volatility Threshold).
Short Entry: Triggered when momentum is negative, and volatility exceeds the threshold.
Martingale Logic:
After a losing trade, the lot size is increased by the multiplier to recover losses.
Lot size resets to the base size after a profitable trade.
Dynamic Exits:
Positions are automatically closed when the price reaches the take-profit or stop-loss levels.
Customizable Parameters:
Smoothing Length: Adjusts the noise reduction for price data.
Momentum Window: Controls the length of the momentum calculation.
Volatility Threshold: Sets the minimum volatility level required for trade triggers.
Take Profit and Stop Loss: Defines the profit and risk limits for each trade.
Martingale Multiplier: Determines how much to increase the lot size after a losing trade.
Maximum Lot Size: Caps the lot size to prevent excessive risk.
Applications:
Optimized for BTC/USDT trading, particularly on volatile short-term timeframes like 15-minute and 5-minute charts.
Suitable for traders using scalping or intraday strategies looking to exploit high-probability patterns.
Combines advanced statistical techniques with adaptive risk management for robust performance.