RBF Kijun Trend System [InvestorUnknown]The RBF Kijun Trend System utilizes advanced mathematical techniques, including the Radial Basis Function (RBF) kernel and Kijun-Sen calculations, to provide traders with a smoother trend-following experience and reduce the impact of noise in price data. This indicator also incorporates ATR to dynamically adjust smoothing and further minimize false signals.
Radial Basis Function (RBF) Kernel Smoothing
The RBF kernel is a mathematical method used to smooth the price series. By calculating weights based on the distance between data points, the RBF kernel ensures smoother transitions and a more refined representation of the price trend.
The RBF Kernel Weighted Moving Average is computed using the formula:
f_rbf_kernel(x, xi, sigma) =>
math.exp(-(math.pow(x - xi, 2)) / (2 * math.pow(sigma, 2)))
The smoothed price is then calculated as a weighted sum of past prices, using the RBF kernel weights:
f_rbf_weighted_average(src, kernel_len, sigma) =>
float total_weight = 0.0
float weighted_sum = 0.0
// Compute weights and sum for the weighted average
for i = 0 to kernel_len - 1
weight = f_rbf_kernel(kernel_len - 1, i, sigma)
total_weight := total_weight + weight
weighted_sum := weighted_sum + (src * weight)
// Check to avoid division by zero
total_weight != 0 ? weighted_sum / total_weight : na
Kijun-Sen Calculation
The Kijun-Sen, a component of Ichimoku analysis, is used here to further establish trends. The Kijun-Sen is computed as the average of the highest high and the lowest low over a specified period (default: 14 periods).
This Kijun-Sen calculation is based on the RBF-smoothed price to ensure smoother and more accurate trend detection.
f_kijun_sen(len, source) =>
math.avg(ta.lowest(source, len), ta.highest(source, len))
ATR-Adjusted RBF and Kijun-Sen
To mitigate false signals caused by price volatility, the indicator features ATR-adjusted versions of both the RBF smoothed price and Kijun-Sen.
The ATR multiplier is used to create upper and lower bounds around these lines, providing dynamic thresholds that account for market volatility.
Neutral State and Trend Continuation
This indicator can interpret a neutral state, where the signal is neither bullish nor bearish. By default, the indicator is set to interpret a neutral state as a continuation of the previous trend, though this can be adjusted to treat it as a truly neutral state.
Users can configure this setting using the signal_str input:
simple string signal_str = input.string("Continuation of Previous Trend", "Treat 0 State As", options = , group = G1)
Visual difference between "Neutral" (Bottom) and "Continuation of Previous Trend" (Top). Click on the picture to see it in full size.
Customizable Inputs and Settings:
Source Selection: Choose the input source for calculations (open, high, low, close, etc.).
Kernel Length and Sigma: Adjust the RBF kernel parameters to change the smoothing effect.
Kijun Length: Customize the lookback period for Kijun-Sen.
ATR Length and Multiplier: Modify these settings to adapt to market volatility.
Backtesting and Performance Metrics
The indicator includes a Backtest Mode, allowing users to evaluate the performance of the strategy using historical data. In Backtest Mode, a performance metrics table is generated, comparing the strategy's results to a simple buy-and-hold approach. Key metrics include mean returns, standard deviation, Sharpe ratio, and more.
Equity Calculation: The indicator calculates equity performance based on signals, comparing it against the buy-and-hold strategy.
Performance Metrics Table: Detailed performance analysis, including probabilities of positive, neutral, and negative returns.
Alerts
To keep traders informed, the indicator supports alerts for significant trend shifts:
// - - - - - ALERTS - - - - - //{
alert_source = sig
bool long_alert = ta.crossover (intrabar ? alert_source : alert_source , 0)
bool short_alert = ta.crossunder(intrabar ? alert_source : alert_source , 0)
alertcondition(long_alert, "LONG (RBF Kijun Trend System)", "RBF Kijun Trend System flipped ⬆LONG⬆")
alertcondition(short_alert, "SHORT (RBF Kijun Trend System)", "RBF Kijun Trend System flipped ⬇Short⬇")
//}
Important Notes
Calibration Needed: The default settings provided are not optimized and are intended for demonstration purposes only. Traders should adjust parameters to fit their trading style and market conditions.
Neutral State Interpretation: Users should carefully choose whether to treat the neutral state as a continuation or a separate signal.
Backtest Results: Historical performance is not indicative of future results. Market conditions change, and past trends may not recur.
Wskaźniki i strategie
HMA w(LRLR)Description: This script combines a customizable Hull Moving Average (HMA) with a Low Resistance Liquidity Run (LRLR) detection system, ideal for identifying trend direction and potential breakout points in a single overlay.
Features:
Hull Moving Average (HMA):
Select separate calculation sources (open, high, low, close) for short and long periods.
Choose from SMA, EMA, and VWMA for length type on both short and long periods, offering flexible moving average calculations to suit different trading strategies.
Color-coded HMA line that visually changes based on crossover direction, providing an intuitive view of market trends.
Customizable options for line thickness, color transparency, and band fill between HMA short and long lines.
Low Resistance Liquidity Run (LRLR):
Detects breakout signals based on price and volume conditions, identifying potential liquidity run levels.
User-defined length and breakout multiplier control breakout sensitivity and adjust standard deviation-based thresholds.
Color-coded visual markers for bullish and bearish LRLR signals, customizable for user preference.
Alerts for both bullish and bearish LRLR events, keeping users informed of potential trading opportunities.
This script allows traders to visually track the HMA trend direction while also spotting low-resistance liquidity opportunities, all on one chart overlay.
Disclaimer: This tool is intended for educational purposes only and should not be used solely to make trading decisions. Adjust parameters as needed, and consider additional analysis for comprehensive decision-making.
Zig Zag with Adaptive ProjectionThe "Zig Zag with Adaptive Projection" is an advanced technical analysis tool designed for TradingView's Pine Script platform. This indicator builds upon the traditional ZigZag concept by incorporating adaptive projection capabilities, offering traders a more sophisticated approach to identifying significant price movements and forecasting potential future price levels.
At its core, the indicator utilizes a user-defined period to calculate and display the ZigZag pattern on the chart. This pattern connects significant highs and lows, effectively filtering out minor price fluctuations and highlighting the overall trend structure. Users can customize the appearance of the ZigZag lines, including their color, style (solid, dashed, or dotted), and width, allowing for easy visual integration with other chart elements.
What sets this indicator apart is its adaptive projection feature. By analyzing historical ZigZag patterns, the indicator calculates average lengths and slopes of both bullish and bearish trends. This data is then used to project potential future price movements, adapting to the current market context. The projection lines extend from the most recent ZigZag point, offering traders a visual representation of possible price targets based on historical behavior.
The adaptive nature of the projections is particularly noteworthy. The indicator considers the current trend direction, the length of the most recent ZigZag segment, and compares it to historical averages. This approach allows for more nuanced projections that account for recent market dynamics. If the current trend is stronger than average, the projection will extend further, and vice versa.
From a technical standpoint, the indicator leverages Pine Script v5's capabilities, utilizing arrays for efficient data management and implementing dynamic line drawing for both the ZigZag and projection lines. This ensures smooth performance even when analyzing large datasets.
Traders can fine-tune the indicator to their preferences with several customization options. The ZigZag period can be adjusted from 10 to 100, allowing for sensitivity adjustments to match different trading timeframes. The projection lines can be toggled on or off and their appearance customized, providing flexibility in how the forecast is displayed.
In essence, the "Zig Zag with Adaptive Projection" indicator combines traditional trend analysis with forward-looking projections. It offers traders a tool to not only identify significant price levels but also to anticipate potential future movements based on historical patterns. This blend of retrospective analysis and adaptive forecasting makes it a valuable addition to a trader's technical analysis toolkit, particularly for those interested in trend-following strategies or looking for potential reversal points.
AI-Enhanced EMA & Linear Regression Trading Signals - *ETHKey Features:
Dynamic EMAs: Customize the EMA length to suit your trading strategy, helping you identify trends and potential reversals.
Moving Average Crossovers: Receive instant alerts when the short-term moving average crosses above or below the long-term moving average, signaling potential buy or sell opportunities.
Linear Regression Analysis: Leverage linear regression to predict future price movements, enhancing your decision-making process.
Visual Signals: Clear visual indicators for buy (green) and sell (red) signals, with bold white text for easy identification on any chart.
User-Friendly Inputs: Adjust parameters such as EMA length, moving average periods, and linear regression settings to tailor the indicator to your trading style.
BINANCE:ETHUSDT
Stock Booster// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © fluxchart
//@version=5
const bool DEBUG = false
const int maxDistanceToLastBar = 5000
const int labelCooldown = 8
const int KDELimit = 300
indicator("Stock Booster", overlay = true, max_labels_count = 500)
rsiLengthInput = input.int(14, minval = 1, title="RSI Length", group="RSI Settings")
rsiSourceInput = input.source(close, "Source", group="RSI Settings")
highPivotLen = input.int(21, "High Pivot Length", minval = 1, group = "Pivots", display = display.none)
lowPivotLen = input.int(21, "Low Pivot Length", minval = 1, group = "Pivots", display = display.none)
realPivotLabels = DEBUG ? input.bool(false, " Real Pivot Labels", group = "Pivots") : false
kdePivotLabels = DEBUG ? input.bool(false, " KDE Pivot Labels", group = "Pivots") : false
activationThresholdStr = input.string("Medium", "Activation Threshold", options = , group = "KDE", tooltip = "Determines the amount of arrows shown. Higher options will result in more arrows being rendered.")
string KDEKernel = input.string("Gaussian", "Kernel", options= , group = "KDE", tooltip = "The kernel function for KDE calculation. Gaussian is a commonly used kernel and is based on normal distribution.")
float KDEBandwidth = input.float(2.71828, "Bandwidth", group = "KDE", tooltip = "This setting sets the smoothness of the KDE function output.")
int KDEStep = input.int(100, "Nº Bins", minval = 1, group = "KDE", tooltip = "The number of elements the KDE Probability array will have. Higher settings will result in greater precision.")
activationThreshold = DEBUG ? input.float(0.25, " Activation Threshold", group = "KDE") : 0.25
if not DEBUG
activationThreshold := (activationThresholdStr == "High" ? 0.4 : activationThresholdStr == "Medium" ? 0.25 : 0.15)
probMode = DEBUG ? input.string("Sum", ' Probability Mode', options = , group = "KDE") : "Sum"
minPadding = DEBUG ? input.bool(false, ' KDE Min Padding', group = "KDE") : false
tableEnabled = input.bool(true, "Dashboard", group = "Dashboard", display = display.none)
tableLocation = input.string("Top Right", "Position", options = , group = "Dashboard", display = display.none)
screenerColor = input.color(#1B1F2B, 'Background', group = 'Dashboard', display = display.none)
frameColor = input.color(color.rgb(255, 255, 255), 'Frame', group = 'Dashboard', display = display.none)
borderColor = input.color(color.rgb(255, 255, 255), 'Border', group = 'Dashboard', display = display.none)
textColorDB = input.color(color.white, 'Text', group = 'Dashboard', display = display.none)
fillBackgrounds = input.bool(true, "Fill Backgrounds", group = "Dashboard", display = display.none)
bearishColor = input.color(#f23646, "High Pivots", group = "Style", inline = "col", display = display.none)
neutralColor = input.color(color.gray, "Neutral", group = "Style", inline = "col", display = display.none)
bullishColor = input.color(#089981, "Low Pivots", group = "Style", inline = "col", display = display.none)
textColor = input.color(color.white, 'Text', group = 'Style', inline = "col", display = display.none)
RSILabelsEnabled = input.bool(true, "RSI Labels", group = "Style")
KDELabelsEnabled = input.bool(true, "KDE Labels", group = "Style")
rsi = ta.rsi(rsiSourceInput, rsiLengthInput)
getPosition (positionText) =>
if positionText == "Top Right"
position.top_right
else if positionText == "Top Center"
position.top_center
else if positionText == "Right Center"
position.middle_right
else if positionText == "Left Center"
position.middle_left
else if positionText == "Bottom Center"
position.bottom_center
else if positionText == "Middle Center"
position.middle_center
//#region KDE
gaussian (float distance, float bandwidth = 1.0) => 1.0 / math.sqrt(2.0 * math.pi) * math.pow(math.e, -0.5 * math.pow(distance / bandwidth, 2.0))
uniform (float distance, float bandwidth = 1.0) => (math.abs(distance) > bandwidth) ? 0.0 : 0.5
sigmoid (float distance, float bandwidth = 1.0) => 2.0 / math.pi * (1.0 / (math.pow(math.e, (distance / bandwidth)) + math.pow(math.e, -(distance / bandwidth))))
kde (array arr, string kernel, float bandwidth, int steps) =>
arrSize = arr.size()
arrRange = arr.range()
arrMin = arr.min() - (minPadding ? (arrRange / 2.0) : 0)
stepCount = arrRange / steps
densityRange = array.new(steps * 2)
for i = 0 to (steps * 2) - 1
densityRange.set(i, arrMin + i * stepCount)
xArr = array.new()
yArr = array.new()
for i = 0 to densityRange.size() - 1
float temp = 0
for j = 0 to arr.size() - 1
switch KDEKernel
"Gaussian" => temp += gaussian(densityRange.get(i) - arr.get(j), 1.0 / bandwidth)
"Uniform" => temp += uniform(densityRange.get(i) - arr.get(j), 1.0 / bandwidth)
"Sigmoid" => temp += sigmoid(densityRange.get(i) - arr.get(j), 1.0 / bandwidth)
xArr.push(densityRange.get(i))
yArr.push(1.0 / arrSize * temp)
//#endregion
//#region Pivots
prefixSum (array arr, int l, int r) =>
arr.get(r) - (l == 0 ? 0 : arr.get(l - 1))
float MidKDEHigh = na
float MidKDELow = na
var array KDEHighX = na
var array KDEHighY = na
var array KDEHighYSum = array.new()
var array KDELowX = na
var array KDELowY = na
var array KDELowYSum = array.new()
highPivot = ta.pivothigh(highPivotLen, highPivotLen)
lowPivot = ta.pivotlow(lowPivotLen, lowPivotLen)
var highPivotRSIs = array.new()
var lowPivotRSIs = array.new()
if not na(highPivot)
if highPivotRSIs.size() > KDELimit
highPivotRSIs.remove(0)
highPivotRSIs.push(rsi )
= kde(highPivotRSIs, KDEKernel, KDEBandwidth, KDEStep)
KDEHighX := KDEHighX1
KDEHighY := KDEHighY1
KDEHighYSum.clear()
temp = 0.0
for i = 0 to KDEHighY.size() - 1
temp += KDEHighY.get(i)
KDEHighYSum.push(temp)
MidKDEHigh := array.get(KDEHighX, array.indexof(KDEHighY, array.max(KDEHighY)))
if not na(lowPivot)
if lowPivotRSIs.size() > KDELimit
lowPivotRSIs.remove(0)
lowPivotRSIs.push(rsi )
= kde(lowPivotRSIs, KDEKernel, KDEBandwidth, KDEStep)
KDELowX := KDELowX1
KDELowY := KDELowY1
KDELowYSum.clear()
temp = 0.0
for i = 0 to KDELowY.size() - 1
temp += KDELowY.get(i)
KDELowYSum.push(temp)
MidKDELow := array.get(KDELowX, array.indexof(KDELowY, array.max(KDELowY)))
//#endregion
//#region KDE Optimization
f_lin_interpolate(float x0, float x1, float y0, float y1, float x) =>
y0 + (x - x0) * (y1 - y0) / (x1 - x0)
float lowProb = na
float maxLowProb = na
float highProb = na
float maxHighProb = na
if last_bar_index - maxDistanceToLastBar < bar_index
if highPivotRSIs.size() > 0
highXIndexL = array.binary_search_leftmost(KDEHighX, rsi)
highXIndexR = math.min(array.binary_search_rightmost(KDEHighX, rsi), KDEHighX.size() - 1)
nearestIndex = (math.abs(rsi - KDEHighX.get(highXIndexL)) < math.abs(rsi - KDEHighX.get(highXIndexR))) ? highXIndexL : highXIndexR
if probMode == "Nearest"
highProb := KDEHighY.get(nearestIndex)
maxHighProb := array.max(KDEHighY)
else if probMode == "Sum"
highProb := prefixSum(KDEHighYSum, 0, nearestIndex)
if lowPivotRSIs.size() > 0
lowXIndexL = array.binary_search_leftmost(KDELowX, rsi)
lowXIndexR = math.min(array.binary_search_rightmost(KDELowX, rsi), KDELowX.size() - 1)
nearestIndex = (math.abs(rsi - KDELowX.get(lowXIndexL)) < math.abs(rsi - KDELowX.get(lowXIndexR))) ? lowXIndexL : lowXIndexR
if probMode == "Nearest"
lowProb := KDELowY.get(nearestIndex)
maxLowProb := array.max(KDELowY)
else if probMode == "Sum"
lowProb := prefixSum(KDELowYSum, nearestIndex, KDELowYSum.size() - 1)
if DEBUG and barstate.islastconfirmedhistory
for i = 0 to KDELowX.size() - 1
curX = KDELowX.get(i)
curY = KDELowY.get(i)
log.info(str.tostring(curX) + " = " + str.tostring(curY))
log.info("High Y Sum " + str.tostring(KDEHighY.sum()))
diffToHighKDE = math.abs(rsi - MidKDEHigh)
diffToLowKDE = math.abs(rsi - MidKDELow)
//#endregion
//#region Draw Pivots
color curColor = na
if (not na(KDELowY)) and (not na(KDEHighY))
if probMode == "Nearest"
if math.abs(lowProb - maxLowProb) < activationThreshold / 50.0
curColor := bullishColor
if math.abs(highProb - maxHighProb) < activationThreshold / 50.0
curColor := bearishColor
else if probMode == "Sum"
if lowProb > KDELowY.sum() * (1.0 - activationThreshold)
curColor := bullishColor
else if highProb > KDEHighY.sum() * (1.0 - activationThreshold)
curColor := bearishColor
//barcolor(curColor)
atr = ta.atr(50)
plotarrow(curColor == bullishColor and barstate.isconfirmed ? 1 : na, "Bullish Arrows", color.new(bullishColor, 70), color.new(bullishColor, 70), minheight = 20, maxheight = 20)
plotarrow(curColor == bearishColor and barstate.isconfirmed ? -1 : na, "Bearish Arrows", color.new(bearishColor, 70), color.new(bearishColor, 70), minheight = 20, maxheight = 20)
plotarrow((na(curColor) and curColor == bullishColor and barstate.isconfirmed) ? 1 : na, "Possible Bullish Pivot", bullishColor, bullishColor, minheight = 20, maxheight = 20)
plotarrow((na(curColor) and curColor == bearishColor and barstate.isconfirmed) ? -1 : na, "Possible Bearish Pivot", bearishColor, bearishColor, minheight = 20, maxheight = 20)
alertcondition(na(curColor) and curColor == bullishColor and barstate.isconfirmed, "Possible Bullish Pivot")
alertcondition(na(curColor) and curColor == bearishColor and barstate.isconfirmed, "Possible Bearish Pivot")
if KDELabelsEnabled or RSILabelsEnabled
var lastBullishLabel = 0
if (na(curColor) and curColor == bullishColor and barstate.isconfirmed) and (bar_index - lastBullishLabel) > labelCooldown
lastBullishLabel := bar_index
txt = ""
if RSILabelsEnabled and KDELabelsEnabled
txt := "RSI | " + str.tostring(rsi, "#") + " | " + str.tostring(lowProb * 100, "#.##") + "%"
else if RSILabelsEnabled
txt := "RSI | " + str.tostring(rsi, "#")
else
txt := str.tostring(rsi, "#") + "%"
label.new(bar_index, low, txt, yloc = yloc.belowbar, color = na, style = label.style_label_up, textcolor = textColor, force_overlay = true)
var lastBearishLabel = 0
if (na(curColor) and curColor == bearishColor and barstate.isconfirmed) and (bar_index - lastBearishLabel) > labelCooldown
lastBearishLabel := bar_index
txt = ""
if RSILabelsEnabled and KDELabelsEnabled
txt := "RSI | " + str.tostring(rsi, "#") + " | " + str.tostring(highProb * 100, "#.##") + "%"
else if RSILabelsEnabled
txt := "RSI | " + str.tostring(rsi, "#")
else
txt := str.tostring(rsi, "#") + "%"
label.new(bar_index, low, txt, yloc = yloc.abovebar, color = na, style = label.style_label_down, textcolor = textColor, force_overlay = true)
if kdePivotLabels
txt = str.tostring(rsi, "#.##") + " HP -> " + str.tostring(highProb, "#.##") + " LP -> " + str.tostring(lowProb, "#.##") + " MHP -> " + str.tostring(maxHighProb, "#.##") + " MLP -> " + str.tostring(maxLowProb, "#.##")
if math.abs(lowProb - maxLowProb) < activationThreshold
label.new(bar_index, high, txt, yloc = yloc.belowbar, color = textColor, style = label.style_label_up, textcolor = color.black, force_overlay = true)
if math.abs(highProb - maxHighProb) < activationThreshold
label.new(bar_index, high, txt, yloc = yloc.abovebar, color = textColor, style = label.style_label_down, textcolor = color.black, force_overlay = true)
if realPivotLabels
if not na(highPivot)
txt = str.tostring(rsi , "#.##") + " HP -> " + str.tostring(highProb , "#.##") + " LP -> " + str.tostring(lowProb , "#.##") + " MHP -> " + str.tostring(maxHighProb , "#.##") + " MLP -> " + str.tostring(maxLowProb , "#.##")
label.new(bar_index - highPivotLen, high, txt, yloc = yloc.abovebar, color = textColor, style = label.style_label_down, textcolor = color.black, force_overlay = true)
if not na(lowPivot)
txt = str.tostring(rsi , "#.##") + " HP -> " + str.tostring(highProb , "#.##") + " LP -> " + str.tostring(lowProb , "#.##") + " MHP -> " + str.tostring(maxHighProb , "#.##") + " MLP -> " + str.tostring(maxLowProb , "#.##")
label.new(bar_index - lowPivotLen, high, txt, yloc = yloc.belowbar, color = textColor, style = label.style_label_up, textcolor = color.black, force_overlay = true)
//#endregion
if tableEnabled
var table realtimeTable = table.new(getPosition(tableLocation), 2, 10, bgcolor = screenerColor, frame_width = 2, frame_color = frameColor, border_width = 1, border_color = borderColor)
// Header
table.merge_cells(realtimeTable, 0, 0, 1, 0)
table.cell(realtimeTable, 0, 0, "KDE Optimized RSI", text_color = textColorDB, bgcolor = screenerColor)
// RSI
table.cell(realtimeTable, 0, 1, "RSI", text_color = textColorDB, bgcolor = screenerColor)
table.cell(realtimeTable, 1, 1, str.tostring(rsi, "#"), text_color = textColorDB, bgcolor = screenerColor)
// KDE
table.cell(realtimeTable, 0, 2, (lowProb > highProb) ? "Bullish KDE" : "Bearish KDE", text_color = (lowProb > highProb) ? bullishColor : bearishColor, bgcolor = screenerColor)
table.cell(realtimeTable, 1, 2, str.tostring(nz(math.max(highProb, lowProb), 0) * 100, "#.##") + "%", text_color = textColorDB, bgcolor = screenerColor)
Support Resistance & cam ppThis code offers a comprehensive approach to dynamically plotting support and resistance zones with multi-timeframe capabilities, adjustable alerts, and customizable display options, making it useful for technical traders looking to identify key price levels.
Conject28 3in1 Trend IndicatorHere's an indicator to help you identify trends. This indicator is a combination of three indicators. It is a combination of EMA 200, Linreg, and Nadaraya Watson indicators. It works on 1-hour, 4-hour, daily, and weekly timeframes.
ATR TrailStop w/Fib Targets MTFThis study is a pineview expresion of the ideas found in the Tradovate ATR TrailStop w/Fib Targets.
It identifies trends and provides a trailing stop and profit targets.
The trailing stop is calculated as the average true range using your selected average type and your specified ATR period and then multiplied by your specified ATR factor. Fibonacci values are used to indicate possible areas of support or resistance as price approaches the trailing stop.
Profit targets are calculated using common Fibonacci extension values.
The defaults are a good starting point to get comfortable with this indicator. The adjustable parameters allow for a wide range of experimentation.
For some truly remarkable results, combine time frames and only trade the lower time frame in the same direction as the higher time frame.
Jayadev-Breakout SignalsIndicator Name: Jayadev - Breakout Signals
Description:
The "Jayadev - Breakout Signals" indicator is designed to assist traders in identifying potential breakout opportunities in the market. By combining Bollinger Bands, Exponential Moving Averages (EMA), and key candlestick patterns, this indicator helps pinpoint significant price movements and potential reversal points.
Key Features:
Bollinger Bands: The indicator includes customizable Bollinger Bands that help visualize volatility and potential price breakouts. Traders can adjust the length and standard deviation to fit their trading style.
EMA: A 12-period EMA is plotted to identify the trend direction, providing additional context for potential buy or sell signals.
Candlestick Patterns Detection: The indicator detects several key candlestick patterns, including:
Hammer
Inverted Hammer
Bullish Engulfing
Hanging Man
Shooting Star
Bearish Engulfing
These patterns are integral for understanding market sentiment and making informed trading decisions.
Buy and Sell Signals:
Sell Signal: Triggered when the price closes below the lower Bollinger Band and the previous swing low. Position size is calculated based on a defined risk amount.
Buy Signal: Activated when the price closes above the upper Bollinger Band and the previous swing high, with position size also calculated based on risk.
Visual Annotations: The indicator provides visual cues on the chart, marking buy and sell signals along with the calculated position size, enabling traders to act swiftly on opportunities.
Usage: This indicator is particularly effective for day traders and swing traders looking to capitalize on volatility and price momentum. It works best in trending markets and can be used in conjunction with other technical analysis tools for enhanced trading strategies.
Notes:
Adjust the settings of the Bollinger Bands and EMA to fit your trading preferences.
Always apply risk management techniques when trading based on indicator signals.
BinhMycoĐoạn mã này xây dựng một công cụ dự đoán xu hướng giá dựa trên dữ liệu lịch sử và các công cụ tính toán xác suất. Dưới đây là mô tả về từng phần của code:
1. **Cài đặt thông số ban đầu**:
- `src`: nguồn dữ liệu đầu vào, mặc định là giá mở cửa.
- `len`: độ dài của dữ liệu đào tạo.
- `leng` và `length`: độ dài tham chiếu và dự báo cố định.
- `mult`: hệ số dùng để tính toán biên độ sai lệch.
- `typ` và `dirtyp`: lựa chọn loại dự báo (Dự đoán hoặc Lặp lại) và hướng dự báo (Trung bình hoặc Đỉnh đáy).
- `divcone`: bật hoặc tắt biên sai lệch dự báo.
- Màu sắc được thiết lập cho các yếu tố đồ họa như: màu tăng, màu giảm, màu dữ liệu tham chiếu, màu dự báo, v.v.
2. **Xử lý lỗi và điều kiện ràng buộc**:
- Kiểm tra xem `leng` không được vượt quá một nửa `len` và `length` không vượt quá `leng`. Nếu vi phạm, chương trình sẽ báo lỗi.
3. **Tính toán dữ liệu tương tự nhất**:
- Sử dụng hàm tương quan (`ta.correlation`) để tìm ra các thanh giá (bars) có độ tương quan cao nhất với dữ liệu tham chiếu nhằm xác định điểm tương đồng trong lịch sử giá.
4. **Dọn dẹp và quản lý các đối tượng đồ họa**:
- Xóa các đường dự báo và nón sai lệch cũ trước khi vẽ các đường mới để tránh chồng chéo dữ liệu.
5. **Hàm hỗ trợ tính toán giá trị cao nhất và thấp nhất**:
- `highest_range` và `lowest_range` được sử dụng để tìm giá cao nhất và thấp nhất trong một khoảng thời gian xác định.
6. **Các hàm dự báo**:
- `ftype`, `ftypediff`, `ftypelim`, `ftypeleft`, `ftyperight` giúp tính toán vị trí và khoảng cách của các giá trị dự báo dựa trên loại dự báo (`Dự đoán` hoặc `Lặp lại`).
7. **Vẽ đường dự báo và nón sai lệch**:
- Tính toán giá dự báo dựa trên dữ liệu lịch sử tương tự, và vẽ các đường dự báo với màu sắc tương ứng (màu xanh nếu xu hướng dự báo tăng, màu đỏ nếu dự báo giảm).
- Tính toán biên độ trên (`upper`) và biên độ dưới (`lower`) của nón sai lệch và vẽ nón sai lệch nếu `divcone` được bật.
8. **Bảng thông tin xác suất**:
- Tính xác suất khớp của dự báo và hiển thị dưới dạng bảng thông tin ở góc dưới bên phải màn hình, với các màu nền và màu chữ thay đổi dựa trên giá trị xác suất (xanh nếu tích cực, đỏ nếu tiêu cực).
### Tóm tắt
Đoạn mã này dựa trên dữ liệu lịch sử để tìm các mẫu tương đồng trong quá khứ, từ đó tạo ra dự báo giá trong tương lai kèm theo biên sai lệch để biểu thị độ tin cậy của dự báo. Kết quả sẽ được hiển thị trực quan dưới dạng các đường dự báo trên biểu đồ giá cùng với một bảng thông tin xác suất để đánh giá độ tin cậy của dự báo.
EMA Crossover Strategy Explanation:
Input Parameters:
fastEMA: Defines the period for the faster EMA (default: 5).
slowEMA: Defines the period for the slower EMA (default: 10).
EMA Calculation:
fastMA: Calculates the fast EMA using the ta.ema function.
slowMA: Calculates the slow EMA using the ta.ema function.
Plotting EMAs:
Plots the fast EMA as a green line and the slow EMA as a red line.
Signal Generation:
buySignal: Generates a buy signal when the fast EMA crosses above the slow EMA.
sellSignal: Generates a sell signal when the fast EMA crosses below the slow EMA.
Plotting Signals:
Plots buy signals as green upward triangles and sell signals as red downward triangles.
Note:
This is a basic implementation of the strategy. You can customize it further by adding stop-loss and take-profit levels, filtering signals with additional indicators, or optimizing parameters.
Always test your strategy on historical data before using it in live trading.
Risk management is crucial in trading. Use stop-loss orders to limit potential losses.
Consider consulting with a financial advisor before making any investment decisions.
Trend and Breakout Indicator (MATZAMANI)//@version=5
indicator("Trend and Breakout Indicator", overlay=true)
// Kullanıcıdan hareketli ortalama için periyodu al
maLength = input.int(50, title="Moving Average Length", minval=1)
// Hareketli ortalama hesapla
ma = ta.sma(close, maLength)
// En yüksek tepe ve en düşük dipleri belirle
highestHigh = ta.highest(high, 20) // Son 20 mumdaki en yüksek
lowestLow = ta.lowest(low, 20) // Son 20 mumdaki en düşük
// Kırılma koşulları
breakoutUp = close > highestHigh // Önceki en yüksek seviyenin üzerine çıkış
breakoutDown = close < lowestLow // Önceki en düşük seviyenin altına iniş
// Onaylı yükseliş ve düşüş bölgeleri
var float lastBreakoutHigh = na
var float lastBreakoutLow = na
if (breakoutUp)
lastBreakoutHigh := close // Yükseliş onayı
if (breakoutDown)
lastBreakoutLow := close // Düşüş onayı
// Yükseliş ve düşüş bölgelerini çiz
plotshape(breakoutUp, title="Breakout Up", location=location.belowbar, color=color.green, style=shape.labelup, text="UP")
plotshape(breakoutDown, title="Breakout Down", location=location.abovebar, color=color.red, style=shape.labeldown, text="DOWN")
// Hareketli ortalamayı çiz
plot(ma, color=color.blue, linewidth=2, title="Moving Average")
// Onaylı bölgeleri göster
plot(lastBreakoutHigh, color=color.green, linewidth=2, style=plot.style_stepline, title="Confirmed High")
plot(lastBreakoutLow, color=color.red, linewidth=2, style=plot.style_stepline, title="Confirmed Low")
// Alarm koşulları
alertcondition(breakoutUp, title="Breakout Up Alert", message="Yükseliş onayı!")
alertcondition(breakoutDown, title="Breakout Down Alert", message="Düşüş onayı!")
ALAN GINTING//@version=5
indicator('GainzAlgo 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')
Continuation Gap Trading Strategythis will be usefull for identifying continious trend gap ,higer the time trame the more will be accurate
Dynamic Trading Strategy with Key Levels, Entry/Exit ManagementThis indicator provides a complete rule-based trading system, combining key levels, entry conditions, stop loss (SL), and take profit (TP) management. It’s designed to dynamically adapt to market conditions by identifying crucial support and resistance zones, determining entry points based on price action and volume, and calculating risk-based exit targets.
Key Features
Key Level Identification:
The indicator automatically identifies support and resistance levels based on recent price highs and lows within a customizable lookback period.
It adds a dynamic buffer around these levels using the Average True Range (ATR) to account for market volatility, ensuring the zones adjust to changing conditions.
Entry Conditions:
Bullish Entry: Triggers near the support zone when there’s upward price action, confirmed by volume spikes and bullish candlestick patterns (e.g., hammers, engulfing candles).
Bearish Entry: Triggers near the resistance zone when signs of rejection appear, confirmed by volume spikes and bearish candlestick patterns (e.g., shooting stars, bearish engulfing).
Entry zones are highlighted visually on the chart using green (bullish) and red (bearish) shaded boxes.
Stop Loss (SL) and Take Profit (TP):
Stop Loss: Calculated based on ATR multipliers, allowing you to set a volatility-adjusted risk level beyond the entry range.
Take Profit: Includes two profit-taking levels (TP1 and TP2), allowing for partial position exits. TP levels are calculated based on a reward-to-risk ratio, ensuring consistent profitability targets.
SL and TP levels are clearly marked with horizontal lines and labeled as SL, TP1, and TP2, helping you manage trade exits effectively.
Market Context Adaptability:
The indicator adapts to both trending and ranging market conditions. In trending markets, it favors trades that follow the trend, while in ranging markets, it focuses on reversals within the range boundaries.
Visual Aids:
Entry zones are highlighted with shaded boxes to indicate potential buy/sell regions.
SL, TP1, and TP2 levels are clearly drawn with labels, allowing for easy identification of exit points.
How to Use
Identify Key Levels: Look for support and resistance zones highlighted by the indicator on your chart.
Wait for Entry Conditions: When the price enters the entry range (marked by green or red boxes), wait for confirmation signals—such as volume spikes and candlestick patterns.
Manage Exits: Use the SL, TP1, and TP2 levels for structured trade management. Consider scaling out partially at TP1 and exiting fully at TP2.
Ideal For:
This indicator is suitable for traders who prefer a systematic approach to trading, with clear entry and exit rules. It is particularly helpful for those looking to balance risk and reward with well-defined take profit and stop loss levels.
Adaptive Support & Resistance Zones Description:
The Enhanced Support and Resistance Zones indicator identifies and visualizes significant support and resistance areas on the chart, helping traders spot potential reversal or breakout points. This tool offers advanced customization options for zone thickness, lookback period, validation criteria, and zone expiration, making it adaptable for various trading styles and market conditions.
Key Features:
1. Zone Thickness Multiplier: The Zone Thickness Multiplier controls the visual “thickness” of each support and resistance zone, allowing traders to adjust the width based on volatility or personal preference. A higher multiplier increases the zone’s range, capturing a wider area around the support or resistance level.
2. Lookback Periods for Support and Resistance: The Lookback for Resistance and Lookback for Support inputs define the number of bars analyzed to identify swing highs and lows, respectively. This allows traders to adjust how far back the script should search for key levels, which can be useful when adjusting for different timeframes or varying levels of historical significance in zones.
3. Minimum Touch Count: To filter out weak zones, the Minimum Touch Count setting establishes the required number of price “touches” (or tests) within a zone before it’s considered valid. By increasing this value, traders can focus only on zones that the price has interacted with frequently, indicating stronger potential support or resistance.
4. Zone Expiration Bars: The Zone Expiration Bars setting enables automatic expiration of older zones, reducing chart clutter from outdated levels. This parameter specifies the maximum number of bars a zone will remain active after its creation. When the set limit is reached, the zone is cleared, allowing the indicator to stay responsive to more recent price action.
5. Dynamic Visualization by Touch Count: Zones with more touches are displayed with a thicker line, visually emphasizing the strength of these areas. Zones with fewer touches are shown with a thinner line, helping traders easily distinguish between stronger and weaker support and resistance levels.
6. Alerts for Zone Touches: Alerts can be configured to notify traders when the price touches the support or resistance zones, offering real-time notifications for potential trading opportunities.
How to Use:
1. Adjusting Zone Thickness: Use the Zone Thickness Multiplier to expand or contract the width of each zone. A higher multiplier may be beneficial in volatile markets, where price tends to fluctuate around levels rather than touching them precisely. Lower values can provide a more precise zone in less volatile environments.
2. Setting Lookback Periods for Zone Identification: The Lookback for Resistance and Lookback for Support inputs allow traders to define how many historical bars to analyze for determining key levels. Longer lookbacks may be useful on higher timeframes to capture more significant support or resistance, while shorter lookbacks can be suitable for lower timeframes or more recent levels.
3. Filtering with Minimum Touch Count: Increase the Minimum Touch Count to filter for stronger zones. For example, setting a minimum touch count of 3 will display only zones that have been tested by the price at least three times, indicating potentially stronger support or resistance.
4. Configuring Zone Expiration: Use Zone Expiration Bars to limit how long each zone remains on the chart, helping to keep the focus on more recent levels. Expiring zones after a set number of bars can be especially useful on lower timeframes, where older levels may no longer be relevant.
5. Using Alerts for Real-Time Notifications: Set up alerts to receive notifications when price enters the support or resistance zones, allowing you to monitor potential trade setups without needing to watch the chart continuously.
This indicator is well-suited for traders aiming to identify high-quality support and resistance areas while managing chart clarity. With these customizable options, traders can adapt the indicator to match their unique trading style and market focus. For best results, test these settings on your preferred timeframe and adjust parameters to fit specific trading goals and market conditions.
Volume Based Price Prediction [EdgeTerminal]This indicator combines price action, volume analysis, and trend prediction to forecast potential future price movements. The indicator creates a dynamic prediction zone with confidence bands, helping you visualize possible price trajectories based on current market conditions.
Key Features
Dynamic price prediction based on volume-weighted trend analysis
Confidence bands showing potential price ranges
Volume-based candle coloring for enhanced market insight
VWAP and Moving Average overlay
Customizable prediction parameters
Real-time updates with each new bar
Technical Components:
Volume-Price Correlation: The indicator analyzes the relationship between price movements and volume, Identifies stronger trends through volume confirmation and uses Volume-Weighted Average Price (VWAP) for price equilibrium
Trend Strength Analysis: Calculates trend direction using exponential moving averages, weights trend strength by relative volume and incorporates momentum for improved accuracy
Prediction Algorithm: combines current price, trend, and volume metrics, projects future price levels using weighted factors and generates confidence bands based on price volatility
Customizable Parameters:
Moving Average Length: Controls the smoothing period for calculations
Volume Weight Factor: Adjusts how much volume influences predictions
Prediction Periods: Number of bars to project into the future
Confidence Band Width: Controls the width of prediction bands
How to use it:
Look for strong volume confirmation with green candles, watch for prediction line slope changes, use confidence bands to gauge potential volatility and compare predictions with key support/resistance levels
Some useful tips:
Start with default settings and adjust gradually
Use wider confidence bands in volatile markets
Consider prediction lines as zones rather than exact levels
Best applications of this indicator:
Trend continuation probability assessment
Potential reversal point identification
Risk management through confidence bands
Volume-based trend confirmation
TruSMC [LuxAlgoPlus]My first extended script.
I only added some things to the LuxAlgo SMC indicator because they help improve my analysis.
Range Detect SystemTechnical analysis indicator designed to identify potential significant price ranges and the distribution of volume within those ranges. The system helps traders calculate POC and show volume history. Also detecting breakouts or potential reversals. System identifies ranges with a high probability of price consolidation and helps screen out extreme price moves or ranges that do not meet certain volatility thresholds.
⭕️ Key Features
Range Detection — identifies price ranges where consolidation is occurring.
Volume Profile Calculation — indicator calculates the Point of Control (POC) based on volume distribution within the identified range, enhancing the analysis of market structure.
Volume History — shows where the largest volume was traded from the center of the range. If the volume is greater in the upper part of the range, the color will be green. If the volume is greater in the lower part, the color will be red.
Range Filtering — Includes multi-level filtering options to avoid ranges that are too volatile or outside normal ranges.
Visual Customization — Shows graphical indicators for potential bullish or bearish crossovers at the upper and lower range boundaries. Users can choose the style and color of the lines, making it easier to visualize ranges and important levels on the chart.
Alerts — system will notify you when a range has been created and also when the price leaves the range.
⭕️ How it works
Extremes (Pivot Points) are taken as a basis, after confirming the relevance of the extremes we take the upper and lower extremes and form a range. We check if it does not violate a number of rules and filters, perform volume calculations, and only then is the range displayed.
Pivot points is a built-in feature that shows an extremum if it has not been updated N bars to the left and N bars to the right. Therefore, there is a delay depending on the bars specified to check, which allows for a more accurate range. This approach allows not to make unnecessary recalculations, which completely eliminates the possibility of redrawing or range changes.
⭕️ Settings
Left Bars and Right Bars — Allows you to define the point that is the highest among the specified number of bars to the left and right of this point.
Range Logic — Select from which point to draw the range. Maximums only, Minimums only or both.
Use Wick — Option to consider the wick of the candles when identifying Range.
Breakout Confirmation — The number of bars required to confirm a breakout, after which the range will close.
Minimum Range Length — Sets the minimum number of candles needed for a range to be considered valid.
Row Size — Number of levels to calculate POC. *Larger values increase the script load.
% Range Filter — Dont Show Range is than more N% of Average Range.
Multi Filter — Allows use of Bollinger Bands, ATR, SMA, or Highest-Lowest range channels for filtering ranges based on volatility.
Range Hit — Shows graphical labels when price hits the upper or lower boundaries of the range, signaling potential reversal or breakout points.
Range Start — Show points where Range was created.
Supertrend with Buy and Sell SignalsThis Pine Script code is a Supertrend indicator for TradingView with added buy and sell signals based on trend changes. Here's a breakdown of each part:
1. Script Header
//@version=5 specifies that this script uses version 5 of Pine Script.
indicator("Supertrend with Buy and Sell Signals", overlay = true, timeframe = "", timeframe_gaps = true) sets up the indicator's name and settings:
overlay = true means the indicator will appear directly on the price chart.
timeframe and timeframe_gaps allow the indicator to work on different timeframes, but these are not customized in this script.
2. Input Parameters
atrPeriod = input.int(10, "ATR Length", minval = 1): An input parameter for the Average True Range (ATR) period, which influences the sensitivity of the Supertrend.
factor = input.float(3.0, "Factor", minval = 0.01, step = 0.01): An input parameter for the multiplier (factor) applied to the ATR value to calculate the Supertrend. This affects the distance between the Supertrend line and price.
3. Supertrend Calculation
= ta.supertrend(factor, atrPeriod): Calculates the Supertrend values and the trend direction:
supertrend gives the line level (either support or resistance).
direction returns the trend direction (positive for uptrend, negative for downtrend).
supertrend := barstate.isfirst ? na : supertrend: Ensures that the Supertrend line is not plotted on the very first bar.
4. Plotting the Supertrend Line
upTrend and downTrend plots the Supertrend line:
If direction is positive (uptrend), the line is green.
If direction is negative (downtrend), the line is red.
bodyMiddle = plot((open + close) / 2, "Body Middle", display = display.none): Calculates the midpoint of each bar for the background fill.
5. Background Fill
fill(bodyMiddle, upTrend, color.new(color.green, 90), fillgaps = false): Fills the background green during an uptrend.
fill(bodyMiddle, downTrend, color.new(color.red, 90), fillgaps = false): Fills the background red during a downtrend.
6. Buy and Sell Signal Conditions
buySignal = (direction > direction): A buy signal is generated when the trend changes from downtrend (negative direction) to uptrend (positive direction).
sellSignal = (direction < direction): A sell signal is generated when the trend changes from uptrend (positive direction) to downtrend (negative direction).
7. Plotting Buy and Sell Arrows
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy"): Plots a green "Buy" label below the bar when a buy signal is detected.
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell"): Plots a red "Sell" label above the bar when a sell signal is detected.
8. Alert Conditions
alertcondition(buySignal, title="Buy Alert", message="Supertrend turned green. Buy signal."): Creates an alert for the buy signal with a custom message.
alertcondition(sellSignal, title="Sell Alert", message="Supertrend turned red. Sell signal."): Creates an alert for the sell signal with a custom message.
Summary
This script generates buy and sell signals based on trend changes in the Supertrend indicator. When the Supertrend turns green (uptrend), a buy signal is generated; when it turns red (downtrend), a sell signal is generated. The background color also changes to reflect the trend, helping visually identify the trend direction.
Accurate Short-Term & Swing Trading SystemThe Short-Term Swing Trading System is a TradingView indicator designed to assist traders in identifying potential buy and sell opportunities based on recent price action. This script focuses on short-term trends by utilizing short lookback periods for calculating support and resistance levels, making it ideal for traders operating on daily or weekly charts.
Key Features:
• Dynamic Support and Resistance Levels: The script calculates support and resistance levels using a configurable lookback period, which defaults to the last 10 bars. These levels are crucial for identifying breakout and breakdown points in price action.
• Buy and Sell Signals:
• Buy Signal: Triggered when the closing price crosses above the recent resistance level. This indicates a potential upward momentum and a bullish sentiment in the market.
• Sell Signal: Triggered when the closing price crosses below the recent support level, indicating a potential downward momentum and bearish sentiment.
• Candle Highlighting: The script includes an option to highlight candles that indicate buy and sell zones.
• Green Candles: Represent buy signals, visually marking potential entry points.
• Red Candles: Represent sell signals, visually marking potential exit points.
• Optional Support and Resistance Visualization: Users can opt to display horizontal lines on the chart representing the calculated support and resistance levels. This visual aid helps traders quickly identify key price levels.
Parameters:
• Swing Length: This parameter sets the length of the swing used to calculate buy/sell signals. It is an integer value that defaults to 3.
• Lookback Period for Support/Resistance: This integer value determines the number of bars to consider when calculating the recent support and resistance levels. It defaults to 10 bars.
• Show Support/Resistance Levels: A boolean option that allows users to choose whether or not to display horizontal lines for support and resistance levels on the chart. This option is set to true by default.
• Highlight Buy/Sell Candles: This boolean option lets users choose whether to highlight candles based on the buy and sell signals. It is set to true by default.
Usage:
This script is suitable for swing traders looking for timely entry and exit points based on recent price movements. By analyzing breakouts and breakdowns from established support and resistance levels, traders can make informed decisions to capitalize on short-term price fluctuations.
Alerts:
The script includes built-in alert conditions for both buy and sell signals, allowing traders to set up notifications based on their trading strategy and preferences.
Conclusion:
The Short-Term Swing Trading System provides a straightforward yet effective approach to swing trading by focusing on recent price action and key technical levels. With its user-friendly parameters and visual cues, it is designed to enhance your trading strategy and improve your decision-making process in the dynamic market environment.
Señal Cambio Dirección ADX El indicador señala cambios abruptos en el ADX de 90° o menos, graficando con una señal roja cuando el cambio es decreciente y una azul cuando es creciente. Permite enviar notificaciones.