Weighted Fourier Transform: Spectral Gating & Main Frequency🙏🏻 This drop has 2 purposes:
1) to inform every1 who'd ever see it that Weighted Fourier Tranform does exist, while being available nowhere online, not even in papers, yet there's nothing incredibly complicated about it, and it can/should be used in certain cases;
2) to show TradingView users how they can use it now in dem endevours, to show em what spectral filtering is, and what can they do with all of it in diy mode.
... so we gonna have 2 sections in the description
Section 1: Weighted Fourier Transform
It's quite easy to include weights in Fourier analysis: you just premultiply each datapoint by its corresponding weight -> feed to direct Fourier Transform, and then divide by weights after inverse Fourier transform. Alternatevely, in direct transform you just multiply contributions of each data point to the real and imaginary parts of the Fourier transform by corresponding weights (in accumulation phase), and in inverse transform you divide by weights instead during the accumulation phase. Everything else stays the same just like in non-weighted version.
If you're from the first target group let's say, you prolly know a thing or deux about how to code & about Fourier Transform, so you can just check lines of code to see the implementation of Weighted Discrete version of Fourier Transform, and port it to to any technology you desire. Pine Script is a developing technology that is incredibly comfortable in use for quant-related tasks and anything involving time series in general. While also using Python for research and C++ for development, every time I can do what I want in Pine Script, I reach for it and never touch matlab, python, R, or anything else.
Weighted version allows you to explicetly include order/time information into the operation, which is essential with every time series, although not widely used in mainstream just as many other obvious and right things. If you think deeply, you'll understand that you can apply a usual non-weighted Fourier to any 2d+ data you can (even if none of these dimensions represent time), because this is a geometric tool in essence. By applying linearly decaying weights inside Fourier transform, you're explicetly saying, "one of these dimensions is Time, and weights represent the order". And obviously you can combine multiple weightings, eg time and another characteristic of each datum, allows you to include another non-spatial dimension in your model.
By doing that, on properly processed (not only stationary but Also centered around zero data), you can get some interesting results that you won't be able to recreate without weights:
^^ A sine wave, centered around zero, period of 16. Gray line made by: DWFT (direct weighted Fourier transform) -> spectral gating -> IWFT (inverse weighted Fourier transform) -> plotting the last value of gated reconstructed data, all applied to expanding window. Look how precisely it follows the original data (the sine wave) with no lag at all. This can't be done by using non-weighted version of Fourier transform.
^^ spectral filtering applied to the whole dataset, calculated on the latest data update
And you should never forget about Fast Fourier Transform, tho it needs recursion...
Section 2: About use cases for quant trading, about this particular implementaion in Pine Script 6 (currently the latest version as of Friday 13, December 2k24).
Given the current state of things, we have certain limits on matrix size on TradingView (and we need big dope matrixes to calculate polynomial regression -> detrend & center our data before Fourier), and recursion is not yet available in Pine Script, so the script works on short datasets only, and requires some time.
A note on detrending. For quality results, Fourier Transform should be applied to not only stationary but also centered around zero data. The rightest way to do detrending of time series
is to fit Cumulative Weighted Moving Polynomial Regression (known as WLSMA in some narrow circles xD) and calculate the deltas between datapoint at time t and this wonderful fit at time t. That's exactly what you see on the main chart of script description: notice the distances between chart and WLSMA, now look lower and see how it matches the distances between zero and purple line in WFT study. Using residuals of one regression fit of the whole dataset makes less sense in time series context, we break some 'time' and order rules in a way, tho not many understand/cares abouit it in mainstream quant industry.
Two ways of using the script:
Spectral Gating aka Spectral filtering. Frequency domain filtering is quite responsive and for a greater computational cost does not introduce a lag the way it works with time-domain filtering. Works this way: direct Fourier transform your data to get frequency & phase info -> compute power spectrum out of it -> zero out all dem freqs that ain't hit your threshold -> inverse Fourier tranform what's left -> repeat at each datapoint plotting the very first value of reconstructed array*. With this you can watch for zero crossings to make appropriate trading decisions.
^^ plot Freq pass to use the script this way, use Level setting to control the intensity of gating. These 3 only available values: -1, 0 and 1, are the general & natural ones.
* if you turn on labels in script's style settings, you see the gray dots perfectly fitting your data. They get recalculated (for the whole dataset) at each update. You call it repainting, this is for analytical & aesthetic purposes. Included for demonstration only.
Finding main/dominant frequency & period. You can use it to set up Length for your other studies, and for analytical purposes simply to understand the periodicity of your data.
^^ plot main frequency/main period to use the script this way. On the screenshot, you can see the script applied to sine wave of period 16, notice how many datapoints it took the algo to figure out the signal's period quite good in expanding window mode
Now what's the next step? You can try applying signal windowing techniques to make it all less data-driven but your ego-driven, make a weighted periodogram or autocorrelogram (check Wiener-Khinchin Theorem ), and maybe whole shiny spectrogram?
... you decide, choice is yours,
The butterfly reflect the doors ...
∞
Filtering
Engulfing Reversal Market PhaseStay at the right side of the market.
This indicator detects bullish and bearish phase in the market based on recent reversal.
It is designed to help filter your trades.
Open only long trades if indicator shows green and open only short trades when indicator shows red.
This indicator will detect bullish and bearish engulfing reversal pattern on the chart.
Bullish engulfing occurs when current candle closes below the bars that created the high.
Bearish engulfing occurs when current candle closes below the bars that created the high.
The reversal pattern occurs not only on a trend change, but can be also be present as a trend continuation pattern or a breakout pattern.
The indicator is able to detect 3 candle patterns and multi candle patterns if detects inside bars in the pattern.
FluxFilter Trend Strategy [BITsPIP]Hello fellow traders, I'm excited to share with you the FluxFilter Trend Strategy, a trading approach I've developed for those interested in exploring trend-following strategies. My goal was to create something straightforward and accessible, so traders looking to refine their portfolios can easily integrate its features. By the end of this guide, I hope you'll have a solid grasp of how the FluxFilter Trend Strategy functions, appreciate its benefits, understand its potential drawbacks, and see how it might fit into various trading contexts.
I) Overview
The FluxFilter Trend Strategy is tailored to align with the market's long-term trend. It examines the price data from the previous year to gauge the market's overall trajectory by employing moving averages. Subsequently, within shorter timeframes, the strategy utilizes a combination of modified Supertrend, Hull Suite, and various trend-following and filtering techniques to generate buy or sell signals. Although its advanced take profit and stop loss mechanisms might initially present a learning curve, they are integral to the strategy's effectiveness. They are designed to secure gains by capturing prevailing trends and mitigating the impact of false reversal signals.
II) Deep Backtesting
Deep backtesting stands as a cornerstone in the development of trading strategies, offering a robust method for traders to assess the performance of their strategy against historical data. This process yields a retrospective view, illustrating how the strategy might have navigated through past market fluctuations, thereby shedding light on its potential robustness and areas for refinement. However, it's crucial to acknowledge that a strategy's performance can be influenced by a myriad of factors including market dynamics, the chosen timeframe, and the inherent attributes of the traded asset. Consequently, it's advisable to conduct thorough backtesting under various conditions to ascertain the strategy's reliability before applying it to actual trading scenarios.
III) Benefits
A primary advantage of the FluxFilter Trend Strategy is its proficiency in discerning genuine market trends from mere price fluctuations, thereby avoiding premature or uncertain trades. Unlike approaches that take high risks on speculative trades, this strategy prioritizes a high degree of confidence in the direction of the trade. It meticulously waits for a clear confirmation of the market trend. Once this certainty is established, the strategy promptly generates trade signals, ensuring that traders are positioned to capitalize on optimal market entry points without delay. This approach not only enhances the potential for profit but also aligns with a disciplined and methodical trading ethos.
IV) Applications
FluxFilter Trend Strategy can be applied across various timeframes, with a particular efficacy in those under 15 minutes. Its adaptable framework means it can be customized to cater to a variety of asset classes, encompassing stocks, commodities, forex, and cryptocurrencies. Initially, the strategy was specifically calibrated for low-volatile cryptocurrencies, as reflected in the default settings for stop loss and take profit values. It's important to recognize that the unique volatility and trend patterns of your selected market necessitate careful adjustments to these parameters. This fine-tuning of profit targets and stop loss thresholds is crucial for aligning the strategy with the specific dynamics of your chosen market, which I will discuss shortly.
V) Strategy's Logic
1. Trend Identification: My conviction lies in the power of trend trading to yield long-term gains. Central to the FluxFilter Trend Strategy is the Hull Suite indicator, a tool developed by InSilico, serving as one of the confirmation indicators. This indicator acts as a compass for trend direction; a price residing above the Hull Suite line signals an uptrend, potentially marking an entry point for a buy position or confirming it. In contrast, a price positioned below this line suggests a downtrend, potentially indicating a strategic moment to sell or confirming the sell.
2. Noise Reduction: The financial markets are known for their 'noise'—short-lived price movements that can obscure the true market direction. The FluxFilter Trend Strategy is designed to sift through this noise, thereby facilitating more lucid and informed trading decisions. It employs a set of straightforward yet innovative techniques to single out significant misleading fluctuations. This is achieved by analyzing recent bars to spot bars with unusually large bodies, which often represent misleading market noise.
3. Risk Management: A key facet of the strategy is its emphasis on pragmatic risk management. Traders are empowered to establish practical stop-loss and take-profit levels, tailoring these crucial parameters to the specific market they are engaging in. This customization is instrumental in optimizing long-term profitability, ensuring that the strategy adapts fluidly to the unique characteristics and volatility patterns of different trading environments.
VI) Strategy's Input Settings and Default Values
1. Modified Supertrend
i. Factor: Serving as a multiplier in the Average True Range (ATR) calculation, this parameter adjusts the distance of the Supertrend line relative to the price chart. Elevating the factor value widens the gap between the Supertrend line and price, offering a more conservative stance. On the flip side, diminishing the factor value pulls the Supertrend line closer to the price action, heightening its sensitivity. While the preset value is 1, you have the flexibility to modify this to suit your trading approach.
ii. ATR Length: This defines the count of bars that are incorporated into the ATR computation, directly influencing the Supertrend's adaptability to market changes. With a default setting of 30 bars, it strikes a balance, smoothing over short-term fluctuations while maintaining a meaningful sensitivity to market trends. Adjusting this parameter allows you to tailor the indicator's responsiveness to suit your trading strategy, considering the volatility and behavioral patterns of the asset you are trading.
2. Hull Suite
i. Hull Suite Length: Designed for capturing long-term trends, the Hull Suite Length is configured at 1000. Functioning comparably to moving averages, the Hull Suite features upper and lower bands, though these are not employed in our current strategy.
ii. Length Multiplier: It's advisable to maintain a minimal value for the Length Multiplier, prioritizing the optimization of the Hull Suite Length. Presently, it is set to 1.
3. Filtering Indicators
i. Fluctuation Filtering Percentage: It's advisable to set this parameter to ten times the size of the average bar in your specific market, as this helps effectively mitigate the impact of market fluctuations. While the initial default is 0.4(%), based on the BTCUSDT market, it's crucial to adjust this figure to align with the characteristics of different assets or markets you're trading in.
ii. Fluctuation Filtering Bars: This parameter designates the count of preceding bars to consider when assessing market fluctuations. It's fully customizable, allowing you to tailor it based on your market insights. The preset default is 3, a balance chosen to minimize susceptibility to potentially misleading signals.
iii. Trend Confirmation Percentage: This metric is pivotal for verifying the viability of a trend post-entry. If the trade doesn't achieve this percentage in profit, it indicates a deviation from the expected trend. Under such circumstances, it may be prudent to exit the trade prematurely rather than awaiting the stop-loss trigger. It's recommended to set this parameter at half the size of the average candle body for the market you're analyzing. The initial default is set at 0.2(%).
4. StopLoss and TakeProfit
i. StopLoss and TakeProfit Settings: Two distinct approaches are available. Semi-Automatic StopLoss/TakeProfit Setting and Manual StopLoss/TakeProfit Setting. The Semi-Automatic mode streamlines the process by allowing you to input values for a 5-minute timeframe, subsequently auto-adjusting these values across various timeframes, both lower and higher. Conversely, the Manual mode offers full control, enabling you to meticulously define TakeProfit values for each individual timeframe.
ii. TakeProfit Threshold # and TakeProfit Value #: Imagine this mechanism as an ascending staircase. Each step represents a range, with the lower boundary (TakeProfit Value) designed to close the trade upon being reached, and the upper boundary (TakeProfit Threshold) upon being hit, propelling the trade to the next level, and forming a new range. This stair-stepping approach enhances risk management and has the potential to increase profitability. The pre-set configurations are tailored for volatile markets, such as BTCUSDT. It's advisable to devote time to tailoring these settings to your specific market, aiming to achieve optimal results based on backtesting.
iii. StopLoss Value: In line with its name, this value marks the limit of loss you're prepared to accept should the market trend go against your expectations. It's crucial to note that once your asset reaches the first TakeProfit range, the initial StopLoss value becomes obsolete, supplanted by the first TakeProfit Value. The default StopLoss value is pegged at 1.8(%), a figure worth considering in your trading strategy.
VII) Entry Conditions
The principal element that triggers the signal is the Modified Supertrend. Additional indicators serve as confirmatory tools. Nonetheless, to refine your strategy effectively, it's crucial to fine-tune the parameters. This involves adjusting input variables such as take profit levels, threshold parameters, and the filtering values discussed previously.
VIII) Exit Conditions
The strategy stipulates exit conditions primarily governed by stop loss and take profit parameters. On infrequent occasions, if the trend lacks confirmation post-entry, the strategy mandates an exit upon the issuance of a reverse signal (whether confirmed or unconfirmed) by the strategy itself.
Good Luck!!
Ehlers Undersampled Double Moving Average Indicator [CC]The Undersampled Double Moving Average was created by John Ehlers (Stocks and Commodities April 2023), and this is a double moving average system which is pretty rare for John Ehlers. For those of you who would like my other take on an Ehlers double moving average, be sure to check out my previous Ehlers double moving average script . He came up with a unique idea for this indicator to create a moving average using a sample of the price data. For example, we use his suggested length of 5 only to use the price data every 5 bars. Feel free to change this, and please let me know if you find a length that works better. He then smooths the indicator using the Hann Windowed Moving Average . I color-coded the lines to show stronger signals in darker colors or standard signals in lighter colors. Buy when the line turns green and sell when it turns red.
Let me know if there is an indicator or script you would like to see me publish!
Filter-Out Weak Pivot highs/lows, Swing highs/lows: MethodJust a simple indicator for refining the standard method of finding Pivot highs & Lows; Allowing user to filter-out weak/flat/rounded Pivot highs/lows
-Aim of this is to get pivot highs & pivot lows coded to print more in line with what the eye would naturally be drawn to as an obvious pivot high/low.
-This uses local moving average around the pivot high/low together with user-input ATR multiple, to create a condition for filtering out lacklustre pivot highs/lows.
-Thought i'd publish this separately as a tool that other coders might find useful.
//inputs//
~adjust looback/lookforward for Pivot highs/lows
~adjust 'spikiness' index to filter out less impressive pivot highs/lows (higher number = more selective)
Screener _-_ FVVO by SavosRUIt is my first attempt to make SCREENER
Screener by 20 coins to detect Filter of Volatility Oscilator & Volume Threshold
Now - without ALERTS!
But it will be added ASAP...
==================
Это первая моя попытка сделать СКРИНЕР.
Проверяет наличие сигнала всплеска волатильности и объема на 20 монетах.
Монеты - настраиваются.
Алерты - пока отсутствуют, но планируются в будущем.
Time_FilterLibrary "Time_Filter"
Time filters for trading strategies.
f_isInWeekDay(_timeZone, _byWeekDay, _byMon, _byTue, _byWed, _byThu, _byFri, _bySat, _bySun)
f_isInWeekDay - Filter by week day or by time delimited session.
Parameters:
_timeZone : - Time zone to use when filter allowed trading by days of the week.
_byWeekDay : - Filter allowed trading time by days of the week.
_byMon : - Is Monday a trading day?
_byTue : - Is Tuesday a trading day?
_byWed : - Is Wednesday a trading day?
_byThu : - Is Thursday a trading day?
_byFri : - Is Friday a trading day?
_bySat : - Is Saturday a trading day?
_bySun : - Is Sunday a trading day?
Returns: series of bool whether or not the time is inside the current day.
f_isInSession(_timeZone, _bySession_1, _timeSession_1, _bySession_2, _timeSession_2)
f_isInSession - Is the current time with in the allowed trading session time.
Parameters:
_timeZone : - Time zone to use when filter allowed trading by days of the week.
_bySession_1 : - Filter allowed trading time with in hours defined in _timeSession_1
_timeSession_1 : - Hours with in trading is allowed.
_bySession_2 : - Filter allowed trading time with in hours defined in _timeSession_2
_timeSession_2 : - Hours with in trading is allowed.
Returns: series of bool whether or not the time is inside selected session.
f_isTradingAllowed(_timeZone, _byWeekDay, _byMon, _byTue, _byWed, _byThu, _byFri, _bySat, _bySun, _bySession_1, _timeSession_1, _bySession_2, _timeSession_2)
f_isTradingAllowed - Is the current time with in the allowed.
Parameters:
_timeZone : - Time zone to use when filter allowed trading by days of the week.
_byWeekDay : - Filter allowed trading time by days of the week.
_byMon : - Is Monday a trading day?
_byTue : - Is Tuesday a trading day?
_byWed : - Is Wednesday a trading day?
_byThu : - Is Thursday a trading day?
_byFri : - Is Friday a trading day?
_bySat : - Is Saturday a trading day?
_bySun : - Is Sunday a trading day?
_bySession_1 : - Filter allowed trading time with in hours defined in _timeSession_1
_timeSession_1 : - Hours with in trading is allowed.
_bySession_2 : - Filter allowed trading time with in hours defined in _timeSession_2
_timeSession_2 : - Hours with in trading is allowed.
Returns: series of bool whether or not trading is allowed at the current time.
Generalized Step Moving Average w/ Pips Filter [Loxx]Generalized Step Moving Average w/ Pips Filter is a stepping function on source input to derive a moving average. This general form the stepping can also be applied to any other input such as EMA, SMA, HMA, WMA, etc.. This moving average employ a filtering system based on the following:
Core filter, both min and max value: pips * (multiplier) or the (average of momentum) * (multiplier).
Post processing filter: pips * (multiplier)
These filtering options require trend to shift by the above values before changing direction thereby reducing noise and yielding a better defined trend.
Things to note
This indicator requires fine tuning to make it work on all tickers. If you place this on a chart and it shows all green or red candles, then you must adjust the indicator to coincide with the pip movement of that ticker.
This indicator can be used on any timeframe.
Included
Bar coloring
Signals
Alerts
Loxx's Expanded Source Types
Double RSI FilterI've seen several youtubers using 2 RSI's on top of one another to filter trades for their strategies. I figured I would just code it up as an all-in-one indicator for people who have the basic package. This way they have an extra slot for another indicator if they need one and also for convenience.
Longs only when RSI 1 is above RSI 2 and shorts only when opposite. The arrows show where crosses of the RSI's occur.
Let me know if there is something else like this where it would just be very convenient to have 2 indicators on one window or other such things and I'll see if I can do something for you guys in my spare time. I'm just an amateur coder, but learning as I do more of these for people.
Thank you!
Hope this helps someone! :)
EMA Slope
Just an easy way to monitor trends and avoid fake signals.
// Consolidation periods based on moving average slope.
// Sideways markets are the ultimate challenge to most strategies.
// No trading zones will dismiss some fake signals.
Ehlers Triangle Moving Average [CC]The Triangle Moving Average is the last of custom scripts converting Ehlers Window Indicators to Moving Averages. As you can see this is actually very similar to the Hamming Moving Average and the Hann Moving Average so I would recommend to test this one out with different settings and see what works best for you. As far as the formula calculation, it is a custom weighted moving average that determines how close the price is compared to the middle of the length period and gives a custom weight to that price. For example it will assign heavier weights according to how close the price is to the beginning of the loop (which is the most recent data) and lighter weights, the further the price is away from the recent prices. I have included strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal signals are lighter in color. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators or scripts you would like to see me publish!
Ehlers Hamming Moving Average [CC]The Hamming Moving Average is a custom script I made to attempt to create a moving average using Ehler's Hamming Window Indicator . Let me stress that this is extremely experimental considering the original indicator works by creating a sine wave by adjusting the Pedestal value. Change the Pedestal value to anything 5 or higher and you will see what I mean. I think this is a fun experiment so let me know what you think. I have included strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal signals are lighter in color. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators or scripts you would like to see me publish!
Ehlers Hann Moving Average [CC]The Hann Moving Average is an original script but a slightly modified version of the Hann Window Filter created by John Ehlers. I am using the same length but changed the default data source to use the new Weighted Close that tv added after I requested it awhile ago so thank you tv! The big strength of this moving average/filter is that it creates an extremely smooth filter with the added benefit of very little lag to smooth ratio. The weakness of this moving average/filter is that it does have a decent amount of lag which means it isn't as useful during choppy periods but does work well for sustained uptrends or downtrends. Feel free to experiment and let me know what settings work better for you. I have included strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal signals are lighter in color. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators or scripts you would like to see me publish!
Tillson IE/2 [CC]The IE/2 was created by Tim Tillson (Stocks and Commodities Jan 1998) and this is a practically undiscovered gem because in that same article he goes on to to create the popular T3 moving average and the GDEma but practically no one seemed to notice the IE2 or maybe it is just my imagination. Anyway this indicator name is short for Integral of Linear Regression Slope + Endpoint Moving Average / 2 so you can why it was shortened to IE/2. Like the name implies this takes two variations of smoothing that complement each other and averages them together to in theory get the benefits of each. The EPMA is much noiser but follows the data more closely and the complete opposite for the ILRS so you can see the idea in action. Like all of my indicators I include strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal signals are lighter in color. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators or scripts you would like to see me publish!
Ehlers Hann Relative Strength Index [CC]The Hann Relative Strength Index was created by John Ehlers (Stocks and Commodities Jan 2022 pgs 26-28) and this indicator builds upon his Hann Window Indicator to create an unique rsi indicator that doesn't rely on overbought or oversold levels to determine a reversal point and also provides a very superior smoothing without any of the lag associated with traditional smoothing. A much more useful RSI than the standard version in my honest opinion. Short term you buy when the line turns green and sell when it turns red. Medium to long term you buy when the indicator rises above the 0 line and sell when it falls below the 0 line. I have included strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal signals are lighter in color.
Let me know if there are any other indicators or scripts you would like to see me publish!
Ehlers High Pass Filter [CC]The High Pass Filter was created by John Ehlers and I would define this indicator as both a momentum indicator but also a predictor indicator. This does a pretty good job of predicting future price action even though I have double smoothed it to provide clear buy and sell signals. I will be publishing quite a few more Ehlers indicators very soon so stay tuned. This indicator can be interpreted in a few different ways but most importantly it is a mid to long term sell signal when the indicator falls below the zero line and vice versa. It also falls below the zero line when the underlying price data starts losing momentum so it can be used also as a price reversal. I have included strong buy and sell signals in addition to normal ones so darker colors are strong signals and lighter colors are normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Ehlers Simple Window Indicator [CC]The Simple Window Indicator was created by John Ehlers (Stocks and Commodities Sep 2021) and this is the last of the 4 new indicators that he published in the latest issue of Stocks & Commodities. Since these are all part of a series, the idea behind each indicator is the exact same. The only difference is of course the calculation for each indicator. This script is different mostly because it is extremely noisy in comparison so I had to smooth it twice to provide clear buy and sell signals. Window functions are used in digital signal processing to filter out noise and the end result is an oscillator that centers around the 0 line. The easy way to understand these indicators that I will be publishing and those are that when they are above 0, it usually means an uptrend and below 0 then a downtrend. For more immediate signals, I have included both normal and strong buy and sell signals so darker colors for strong signals and lighter colors for normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like me to publish!
Ehlers Triangle Window Indicator [CC]The Triangle Window Indicator was created by John Ehlers (Stocks and Commodities Sep 2021) and this is one of 4 new indicators that he published in the latest issue of Stocks & Commodities and I will be publishing the last one tomorrow. Since these are all part of a series, the idea behind each indicator is the exact same. The only difference is of course the calculation for each indicator. Window functions are used in digital signal processing to filter out noise and the end result is an oscillator that centers around the 0 line. The easy way to understand these indicators that I will be publishing and those are that when they are above 0, it usually means an uptrend and below 0 then a downtrend. For more immediate signals, I have included both normal and strong buy and sell signals so darker colors for strong signals and lighter colors for normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like me to publish!
Ehlers Hamming Window Indicator [CC]The Hamming Window Indicator was created by John Ehlers (Stocks and Commodities Sep 2021) and this is one of 4 new indicators that he published in the latest issue of Stocks & Commodities and I will be publishing the other 2 in the next few days. Since these are all part of a series, the idea behind each indicator is the exact same. The only difference is of course the calculation for each indicator. Window functions are used in digital signal processing to filter out noise and the end result is an oscillator that centers around the 0 line. The easy way to understand these indicators that I will be publishing and those are that when they are above 0, it usually means an uptrend and below 0 then a downtrend. For more immediate signals, I have included both normal and strong buy and sell signals so darker colors for strong signals and lighter colors for normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like me to publish!
Ehlers Hann Window Indicator [CC]The Hann Window Indicator was created by John Ehlers (Stocks & Commodities Sep 2021) and this is one of 4 new indicators that he published in the latest issue of Stocks & Commodities and I will be publishing the other 3 in the next few days. Since these are all part of a series, the idea behind each indicator is the exact same. The only difference is of course the calculation for each indicator. Window functions are used in digital signal processing to filter out noise and the end result is an oscillator that centers around the 0 line. The easy way to understand these indicators that I will be publishing and those are that when they are above 0, it usually means an uptrend and below 0 then a downtrend. For more immediate signals, I have included both normal and strong buy and sell signals so darker colors for strong signals and lighter colors for normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like me to publish!
Support and Resistance Levels (v.3)Support and Resistance Levels augmanted and reprocessed
Description:
This is an augmented version of my earlier script that can be found here:
This time it features zigzag and channel lines, signal generation and filtering and performance testing. Signal generation and filtering procedures are used only for performance testing, not for the actual labelling. The labelling is governed by zigzag logic.
ADX Strategy (original)ADX Strategy
Description:
Generates a long entry signal when the Average Directional Index (ADX) value is greater than the trendlevel and the close is greater than the filter value, and/or generates a short entry signal when the ADX value is greater than the trendlevel and the close is less than the filter value.
The Average Directional Index evaluates the strength of a current trend. The ADX is an oscillator that fluctuates between 0 and 100. Values below 20 indicate a weak trend, values above 40 indicate a strong trend. The direction of the trend is not measured by this indicator.
As usual, the script features signal filtering/generation and a rough estimate of its performance.
Advanced Fractal Dimension Index [DW]This is an experimental study based on Benoit Mandelbrot's fractal dimension concepts.
Fractal dimension is a ratio providing a statistical measure of complexity comparing how detail in a pattern changes with the scale at which it's measured.
The concept of a fractional or fractal dimension was derived from an unconventional approach to standard geometric definitions.
We all know the standard geometric rules of dimension: D=0 is a point, D=1 is a line, D=2 is a plane, and D=3 is a volume, based on the number of axes being occupied.
However, by taking a fractal geometric approach, we can define dimension like so:
N = s^-D , where N is the number of measurement segments, s is the scale factor, and D is the dimension of the object being measured.
This approach typifies conventional knowledge of dimensions as well. Here are some basic examples:
If we divide a line segment into 4 equal line segments, then we'd get 4 = (1/4)^-D. Solving for D, we get D=1, which is what we'd expect from a line.
If we divide a square into 16 equal squares, we'd be separating each line on the square into 4 pieces, so 16 = (1/4)^-D. Solving for D, we get D=2, which is what we'd expect from a square.
If we divide a cube into 64 equal cubes, we'd be separating each line on the cube into 4 pieces, so 64 = (1/4)^-D. Solving for D, we get D=3, which is what we'd expect from a cube.
The same approach can be applied to fractal objects, although admittedly it's less intuitive.
Let's say you use a stick to measure a curve, then you divide the stick into 3 equal segments and re-measure the length.
But rather than the re-measured curve showing a length of 3 of the smaller segments, it is actually 4 segments long.
This irregularity means that detail has increased as you scaled your measurement down, so the curve is dimensionally higher than the space it resides in.
In this example: 4 = (1/3)^-D. Solving for D, we get D=1.2619.
For a true fractal, this scaling of self-similar measurements would continue infinitely.
However, unlike true fractals, most real world phenomena exhibit limited fractal properties, in which they can be scaled down to some limited quantity.
Many forms of time series data (seismic data, ECG data, financial data, etc.) have been theoretically shown to have limited fractal properties.
Consequently, we can estimate fractal dimension from this data to get an approximate measure of how rough or convoluted the data stream is.
Financial data's fractal dimension is limited to between 1 and 2, so it can be used to roughly approximate the Hurst Exponent by the relationship H = 2 - D.
When D=1.5, data statistically behaves like a random walk. D above 1.5 can be considered more rough or "mean reverting" due to the increase in complexity of the series.
D below 1.5 can be considered more prone to trending due to the decrease in complexity of the series.
In this study, you are given the option to apply equalization (EQ) to the dataset before estimating dimension.
This enables you to transform your data and observe how its complexity changes as well.
Whether you want to give emphasis to some frequencies, isolate specific bands, or completely alter the shape of your waveform, EQ filtration makes for an interesting experience.
The default EQ preset in this script removes the low shelf, then attenuates low end and high end oscillations.
The dominant cyclical components (bands 3 - 5 on default settings) are passed at 100%, keeping emphasis on 8 to 64 sample per cycle oscillations.
In addition, if you're wanting a simpler filter process, or if you want a little extra, there are options included to pre and post smooth the data with 2 pole Butterworth LPFs.
The dimension estimation in this script works by measuring changes in detail using source's maximum range over a given lookback length.
In essence, it recursively updates its length parameter based on changes in range compared to the maximum over the lookback period, then uses the data to solve for D.
The FDI algorithm works on any length greater than 1. However, I didn't notice any particularly meaningful results with lookback lengths of 15 or less.
A custom color scheme is included in this script as well for FDI fill and bar colors.
The color scheme in this script is a multicolored thermal styled gradient.
The scale of gradient values is determined by the designated high and low dimension thresholds. These thresholds determine what range of values the gradient will focus on.
Values at the high threshold are the coolest and darkest, and values at the low threshold are the warmest and brightest.
Basically, the "trendier" the data is, the brighter and warmer the color will be.
Signals and alerts are included as well for crossovers on the high and low dimension thresholds.
These signals can also be externally linked to another script.
The output format is 1 for the trigger, and 0 otherwise. Basic boolean logic.
To integrate these signals with your script, simply use a source input and select the signal output from this script that you wish to use from the dropdown menu.
Fractal dimension is a powerful tool that can give valuable insight about the complexity and persistence / anti-persistence of price movements.
When used in conjunction with other analytical methods, it can prove to be a surprisingly beneficial tool to have in the arsenal.
-----------------------------------------------------
This is a premium script, and access is granted on an invite-only basis.
To gain access, get a copy of the indicator overview, or for additional inquiries, send me a direct message.
I look forward to hearing from you!
-----------------------------------------------------
General Disclaimer:
Trading stocks, futures, Forex, options, ETFs, cryptocurrencies or any other financial instrument has large potential rewards, but also large potential risk.
You must be aware of the risks and be willing to accept them in order to invest in stocks, futures, Forex, options, ETFs or cryptocurrencies.
Don’t trade with money you can’t afford to lose.
This is neither a solicitation nor an offer to Buy/Sell stocks, futures, Forex, options, ETFs, cryptocurrencies or any other financial instrument.
No representation is being made that any account will or is likely to achieve profits or losses of any kind.
The past performance of any trading system or methodology is not necessarily indicative of future results.