Stock Booster 2.0// 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)
Cycles
Globex Trap ZoneGlobex Trap Indicator
A powerful tool designed to identify potential trading opportunities by analyzing the relationship between Globex session ranges and Supply & Demand zones during regular trading hours.
Key Features
Tracks and visualizes Globex session price ranges
Identifies key Supply & Demand zones during regular trading hours
Highlights potential trap areas where price might experience significant reactions
Fully customizable time ranges and visual settings
Clear labeling of Globex highs and lows
How It Works
The indicator tracks two key periods:
Globex Session (Default: 6:00 PM - 9:30 AM)
Monitors overnight price action
Marks session high and low
Helps identify potential range breakouts
Supply & Demand Zone (Default: 8:00 AM - 11:00 AM)
Tracks price action during key market hours
Identifies potential reaction zones
Helps spot institutional trading areas
Best Practices for Using This Indicator
Use on 1-hour timeframe or lower for optimal visualization
Best suited for futures and other instruments traded during Globex sessions
Pay attention to areas where Globex range and Supply/Demand zones overlap
Use in conjunction with your existing trading strategy for confirmation
Recommended minimum of 10 days of historical data for context
Settings Explanation
Globex Session: Customizable time range for overnight trading session
Supply & Demand Zone: Adjustable time range for regular trading hours
Days to Look Back: Number of historical days to display (default: 10)
Visual Settings: Customizable colors and transparency for both zones
Important Notes
All times are based on exchange timezone
The indicator respects overnight sessions and properly handles timezone transitions
Historical data requirements: Minimum 10 days recommended
Performance impact: Optimized for smooth operation with minimal resource usage
Disclaimer
Past performance is not indicative of future results. This indicator is designed to be used as part of a comprehensive trading strategy and should not be relied upon as the sole basis for trading decisions.
Updates and Support
I actively maintain this indicator and welcome feedback from the trading community. Please feel free to leave comments or suggestions for improvements.
PropFX SMCIndicador de Estrutura de Mercado SMC para TradingView
Descrição: Este indicador identifica automaticamente a estrutura de mercado (Market Structure) com base nos Smart Money Concepts (SMC). Ele marca pontos de Higher Highs (HH), Higher Lows (HL), Lower Highs (LH) e Lower Lows (LL), facilitando a leitura de tendências. A lógica principal é auxiliar na identificação de fases de alta e baixa de maneira visual, ideal para traders de SMC que buscam entradas precisas.
Funcionalidades:
Detecção de Estrutura de Mercado: O indicador traça as principais zonas de reversão com base nos últimos pontos altos e baixos.
Identificação Automática de Mudanças de Estrutura: Quando uma nova alta ou baixa significativa é formada, o indicador ajusta automaticamente a estrutura, destacando uma possível mudança de tendência (exemplo: quando um HH é rompido e forma um LH, indicando possível reversão de alta para baixa).
Alertas Customizáveis: Configuração para alertas que notificam o trader quando a estrutura muda, sinalizando oportunidades de entrada ou saída de acordo com a lógica SMC.
Coloração Visual: Linhas e rótulos coloridos para destacar cada tipo de estrutura (alta, baixa) e fase da tendência (bullish, bearish), tornando a análise intuitiva.
Parâmetros de Configuração:
Tamanho de pivô para definição de pontos altos e baixos.
Sensibilidade para identificar rompimentos estruturais.
Opções de personalização de cores e visibilidade dos rótulos.
Aplicação: O indicador é ideal para traders que aplicam conceitos de Smart Money, permitindo rápida identificação da estrutura de mercado e suas mudanças, ajudando a planejar operações baseadas em fases de acumulação, distribuição e reversão de tendências.
Este indicador facilita a análise de SMC, permitindo que os traders identifiquem oportunidades de entrada e saída de forma rápida, com uma visão clara da estrutura de mercado atual.
Global OECD CLI Diffusion Index YoY vs MoMThe Global OECD Composite Leading Indicators (CLI) Diffusion Index is used to gauge the health and directional momentum of the global economy and anticipate changes in economic conditions. It usually leads turning points in the economy by 6 - 9 months.
How to read: Above 50% signals economic expansion across the included countries. Below 50% signals economic contraction.
The diffusion index component specifically shows the proportion of countries with positive economic growth signals compared to those with negative or neutral signals.
The OECD CLI aggregates data from several leading economic indicators including order books, building permits, and consumer and business sentiment. It tracks the economic momentum and turning points in the business cycle across 38 OECD member countries and several other Non-OECD member countries.
Low Price VolatilityI highlighted periods of low price volatility in the Nikkei 225 futures trading.
Average Up and Down Candles Streak with Predicted Next CandleThis indicator is designed to analyze price trends by examining the patterns of up and down streaks (consecutive bullish or bearish candles) over a defined period. It uses this data to provide insights on whether the next candle is likely to be bullish or bearish, and it visually displays relevant information on the chart.
Here’s a breakdown of what the indicator does:
1. Inputs and Parameters
Period (Candles): Defines the number of candles used to calculate the average length of bullish and bearish streaks. For example, if the period is set to 20, the indicator will analyze the past 20 candles to determine average up and down streak lengths.
Bullish/Bearish Bias Signal Toggle: These options allow users to show or hide visual signals (green or red circles) when there’s a bullish or bearish bias in the trend based on the indicator’s calculations.
2. Streak Calculation
The indicator looks at each candle within the period to identify if it closed up (bullish) or down (bearish).
Up Streak: The indicator counts consecutive bullish candles. When there’s a bearish candle, it resets the up streak count.
Down Streak: Similarly, it counts consecutive bearish candles and resets when a bullish candle appears.
Averages: Over the defined period, the indicator calculates the average length of up streaks and average length of down streaks. This provides a baseline to assess whether the current streak is typical or extended.
3. Current and Average Streak Display
The indicator displays the current up and down streak lengths alongside the average streak lengths for comparison. This data appears in a table on the chart, allowing you to see at a glance:
The current streak length (for both up and down trends)
The average streak length for up and down trends over the chosen period
4. Trend Prediction for the Next Candle
Next Candle Prediction: Based on the current streak and its comparison to the average, the indicator predicts the likely direction of the next candle:
Bullish: If the current up streak is shorter than the average up streak, suggesting that the bullish trend could continue.
Bearish: If the current down streak is shorter than the average down streak, indicating that the bearish trend may continue.
Neutral: If the current streak length is near the average, which could signal an upcoming reversal.
This prediction appears in a table on the chart, labeled as “Next Candle.”
5. Previous Candle Analysis
The Previous Candle entry in the table reflects the last completed candle (directly before the current candle) to show whether it was bullish, bearish, or neutral.
This data gives a reference point for recent price action and helps validate the next candle prediction.
6. Visual Signals and Reversal Zones
Bullish/Bearish Bias Signals: The indicator can plot green circles on bullish bias and red circles on bearish bias to highlight points where the trend is likely to continue.
Reversal Zones: If the current streak length reaches or exceeds the average, it suggests the trend may be overextended, indicating a potential reversal zone. The indicator highlights these zones with shaded backgrounds (green for possible bullish reversal, red for bearish) on the chart.
Summary of What You See on the Chart
Bullish and Bearish Bias Signals: Green or red circles mark areas of expected continuation in the trend.
Reversal Zones: Shaded areas in red or green suggest that the trend might be about to reverse.
Tables:
The Next Candle prediction table displays the trend direction of the previous candle and the likely trend of the next candle.
The Streak Information table shows the current up and down streak lengths, along with their averages for easy comparison.
Practical Use
This indicator is helpful for traders aiming to understand trend momentum and potential reversals based on historical patterns. It’s particularly useful for swing trading, where knowing the typical length of bullish or bearish trends can help in timing entries and exits.
Turnaround Tuesday IndikatorTurnaround Tuesday Indikator für den Einstieg am Montag Morgen nach Freitag
Price Move Exceed % Threshold & BE Evaluation1Handy to see history or quick back test of moves. Enter a decimal for percentage wanted and choose the time frame wanted . The occurrences of the up or down threshold are plotted in the panel as maroon or green squares and can be read as red or green text in the panel data and on the right hand scale . The last number in the panel is the average move for the chosen period.
My usage is mostly to see what % has been exceeded for break even prices of option trades. Example: in SPY a spread has a break even of 567 when the price is 570; I get the percentage of the $3 move by dividing 3/570 to get 0.0526 ; the results show as described above.
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.
Williams %R - Multi TimeframeThis indicator implements the William %R multi-timeframe. On the 1H chart, the curves for 1H (with signal), 4H, and 1D are displayed. On the 4H chart, the curves for 4H (with signal) and 1D are shown. On all other timeframes, only the %R and signal are displayed. The indicator is useful to use on 1H and 4H charts to find confluence among the different curves and identify better entries based on their alignment across all timeframes. Signals above 80 often indicate a potential bearish reversal in price, while signals below 20 often suggest a bullish price reversal.
Ido strategy RSI Oversold with MACD Buy Signal Indicator
This indicator combines the Relative Strength Index (RSI) and the Moving Average Convergence Divergence (MACD) to help identify potential buy signals based on oversold conditions and trend reversals. This script is designed for traders looking to identify entry points when an asset is likely undervalued (oversold) and showing bullish momentum.
How It Works
RSI Oversold Detection: The RSI measures the speed and change of price movements. This indicator flags when the RSI falls below 30, signaling that the asset may be oversold. The user can customize the RSI lookback period and the timeframe within which oversold conditions are considered relevant.
MACD Crossover: The MACD line crossing above the Signal line often indicates a shift to bullish momentum. In this script, a buy signal is generated when a MACD bullish crossover occurs after an RSI oversold condition has been met within a user-defined lookback window.
Buy Signal: A green triangle appears below the price chart each time both conditions are met—when the RSI has recently been in oversold territory and the MACD line crosses above the Signal line. This signal suggests that the asset may be positioned for a potential upward trend, providing a visual cue for entry points.
Customizable Settings
RSI Settings: Adjust the RSI source and period length.
MACD Settings: Customize the fast, slow, and signal lengths of the MACD to suit different market conditions.
Lookback Period: Define how many bars back to check for an RSI oversold condition before confirming a MACD crossover.
Visual Elements
Oversold Background Color: The background on the price chart is shaded red whenever the RSI is below 30.
Buy Signal: A green triangle is displayed on the chart to indicate a potential entry point when both conditions are met.
Alerts
This indicator includes optional alerts, allowing traders to receive notifications whenever the conditions for a buy signal are met, making it easier to monitor multiple assets and stay informed of trading opportunities.
This indicator is ideal for traders using a combination of momentum and trend reversal strategies, especially in volatile markets where oversold conditions often precede a trend change.
Multi-Timeframe Trend Strategy//@version=5
indicator("Multi-Timeframe Trend Strategy", overlay=true)
// Inputs for EMA
ema50_length = input(50, title="50 EMA Length")
ema200_length = input(200, title="200 EMA Length")
// Inputs for RSI
rsi_length = input(14, title="RSI Length")
rsi_overbought = input(70, title="RSI Overbought Level")
rsi_oversold = input(30, title="RSI Oversold Level")
// EMA calculations
ema50 = ta.ema(close, ema50_length)
ema200 = ta.ema(close, ema200_length)
// RSI calculation
rsi = ta.rsi(close, rsi_length)
// MACD calculations
= ta.macd(close, 12, 26, 9)
// Plot EMAs
plot(ema50, color=color.blue, linewidth=2, title="50 EMA")
plot(ema200, color=color.red, linewidth=2, title="200 EMA")
// Conditions for Long Entry
long_condition = (close > ema200) and (ta.crossover(close, ema50)) and (rsi > 50 and rsi < rsi_overbought) and (macdLine > signalLine)
// Conditions for Short Entry
short_condition = (close < ema200) and (ta.crossunder(close, ema50)) and (rsi < 50 and rsi > rsi_oversold) and (macdLine < signalLine)
// Plot Buy/Sell Signals
plotshape(long_condition, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", title="Buy Signal")
plotshape(short_condition, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", title="Sell Signal")
// Alerts
alertcondition(long_condition, title="Long Alert", message="Buy Signal Detected!")
alertcondition(short_condition, title="Short Alert", message="Sell Signal Detected!")
2024 - Median High-Low % Change - Monthly, Weekly, DailyDescription:
This indicator provides a statistical overview of Bitcoin's volatility by displaying the median high-to-low percentage changes for monthly, weekly, and daily timeframes. It allows traders to visualize typical price fluctuations within each period, supporting range and volatility-based trading strategies.
How It Works:
Calculation of High-Low % Change: For each selected timeframe (monthly, weekly, and daily), the script calculates the percentage change from the high to the low price within the period.
Median Calculation: The median of these high-to-low changes is determined for each timeframe, offering a robust central measure that minimizes the impact of extreme price swings.
Table Display: At the end of the chart, the script displays a table in the top-right corner with the median values for each selected timeframe. This table is updated dynamically to show the latest data.
Usage Notes:
This script includes input options to toggle the visibility of each timeframe (monthly, weekly, and daily) in the table.
Designed to be used with Bitcoin on daily and higher timeframes for accurate statistical insights.
Ideal for traders looking to understand Bitcoin's typical volatility and adjust their strategies accordingly.
This indicator does not provide specific buy or sell signals but serves as an analytical tool for understanding volatility patterns.
2024_V2 - ComLucro - Candle CounterElevate your trading game with this advanced Candle Counter, designed to provide precise candlestick counts across your preferred timeframes! Whether you’re tracking yearly, monthly, weekly, daily, or hourly candles, this script gives you the edge by presenting easy-to-read labels directly on your chart. It’s perfect for traders who want an accurate view of candle formations over time to enhance their trading strategies.
Script Name: 2024_V2 - ComLucro - Candle Counter
✨ Features:
Adjustable timeframes: yearly, monthly, weekly, daily, or hourly.
Customizable label color and position for seamless chart integration.
Effortlessly track candle count without altering your chart style!
🔗 Stay updated! Subscribe to our YouTube channel ComLucro Trader for more tips, tutorials, and tools to maximize your trading potential!
🌐 Visit us at comlucro.com.br for more exclusive scripts, insights, and strategies.
Trend Continuation RatioThis TradingView indicator calculates the likelihood of consecutive bullish or bearish days over a specified period, giving insights into day-to-day continuation patterns within the market.
How It Works
Period Length Input:
The user sets the period length (e.g., 20 days) to analyze.
After each period, the counts reset, allowing fresh data for each new interval.
Bullish and Bearish Day Definitions:
A day is considered bullish if the closing price is higher than the opening price.
A day is considered bearish if the closing price is lower than the opening price.
Count Tracking:
Within each specified period, the indicator tracks:
Total Bullish Days: The number of days where the close is greater than the open.
Total Bearish Days: The number of days where the close is less than the open.
Bullish to Bullish Continuations: Counts each instance where a bullish day is followed by another bullish day.
Bearish to Bearish Continuations: Counts each instance where a bearish day is followed by another bearish day.
Calculating Continuation Ratios:
The Bullish Continuation Ratio is calculated as the percentage of bullish days that were followed by another bullish day:
Bullish Continuation Ratio = (Bullish to Bullish Continuations /Total Bullish Days)×100
Bullish Continuation Ratio=( Total Bullish Days/Bullish to Bullish Continuations )×100
The Bearish Continuation Ratio is the percentage of bearish days followed by another bearish day:
Bearish Continuation Ratio = (Bearish to Bearish Continuations/Total Bearish Days)×100
Bearish Continuation Ratio=( Total Bearish Days/Bearish to Bearish Continuations )×100
Display on Chart:
The indicator displays a table in the top-right corner of the chart with:
Bullish Continuation Ratio (%): Percentage of bullish days that led to another bullish day within the period.
Bearish Continuation Ratio (%): Percentage of bearish days that led to another bearish day within the period.
Usage Insights
High Ratios: If the bullish or bearish continuation ratio is high, it suggests a trend where bullish/bearish days often lead to similar days, indicating possible momentum.
Low Ratios: Low continuation ratios indicate frequent reversals, which could suggest a range-bound or volatile market.
This indicator is helpful for assessing short-term trend continuation tendencies, allowing traders to gauge whether they are more likely to see follow-through on bullish or bearish days within a chosen timeframe.
Polygonal Pivot Bands [FXSMARTLAB]The Polygonal Pivot Bands highlights key price pivots, dynamic support and resistance levels, and recent price action on a trading chart. This indicator connects pivot highs and lows with a zigzag line, extends a real-time dashed line to the latest price point, and plots diagonal support/resistance levels that adapt to price movement. These elements together provide traders with a view of significant price zones and potential trend shifts.
Key Components of the Indicator
Pivots are calculated based on user-defined lengths, specifying how many bars on either side of a high or low are required to validate it as a pivot.
Adjustable left and right pivot lengths allow traders to control the sensitivity of pivot detection, with higher values resulting in fewer, more prominent pivots, and lower values increasing sensitivity to price changes.
Zigzag Line
The zigzag line connects consecutive pivot points, filtering out smaller fluctuations and emphasizing the broader direction of price movement.
Users can customize the line's color and thickness to match their preferences, helping them focus on larger trends and potential reversal points.
By linking pivot highs and lows, the zigzag pattern highlights the overall trend and potential points of reversal.
Real-Time Connector Line
A dashed line extends from the last confirmed pivot to the latest price point, providing a real-time, bar-by-bar update of the current price relative to the previous pivot.
This line does not project future price direction but maintains an up-to-date connection with the current price, showing the distance from the last pivot.
Its color and thickness are customizable for improved visibility on the chart.
Dynamic Support and Resistance Levels
The indicator plots dynamic support and resistanc e levels by connecting recent pivot highs and lows, resulting in lines that may appear diagonal rather than strictly horizontal.
These levels move in line with price action, adapting to the natural direction of trends, and offer visual cues where price may encounter support or resistance.
Colors and thickness of these lines can be set individually, allowing traders to adjust visibility according to their preferences.
Enabling these lines gives traders an ongoing reference for critical price boundaries that align more closely with the overall trend.
Gradient color Candlesthis is a simple candle colouring script that sets the colour of the candles to a gradient and the length of the gradient can be set by a user defined number of bars
SW Gann Pressure time from tops and bottomsW.D. Gann's trading techniques often emphasized the significance of time in the markets, believing that specific time intervals could influence price movements. Here’s how the 30, 60, 90, 120, 180, and 270 bar intervals relate to Gann's rules:
1. **30 Bars**:
- Gann often viewed shorter time frames as critical for identifying short-term trends. A 30-bar interval can signify minor cycles or potential turning points in price.
2. **60 Bars**:
- This interval is significant as Gann believed in the importance of quarterly cycles. A 60-bar mark could indicate a completion of a two-month cycle, often leading to retracements or reversals.
3. **90 Bars**:
- Gann considered 90 days (or bars) to represent a quarter. This interval can signify a substantial shift in market sentiment or a pivotal point in a longer trend.
4. **120 Bars**:
- The 120-bar mark corresponds to about four months. Gann viewed longer intervals as more significant, often leading to major shifts in market trends.
5. **180 Bars**:
- A 180-bar period relates to a semi-annual cycle, which Gann regarded as critical for major support and resistance levels. Price action around this interval can reveal potential long-term trend reversals.
6. **270 Bars**:
- Gann believed that longer cycles, such as 270 bars (approximately nine months), could indicate significant market phases. This interval may represent major turning points and help identify long-term trends.
### Application in Trading:
- **Identifying Trends**: Traders can use these intervals to spot potential trend reversals or continuations based on Gann’s principles of market cycles.
- **Setting Targets and Stops**: Knowing where these key bars fall can help in setting profit targets and stop-loss orders.
- **Analyzing Market Sentiment**: Price reactions at these intervals can provide insights into market psychology and sentiment shifts.
By marking these intervals on a chart, traders can visually assess when price action aligns with Gann's theories, helping them make more informed trading decisions based on historical patterns and cycles.
SW Gann DaysGann pressure days, named after the famous trader W.D. Gann, refer to specific days in a trading month that are believed to have significant market influence. These days are identified based on Gann's theories of astrology, geometry, and market cycles. Here’s a general outline of how they might be understood:
1. **Market Cycles**: Gann believed that markets move in cycles and that certain days can have heightened volatility or trend changes. Traders look for specific dates based on historical price movements.
2. **Timing Indicators**: Pressure days often align with key economic reports, earnings announcements, or geopolitical events that can cause price swings.
3. **Mathematical Patterns**: Gann used angles and geometric patterns to predict price movements, with pressure days potentially aligning with these calculations.
4. **Historical Patterns**: Traders analyze past data to identify dates that historically show strong price reactions, using this to predict future behavior.
5. **Astrological Influences**: Some practitioners incorporate astrological elements, believing that celestial events (like full moons or planetary alignments) can impact market psychology.
Traders might use these concepts to make decisions about entering or exiting positions, but it’s important to note that Gann's methods can be complex and are not universally accepted in trading communities.