Triple TapAbout FRACTALS and SWINGS
About FRACTALS and SWINGS
About FRACTALS and SWINGS
About FRACTALS and SWINGS
Indicators and strategies
Multi Asset & TF Stochastic
Multi Asset & TF Stochastic
This indicator allows you to compare the stochastic oscillator values of two different assets across multiple timeframes in a single pane. Itโs designed for traders who want to analyse the momentum of one asset (by default, the chartโs asset) alongside a second asset of your choice (e.g., comparing EURUSD to the USD Index).
How It Works:
Main Asset:
The indicator automatically uses the chartโs asset for the primary stochastic calculation. You have the option to adjust the timeframe for this asset using a dropdown that includes TradingViewโs standard timeframes, a "Chart" option (which automatically uses your chartโs timeframe), or a "Custom" option where you can type in any timeframe.
Second Asset:
You can enable the display of a second asset by toggling the โDisplay Second Assetโ option. Choose the asset symbol (default is โDXYโ) and select its timeframe from an identical dropdown. When enabled, the script calculates the stochastic oscillator for the second asset, allowing you to compare its momentum (%K and %D lines) with that of the main asset.
Stochastic Oscillator Settings:
Customize the %K length, the smoothing period for %K, and the smoothing period for %D. Both assetsโ stochastic values are calculated using these parameters.
Visual Display:
The indicator plots the %K and %D lines for the main asset in prominent colours. If the second asset is enabled, its %K and %D lines are also plotted in different colours. Additionally, overbought (80) and oversold (20) levels are marked, with a midline at 50, making it easier to gauge market conditions at a glance.
%D line can be toggled off for a cleaner view if required:
Asset Information Table:
A table at the top-centre of the pane displays the active asset symbolsโensuring you always know which assets are being analysed.
How to Use:
Apply the Indicator:
Add the script to your chart. By default, it will use the chartโs current asset and timeframe for the primary stochastic oscillator.
Adjust the Main Asset Settings:
Use the โMain Asset Timeframeโ dropdown to select a specific timeframe for the main asset or stick with the โChartโ option for automatic syncing with your current chart.
Enable and Configure the Second Asset (Optional):
Toggle on โDisplay Second Assetโ if you wish to compare another asset. Select the desired symbol and adjust its timeframe using the provided dropdown. Choose โCustomโ if you need a timeframe not listed by default.
Review the Plots and Table:
Observe the stochastic %K and %D lines for each asset. The overbought/oversold levels help indicate potential market turning points. Check the table at the top-centre to confirm the asset symbols being displayed.
This versatile tool is ideal for traders who rely on momentum analysis and need to quickly compare the stochastic signals of different markets or instruments. Enjoy seamless multi-asset analysis with complete control over your timeframe settings!
Humble idrees Candles//@version=5
indicator(title="Humble LinReg Candles", shorttitle="41-80-LinReg Candles", format=format.price, precision=4, overlay=true)
signal_length = input.int(title="Signal Smoothing", minval = 1, maxval = 200, defval = 11)
sma_signal = input.bool(title="Simple MA (Signal Line)", defval=true)
lin_reg = input.bool(title="Lin Reg", defval=true)
linreg_length = input.int(title="Linear Regression Length", minval = 1, maxval = 200, defval = 11)
bopen = lin_reg ? ta.linreg(open, linreg_length, 0) : open
bhigh = lin_reg ? ta.linreg(high, linreg_length, 0) : high
blow = lin_reg ? ta.linreg(low, linreg_length, 0) : low
bclose = lin_reg ? ta.linreg(close, linreg_length, 0) : close
r = bopen < bclose
signal = sma_signal ? ta.sma(bclose, signal_length) : ta.ema(bclose, signal_length)
//plotcandle(r ? bopen : na, r ? bhigh : na, r ? blow: na, r ? bclose : na, title="LinReg Candles", color= color.green, wickcolor=color.green, bordercolor=color.green, editable= true)
//plotcandle(r ? na : bopen, r ? na : bhigh, r ? na : blow, r ? na : bclose, title="LinReg Candles", color=color.red, wickcolor=color.red, bordercolor=color.red, editable= true)
plot(signal, color=color.black)
// Inputs
a = input(1, title='Key Vaule. \'This changes the sensitivity\'')
c = input(10, title='ATR Period')
h = input(false, title='Signals from Heikin Ashi Candles')
xATR = ta.atr(c)
nLoss = a * xATR
src = h ? request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close, lookahead=barmerge.lookahead_off) : close
xATRTrailingStop = 0.0
iff_1 = src > nz(xATRTrailingStop , 0) ? src - nLoss : src + nLoss
iff_2 = src < nz(xATRTrailingStop , 0) and src < nz(xATRTrailingStop , 0) ? math.min(nz(xATRTrailingStop ), src + nLoss) : iff_1
xATRTrailingStop := src > nz(xATRTrailingStop , 0) and src > nz(xATRTrailingStop , 0) ? math.max(nz(xATRTrailingStop ), src - nLoss) : iff_2
pos = 0
iff_3 = src > nz(xATRTrailingStop , 0) and src < nz(xATRTrailingStop , 0) ? -1 : nz(pos , 0)
pos := src < nz(xATRTrailingStop , 0) and src > nz(xATRTrailingStop , 0) ? 1 : iff_3
xcolor = pos == -1 ? color.red : pos == 1 ? color.green : color.blue
ema = ta.ema(src, 1)
above = ta.crossover(ema, xATRTrailingStop)
below = ta.crossover(xATRTrailingStop, ema)
buy = src > xATRTrailingStop and above
sell = src < xATRTrailingStop and below
barbuy = src > xATRTrailingStop
barsell = src < xATRTrailingStop
plotshape(buy, title='Buy', text='Buy', style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.new(color.white, 0), size=size.tiny)
plotshape(sell, title='Sell', text='Sell', style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.white, 0), size=size.tiny)
barcolor(barbuy ? color.green : na)
barcolor(barsell ? color.red : na)
alertcondition(buy, 'UT Long', 'UT Long')
alertcondition(sell, 'UT Short', 'UT Short')
longCondition = buy
shortCondition = sell
gpA = "PineConnector Settings"
LicenseID = input.string("xxxxxxxx", title = "License ID", group=gpA) // 1. change to your PineConnector License ID (required)
pairName = input.string("XAUUSD", title = "Pair Name to Trade", tooltip = "Confirm exact name from MT5 before entering", group=gpA)
risk_ = input.float(10, "Risk ", group = gpA)
sl_ = input.float(30, "SL ", group = gpA)
tp_ = input.float(30, "TP โโโโโ", group = gpA, inline = "tp_"), use_tp = input.bool(false, "Enable", group = gpA, inline = "tp_")
entryAlertMessage(side_,risk, sl, tp)=>
LicenseID + ',' + side_ + ',' + pairName + ',risk=' + str.tostring(risk) + ',sl=' + str.tostring(sl, "#.####") + (use_tp ? ',tp=' + str.tostring(tp, "#.####") : "")
closeAlertMessage(side_)=>
LicenseID +',' + side_ + ',' + pairName
if longCondition
alertMessage = entryAlertMessage("buy", risk_, sl_, tp_)
alert(alertMessage, alert.freq_once_per_bar_close)
// label.new(bar_index, high, alertMessage, xloc.bar_index, yloc.price, color.green, label.style_label_down, color.white, size.small, text.align_left, na, font.family_monospace, force_overlay = true)
if shortCondition
alertMessage = entryAlertMessage("sell", risk_, sl_, tp_)
alert(alertMessage, alert.freq_once_per_bar_close)
Rainbow Rising ( kirillmanov )ัะบะพะปัะทััะธะต ััะตะดะฝะธะต
ะพัะพะฑัะฐะถะตะฝะธะต ัะบะพะปัะทััะธั
ััะตะดะฝะธั
ะฝะฐ ะณัะฐัะธะบะต
Body Dominant VWMA Strategy aumCore Features:
Daily VWMA reset option for intraday trading
Body dominant candle detection
Position tracking and signal generation
Buy/Sell labels on candles
Decisive Entry Mode:
When OFF: Signals on close price crossing VWMA
When ON: Signals only when entire candle (including wicks) is above/below VWMA
Body Proportion Check:
Calculates ratio of body to total candle size
Only generates signals on body-dominant candles
Position Management:
Tracks current position
Prevents duplicate signals
Resets positions on new day when daily reset is enabled
Visualization:
VWMA line plotted in blue
Clear BUY/SELL labels on candles
Alert conditions for both signals
Money Flow Indicator (Chaikin Oscillator) with VWAPStrategy Overview
Entry Conditions:
Buy Entry:
The Chaikin Oscillator crosses above the signal line.
The current price is above the VWAP.
Sell Entry:
The Chaikin Oscillator crosses below the signal line.
The current price is below the VWAP.
Exit Conditions:
Profit Taking:
Take profit when a target profit is reached (e.g., a 2% increase from the entry price).
Stop Loss:
Set a stop loss, for example, at a 1% decline from the entry price.
Risk Management:
Manage risk by limiting each trade to no more than 1-2% of the account balance.
Calculate position size based on risk and trade accordingly.
Trend Confirmation:
Use other indicators (like moving averages) to confirm the overall trend and focus trades in the direction of the trend.
In an uptrend, prioritize buy entries; in a downtrend, prioritize sell entries.
Specific Trade Scenarios
Example 1: Buy Entry:
Enter a buy position when the Chaikin Oscillator crosses above the signal line and the price is above the VWAP.
Set a stop loss 1% below the entry price and a profit target 2% above the entry price.
Example 2: Sell Entry:
Enter a sell position when the Chaikin Oscillator crosses below the signal line and the price is below the VWAP.
Set a stop loss 1% above the entry price and a profit target 2% below the entry price.
Additional Considerations
Backtesting: Test this strategy with historical data to evaluate performance and make adjustments as needed.
Market Conditions: Pay attention to market volatility and economic indicators, adjusting the trading strategy flexibly.
Psychological Factors: Avoid emotional decisions and follow clear rules when trading.
Ondas de Elliott / Zona temporal fibonacci /NeoWaveEste Script aplica a contagem de uma onda 2 em zig zag. 33333, para quem sabe ler um pingo รฉ letra.
Cabe melhorias e atualizaรงรตes.
First Candle +0.9% Line//@version=5
indicator("First Candle +0.9% Line", overlay=true)
// Capture the closing price of the first candle
var float first_candle_close = na
if (bar_index == 0)
first_candle_close := close
// Calculate the 0.9% level above the first candle's closing price
level = first_candle_close * 1.009 // 0.9% above the first candle close
// Plot the line at the calculated level
plot(series=level, color=color.red, linewidth=2, title="0.9% Above First Candle")
// Optional: Add a label to mark the level
if not na(first_candle_close)
label.new(x=bar_index, y=level, text="+0.9% Level", color=color.red, style=label.style_label_down, textcolor=color.white)
My script//@version=6
indicator("EMA VIP", shorttitle=".", format=format.price, precision=0, overlay=true, max_bars_back=481)
len1 = 5
src1 = close
out1 = ta.ema(src1, len1)
len2 = 10
src2 = close
out2 = ta.ema(src2, len2)
len3 = 21
src3 = close
out3 = ta.ema(src3, len3)
len4 = 50
src4 = close
out4 = ta.ema(src4, len4)
len5 = 100
src5 = close
out5 = ta.ema(src5, len5)
len6 = 200
src6 = close
out6 = ta.ema(src6, len6)
plot(out1, title="EMA5", color=color.green, linewidth=2)
plot(out2, title="EMA10", color=color.blue, linewidth=2)
plot(out3, title="EMA21", color=color.purple, linewidth=2)
plot(out4, title="EMA 50", color=color.orange, linewidth=2)
plot(out5, title="EMA 100", color=color.black, linewidth=2)
plot(out6, title="EMA 200", color=color.red, linewidth=2)
Scalper Overlay with RSI Bars & Key LevelsThis is a comprehensive technical analysis overlay indicator called "Scalper Overlay with RSI Bars & Key Levels".
It combines several powerful trading tools and patterns in one indicator:
1. Moving Averages System:
- Plots four Smoothed Moving Averages (SMMA) at 20, 50, 100, and 200 periods
- Includes a 2-period EMA with trend filling (green when trending up, red when trending down)
2. RSI Integration:
- Features a 14-period RSI implementation
- Displays colored candles based on RSI levels (green above 70, red below 30)
- Includes toggle options for RSI candle visibility and color customization
3. Pattern Recognition:
- Three Line Strike patterns (both bullish and bearish)
- Three White Soldiers and Three Black Crows patterns
- Harami patterns (bullish and bearish)
- Engulfing candle patterns (labeled as "Big A$$ Candles")
4. Trading Session Tools:
- Customizable trading session visualization
- Timezone selection (multiple options from Sydney to Chicago)
- Flexible session time settings
- Day-of-week session filtering
- Background highlighting for active trading sessions
This indicator is particularly useful for scalpers and day traders who want to:
- Identify trend direction using multiple timeframe analysis
- Spot potential reversal patterns
- Monitor trading sessions
- Track momentum using RSI
- Identify strong candlestick patterns
The indicator offers extensive customization options through its inputs, allowing traders to show/hide various components and adjust colors and parameters to their preferences.
ๅบๆฅ้ซ (ๅขๆธ+ๆฅๅขๆฅๆธ) + ็งปๅๅนณๅๅบๆฅ้ซใฎๆฅๅขๆฅๆธใๅใใๆใๆ็คบใใใ ใใงใชใใ็งปๅๅนณๅ็ทใ่กจ็คบใใใใใใซใใพใใใ
Supertrend com Confirmaรงรฃo SMA 50o poder do supertrend com a confirmaรงรฃo de sma de 50 para confirmar as entradas.
Follow The Line Indicator v1.2// This Pine Scriptโข code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// ยฉ DeeKay677
// DISCLAIMER:
// This script is for informational and educational purposes only. It should not be considered financial advice, trading advice, or an endorsement of any particular trading strategy.
// Trading involves significant risk, and past performance is not indicative of future results.
// The author of this script assumes no responsibility for any trading losses or financial decisions made using this script.
// Users should conduct their own research, consult a professional financial advisor, and use proper risk management before making any investment decisions.
// By using this script, you acknowledge and agree that the author is not liable for any damages, losses, or consequences resulting from its use.
Follow Line Indicator// Follow The Line
// This Pine Scriptโข code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// ยฉ DeeKay677
// Originalay found at usethinkscript.com
// Originally authors: Converted to ToS from TV by bigboss. Original ยฉ Dreadblitz
// DISCLAIMER:
// This script is for informational and educational purposes only. It should not be considered financial advice, trading advice, or an endorsement of any particular trading strategy.
// Trading involves significant risk, and past performance is not indicative of future results.
// The author of this script assumes no responsibility for any trading losses or financial decisions made using this script.
// Users should conduct their own research, consult a professional financial advisor, and use proper risk management before making any investment decisions.
// By using this script, you acknowledge and agree that the author is not liable for any damages, losses, or consequences resulting from its use.
Crypto MA + ATR Super Adaptative 2.0Esta condiciรณn asegura que los niveles se muestran solo desde la vela en la que idealCounter vale 24 hasta la vela en la que vale 12, es decir, durante ese intervalo (lo que equivale a 13 barras, o 12 perรญodos despuรฉs de la inflexiรณn, dependiendo de cรณmo se cuenten).
En resumen, aunque no veas una condiciรณn que diga "idealCounter <= 24", esa restricciรณn se cumple por el hecho de que se reinicia a 24 en la inflexiรณn y luego se decrementa.
HFX Smart MoneyIMBALANCE
LIQLa liquidez en el mercado Forex (mercado de divisas) se refiere a la facilidad con la que un activo, en este caso las divisas, puede comprarse o venderse sin causar un impacto significativo en su precio. Es decir, un mercado lรญquido es aquel donde hay suficientes compradores y vendedores para ejecutar transacciones rรกpidamente y a precios cercanos al valor actual del mercado.
Cumulative Price Change AlertCumulative Price Change Alert
Version: 1.0
Author: QCodeTrader ๐
Overview ๐
The Cumulative Price Change Alert indicator analyzes the percentage change between the current and previous open prices and sums these changes over a user-defined number of bars. It then generates visual buy and sell signals using arrows and labels on the chart, helping traders spot cumulative price momentum and potential trading opportunities.
Key Features โ๏ธ
Customizable Timeframe ๐:
Use a custom timeframe or default to the chart's timeframe for price data.
User-Defined Summation ๐ข:
Specify the number of bars to sum, allowing you to analyze cumulative price changes.
Custom Buy & Sell Conditions ๐:
Set individual percentage change thresholds and cumulative sum thresholds to tailor signals for
your strategy.
Visual Alerts ๐:
Displays green upward arrows for buy signals and red downward arrows for sell signals directly
on the chart.
Informative Labels ๐:
Provides labels with formatted percentage change and cumulative sum details for the analyzed
bars.
Versatile Application ๐:
Suitable for stocks, forex, crypto, commodities, and more.
How It Works โก
Price Change Calculation โ:
The indicator calculates the percentage change between the current bar's open price and the
previous bar's open price.
Cumulative Sum โ:
It then sums these percentage changes over the last N bars (as specified by the user).
Signal Generation ๐ฆ:
Buy Signal ๐ข: When both the individual percentage change and the cumulative sum exceed
their respective buy thresholds, a green arrow and label are displayed.
Sell Signal ๐ด: Conversely, if the individual change and cumulative sum fall below the sell
thresholds, a red arrow and label are shown.
How to Use ๐ก
Add the Indicator โ:
Apply the indicator to your chart.
Customize Settings โ๏ธ:
Set a custom timeframe if desired.
Define the number of bars to sum.
Adjust the buy/sell percentage change and cumulative sum thresholds to match your trading
strategy.
Interpret Visual Cues ๐:
Monitor the chart for green or red arrows and corresponding labels that signal potential buy or
sell opportunities based on cumulative price movements.
Settings Explained ๐ ๏ธ
Custom Timeframe:
Select an alternative timeframe for analysis, or leave empty to use the current chart's timeframe.
Number of Last Bars to Sum:
Determines how many bars are used to compute the cumulative percentage change.
Buy Condition - Min % Change:
The minimum individual percentage change required to consider a buy signal.
Buy Condition - Min Sum of Bars:
The minimum cumulative percentage change over the defined bars needed for a buy signal.
Sell Condition - Max % Change:
The maximum individual percentage change threshold for a sell signal.
Sell Condition - Max Sum of Bars:
The maximum cumulative percentage change over the defined bars for triggering a sell signal.
Best Use Cases ๐ฏ
Momentum Identification ๐:
Quickly spot strong cumulative price movements and momentum shifts.
Entry/Exit Signals ๐ช:
Use the visual signals to determine potential entry and exit points in your trading.
Versatile Strategy Application ๐:
Effective for scalping, swing trading, and longer-term analysis across various markets.
UPD: uncheck labels for better performance
OrderBlocks || DeadMoneyThe DeadMoney script automatically identifies and visualizes Bullish and Bearish Order Blocks on the chart.
It is based on swing detection and highlights rectangular zones where increased buyer or seller activity is likely.
When the price breaks through an order block the zone changes color - Breaker Block
Key Parameters
๐น Swing Lookback โ Determines how far back the script searches for swing points.
๐น Bullish OB & Bearish OB โ Defines how many recent bullish and bearish Order Blocks should be displayed on the chart.
Additional Settings
โ
Show OB Info โ Displays the last traded volume before the Order Block formation.
โ
Show OB Mid โ Highlights the midpoint of a formed Order Block.
โ
Show Candle Info โ Displays current trade data and indicator readings.
โ Includes: MFI, RSI, MACD
โ
Use Candle Body
โ Enabled: Uses open/close prices for Order Block calculations, ignoring wicks.
โ Disabled: Uses high/low prices, making Order Block detection more sensitive to price extremes.
โ Disclaimer:
This script is designed to assist with technical analysis but does not guarantee success.
Before using it, make sure you understand the principles of technical analysis, as well as how order blocks work. ๐
[GYTS] Filters ToolkitFilters Toolkit indicator
๐ธ Part of GoemonYae Trading System (GYTS) ๐ธ
๐ธ --------- 1. INTRODUCTION --------- ๐ธ
๐ฎ Overview
The GYTS Filters Toolkit indicator is an advanced, interactive interface built atop the highโperformance, curated functions provided by the FiltersToolkit library . It allows traders to experiment with different combinations of filtering methods -โ from smoothing low-pass filters to aggressive detrenders. With this toolkit, you can build custom indicators tailored to your specific trading strategy, whether you're looking for trend following, mean reversion, or cycle identification approaches.
๐ธ --------- 2. FILTER METHODS AND TYPES --------- ๐ธ
๐ฎ Filter categories
The available filters fall into four main categories, each marked with a distinct symbol:
๐ Low Pass Filters (Smoothers)
These filters attenuate high-frequency components (noise) while allowing low-frequency components (trends) to pass through. Examples include:
Ultimate Smoother
Super Smoother (2-pole and 3-pole variants)
MESA Adaptive Moving Average (MAMA) and Following Adaptive Moving Average (FAMA)
BiQuad Low Pass Filter
ADXvma (Adaptive Directional Volatility Moving Average)
A2RMA (Adaptive Autonomous Recursive Moving Average)
Low pass filters are displayed on the price chart by default, as they follow the overall price movement. If they are combined with a high-pass or bandpass filter, they will be displayed in the subgraph.
๐ High Pass Filters (Detrenders)
These filters do the opposite of low pass filters - they remove low-frequency components (trends) while allowing high-frequency components to pass through. Examples include:
Butterworth High Pass Filter
BiQuad High Pass Filter
High pass filters are displayed as oscillators in the subgraph below the price chart, as they fluctuate around a zero line.
๐ Band Pass Filters (Cycle Isolators)
These filters combine aspects of both low and high pass filters, isolating specific frequency ranges while attenuating both higher and lower frequencies. Examples include:
Ehlers Bandpass Filter
Cyber Cycle
Relative Vigor Index (RVI)
BiQuad Bandpass Filter
Band pass filters are also displayed as oscillators in a separate panel.
๐ฎ Predictive Filter
Voss Predictive Filter: A special filter that attempts to predict future values of band-limited signals (only to be used as post-filter). Keep its prediction horizon short (1โ3 bars) for reasonable accuracy.
Note that the the library contains elaborate documentation and source material of each filter.
๐ธ --------- 3. INDICATOR FEATURES --------- ๐ธ
๐ฎ Multi-filter configuration
One of the most powerful aspects of this indicator is the ability to configure multiple filters. compare them and observe their combined effects. There are four primary filters, each with its own parameter settings.
๐ฎ Post-filtering
Process a filterโs output through an additional filter by enabling the post-filter option. This creates a filter chain where the output of one filter becomes the input to another. Some powerful combinations include:
Ultimate Smoother โ MAMA: Creates an adaptive smoothing effect that responds well to market changes, good for trend-following strategies
Butterworth โ Super Smoother โ Butterworth: Produces a well-behaved oscillator with minimal phase distortion, John Ehlers also calls a "roofing filter". Great for identifying overbought/oversold conditions with minimal lag.
A bandpass filter โ Voss Prediction filter: Attempts to predict future movements of cyclical components, handy to find peaks and troughs of the market cycle.
๐ฎ Aggregate filters
Arguably the coolest feature: aggregating filters allow you to combine multiple filters with different weights. Important notes about aggregation:
You can only aggregate filters that appear on the same chart (price chart or oscillator panel).
The weights are automatically normalised, so only their relative values matter
Setting a weight to 0 (zero) excludes that filter from the aggregation
Filters don't need to be visibly displayed to be included in aggregation
๐ฎ Rich visualisation & alerts
The indicator intelligently determines whether a filter is displayed on the price chart or in the subgraph (as an oscillator) based on its characteristics.
Dynamic colour palettes, adjustable line widths, transparency, and custom fill between any of enabled filters or between oscillators and the zero-line.
A clear legend showing which filters are active and how they're configured
Alerts for direction changes and crossovers of all filters
๐ธ --------- 4. ACKNOWLEDGEMENTS --------- ๐ธ
This toolkit builds on the work of numerous pioneers in technical analysis and digital signal processing:
John Ehlers, whose groundbreaking research forms the foundation of many filters.
Robert Bristow-Johnson for the BiQuad filter formulations.
The TradingView community, especially @The_Peaceful_Lizard, @alexgrover, and others mentioned in the code of the library.
Everyone who has provided feedback, testing and support!
Ehlers Stable Dominant Cycle Length [graylange]Stable Dominant Cycle Length โ Adaptive Cycle Detection for Market Timing
This script calculates the dominant cycle length of the market using an improved version of John Ehlers' Hilbert Transform approach. Unlike traditional implementations, this version includes advanced smoothing techniques to reduce noise and prevent erratic spikes, making it more reliable for adaptive cycle-based strategies.
๐ฅ Key Features:
โ
Noise-Reduced Cycle Detection โ Uses a Weighted Moving Average (WMA) detrending method instead of raw Hilbert Transform values to enhance stability.
โ
Adaptive Smoothing โ Applies an Exponential Moving Average (EMA) to the instantaneous period, reducing excessive volatility in cycle length calculations.
โ
Phase Wrapping & Constraints โ Clamps phase changes to prevent unrealistic cycle swings and division errors.
โ
Dynamic Cycle Adjustment โ The dominant cycle length updates in real time, constrained within a reasonable range (6 to 50 bars) to avoid extreme peaks.
๐ How to Use It:
Identify Market Cycles โ Use the dominant cycle length to determine optimal trend-following vs. mean-reversion strategies.
Enhance MESA Filters โ Apply the detected cycle length to adjust Ehlersโ MESA Adaptive Moving Average (MAMA) dynamically.
Fine-Tune Alpha Settings โ Reduce overfitting in cycle-based indicators by basing parameters on a stable dominant cycle estimate.