Sinc Bollinger BandsKaiser Windowed Sinc Bollinger Bands Indicator
The Kaiser Windowed Sinc Bollinger Bands indicator combines the advanced filtering capabilities of the Kaiser Windowed Sinc Moving Average with the volatility measurement of Bollinger Bands. This indicator represents a sophisticated approach to trend identification and volatility analysis in financial markets.
Core Components
At the heart of this indicator is the Kaiser Windowed Sinc Moving Average, which utilizes the sinc function as an ideal low-pass filter, windowed by the Kaiser function. This combination allows for precise control over the frequency response of the moving average, effectively separating trend from noise in price data.
The sinc function, representing an ideal low-pass filter, provides the foundation for the moving average calculation. By using the sinc function, analysts can independently control two critical parameters: the cutoff frequency and the number of samples used. The cutoff frequency determines which price movements are considered significant (low frequency) and which are treated as noise (high frequency). The number of samples influences the filter's accuracy and steepness, allowing for a more precise approximation of the ideal low-pass filter without altering its fundamental frequency response characteristics.
The Kaiser window is applied to the sinc function to create a practical, finite-length filter while minimizing unwanted oscillations in the frequency domain. The alpha parameter of the Kaiser window allows users to fine-tune the trade-off between the main-lobe width and side-lobe levels in the frequency response.
Bollinger Bands Implementation
Building upon the Kaiser Windowed Sinc Moving Average, this indicator adds Bollinger Bands to provide a measure of price volatility. The bands are calculated by adding and subtracting a multiple of the standard deviation from the moving average.
Advanced Centered Standard Deviation Calculation
A unique feature of this indicator is its specialized standard deviation calculation for the centered mode. This method employs the Kaiser window to create a smooth deviation that serves as an highly effective envelope, even though it's always based on past data.
The centered standard deviation calculation works as follows:
It determines the effective sample size of the Kaiser window.
The window size is then adjusted to reflect the target sample size.
The source data is offset in the calculation to allow for proper centering.
This approach results in a highly accurate and smooth volatility estimation. The centered standard deviation provides a more refined and responsive measure of price volatility compared to traditional methods, particularly useful for historical analysis and backtesting.
Operational Modes
The indicator offers two operational modes:
Non-Centered (Real-time) Mode: Uses half of the windowed sinc function and a traditional standard deviation calculation. This mode is suitable for real-time analysis and current market conditions.
Centered Mode: Utilizes the full windowed sinc function and the specialized Kaiser window-based standard deviation calculation. While this mode introduces a delay, it offers the most accurate trend and volatility identification for historical analysis.
Customizable Parameters
The Kaiser Windowed Sinc Bollinger Bands indicator provides several key parameters for customization:
Cutoff: Controls the filter's cutoff frequency, determining the divide between trends and noise.
Number of Samples: Sets the number of samples used in the FIR filter calculation, affecting the filter's accuracy and computational complexity.
Alpha: Influences the shape of the Kaiser window, allowing for fine-tuning of the filter's frequency response characteristics.
Standard Deviation Length: Determines the period over which volatility is calculated.
Multiplier: Sets the number of standard deviations used for the Bollinger Bands.
Centered Alpha: Specific to the centered mode, this parameter affects the Kaiser window used in the specialized standard deviation calculation.
Visualization Features
To enhance the analytical value of the indicator, several visualization options are included:
Gradient Coloring: Offers a range of color schemes to represent trend direction and strength for the moving average line.
Glow Effect: An optional visual enhancement for improved line visibility.
Background Fill: Highlights the area between the Bollinger Bands, aiding in volatility visualization.
Applications in Technical Analysis
The Kaiser Windowed Sinc Bollinger Bands indicator is particularly useful for:
Precise trend identification with reduced noise influence
Advanced volatility analysis, especially in the centered mode
Identifying potential overbought and oversold conditions
Recognizing periods of price consolidation and potential breakouts
Compared to traditional Bollinger Bands, this indicator offers superior frequency response characteristics in its moving average and a more refined volatility measurement, especially in centered mode. These features allow for a more nuanced analysis of price trends and volatility patterns across various market conditions and timeframes.
Conclusion
The Kaiser Windowed Sinc Bollinger Bands indicator represents a significant advancement in technical analysis tools. By combining the ideal low-pass filter characteristics of the sinc function, the practical benefits of Kaiser windowing, and an innovative approach to volatility measurement, this indicator provides traders and analysts with a sophisticated instrument for examining price trends and market volatility.
Its implementation in Pine Script contributes to the TradingView community by making advanced signal processing and statistical techniques accessible for experimentation and further development in technical analysis. This indicator serves not only as a practical tool for market analysis but also as an educational resource for those interested in the intersection of signal processing, statistics, and financial markets.
Related:
Window
Sinc MAKaiser Windowed Sinc Moving Average Indicator
The Kaiser Windowed Sinc Moving Average is an advanced technical indicator that combines the sinc function with the Kaiser window to create a highly customizable finite impulse response (FIR) filter for financial time series analysis.
Sinc Function: The Ideal Low-Pass Filter
At the core of this indicator is the sinc function, which represents the impulse response of an ideal low-pass filter. In signal processing and technical analysis, the sinc function is crucial because it allows for the creation of filters with precise frequency cutoff characteristics. When applied to financial data, this means the ability to separate long-term trends from short-term fluctuations with remarkable accuracy.
The primary advantage of using a sinc-based filter is the independent control over two critical parameters: the cutoff frequency and the number of samples used. The cutoff frequency, analogous to the "length" in traditional moving averages, determines which price movements are considered significant (low frequency) and which are treated as noise (high frequency). By adjusting the cutoff, analysts can fine-tune the filter to respond to specific market cycles or timeframes of interest.
The number of samples used in the filter doesn't affect the cutoff frequency but instead influences the filter's accuracy and steepness. Increasing the sample size results in a better approximation of the ideal low-pass filter, leading to sharper transitions between passed and attenuated frequencies. This allows for more precise trend identification and noise reduction without changing the fundamental frequency response characteristics.
Kaiser Window: Optimizing the Sinc Filter
While the sinc function provides excellent frequency domain characteristics, it has infinite length in the time domain, which is impractical for real-world applications. This is where the Kaiser window comes into play. By applying the Kaiser window to the sinc function, we create a finite-length filter that approximates the ideal response while minimizing unwanted oscillations (known as the Gibbs phenomenon) in the frequency domain.
The Kaiser window introduces an additional parameter, alpha, which controls the trade-off between the main-lobe width and side-lobe levels in the frequency response. This parameter allows users to fine-tune the filter's behavior, balancing between sharp cutoffs and minimal ripple effects.
Customizable Parameters
The Kaiser Windowed Sinc Moving Average offers several key parameters for customization:
Cutoff: Controls the filter's cutoff frequency, determining the divide between trends and noise.
Length: Sets the number of samples used in the FIR filter calculation, affecting the filter's accuracy and computational complexity.
Alpha: Influences the shape of the Kaiser window, allowing for fine-tuning of the filter's frequency response characteristics.
Centered and Non-Centered Modes
The indicator provides two operational modes:
Non-Centered (Real-time) Mode: Uses half of the windowed sinc function, suitable for real-time analysis and current market conditions.
Centered Mode: Utilizes the full windowed sinc function, resulting in a zero-phase filter. This mode introduces a delay but offers the most accurate trend identification for historical analysis.
Visualization Features
To enhance the analytical value of the indicator, several visualization options are included:
Gradient Coloring: Offers a range of color schemes to represent trend direction and strength.
Glow Effect: An optional visual enhancement for improved line visibility.
Background Fill: Highlights the area between the moving average and price, aiding in trend visualization.
Applications in Technical Analysis
The Kaiser Windowed Sinc Moving Average is particularly useful for precise trend identification, cycle analysis, and noise reduction in financial time series. Its ability to create custom low-pass filters with independent control over cutoff and filter accuracy makes it a powerful tool for analyzing various market conditions and timeframes.
Compared to traditional moving averages, this indicator offers superior frequency response characteristics and reduced lag in trend identification when properly tuned. It provides greater flexibility in filter design, allowing analysts to create moving averages tailored to specific trading strategies or market behaviors.
Conclusion
The Kaiser Windowed Sinc Moving Average represents an advanced approach to price smoothing and trend identification in technical analysis. By making the ideal low-pass filter characteristics of the sinc function practically applicable through Kaiser windowing, this indicator provides traders and analysts with a sophisticated tool for examining price trends and cycles.
Its implementation in Pine Script contributes to the TradingView community by making advanced signal processing techniques accessible for experimentation and further development in technical analysis. This indicator serves not only as a practical tool for market analysis but also as an educational resource for those interested in the intersection of signal processing and financial markets.
Related script:
Kaiser Window MAKaiser Window Moving Average Indicator
The Kaiser Window Moving Average is a technical indicator that implements the Kaiser window function in the context of a moving average. This indicator serves as an example of applying the Kaiser window and the modified Bessel function of the first kind in technical analysis, providing an open-source implementation of these functions in the TradingView Pine Script ecosystem.
Key Components
Kaiser Window Implementation
This indicator incorporates the Kaiser window, a parameterized window function with certain frequency response characteristics. By making this implementation available in Pine Script, it allows for exploration and experimentation with the Kaiser window in the context of financial time series analysis.
Modified Bessel Function of the First Kind
The indicator includes an implementation of the modified Bessel function of the first kind, which is integral to the Kaiser window calculation. This mathematical function is now accessible within TradingView, potentially useful for other custom indicators or studies.
Customizable Alpha Parameter
The indicator features an adjustable alpha parameter, which directly influences the shape of the Kaiser window. This parameter allows for experimentation with the indicator's behavior:
Lower alpha values: The indicator's behavior approaches that of a Simple Moving Average (SMA)
Moderate alpha values: The behavior becomes more similar to a Weighted Moving Average (WMA)
Higher alpha values: Increases the weight of more recent data points
In signal processing terms, the alpha parameter affects the trade-off between main-lobe width and side lobe level in the frequency domain.
Centered and Non-Centered Modes
The indicator offers two operational modes:
Non-Centered (Real-time) Mode: Uses half of the Kaiser window, starting from the peak. This mode operates similarly to traditional moving averages, suitable for real-time analysis.
Centered Mode: Utilizes the full Kaiser window, resulting in a phase-correct filter. This mode introduces a delay equal to half the window size, with the plot automatically offset to align with the correct time points.
Visualization Options
The indicator includes several visualization features to aid in analysis:
Gradient Coloring: Offers three gradient options:
• Three-color gradient: Includes a neutral color
• Two-color gradient: Traditional up/down color scheme
• Solid color: For a uniform appearance
Glow Effect: An optional visual enhancement for the moving average line.
Background Fill: An option to fill the area between the moving average and the price.
Use Cases
The Kaiser Window Moving Average can be applied similarly to other moving averages. Its primary value lies in providing an example implementation of the Kaiser window and modified Bessel function in TradingView. It serves as a starting point for traders and analysts interested in exploring these mathematical concepts in the context of technical analysis.
Conclusion
The Kaiser Window Moving Average indicator demonstrates the application of the Kaiser window function in a moving average calculation. By providing open-source implementations of the Kaiser window and the modified Bessel function of the first kind, this indicator contributes to the expansion of available mathematical tools in the TradingView Pine Script environment, potentially facilitating further experimentation and development in technical analysis.
Adaptive MFT Extremum Pivots [Elysian_Mind]Adaptive MFT Extremum Pivots
Overview:
The Adaptive MFT Extremum Pivots indicator, developed by Elysian_Mind, is a powerful Pine Script tool that dynamically displays key market levels, including Monthly Highs/Lows, Weekly Extremums, Pivot Points, and dynamic Resistances/Supports. The term "dynamic" emphasizes the adaptive nature of the calculated levels, ensuring they reflect real-time market conditions. I thank Zandalin for the excellent table design.
---
Chart Explanation:
The table, a visual output of the script, is conveniently positioned in the bottom right corner of the screen, showcasing the indicator's dynamic results. The configuration block, elucidated in the documentation, empowers users to customize the display position. The default placement is at the bottom right, exemplified in the accompanying chart.
The deliberate design ensures that the table does not obscure the candlesticks, with traders commonly situating it outside the candle area. However, the flexibility exists to overlay the table onto the candles. Thanks to transparent cells, the underlying chart remains visible even with the table displayed atop.
In the initial column of the table, users will find labels for the monthly high and low, accompanied by their respective numerical values. The default precision for these values is set at #.###, yet this can be adjusted within the configuration block to suit markets with varying degrees of volatility.
Mirroring this layout, the last column of the table presents the weekly high and low data. This arrangement is part of the upper half of the table. Transitioning to the lower half, users encounter the resistance levels in the first column and the support levels in the last column.
At the center of the table, prominently displayed, is the monthly pivot point. For a comprehensive understanding of the calculations governing these values, users can refer to the documentation. Importantly, users retain the freedom to modify these mathematical calculations, with the table seamlessly updating to reflect any adjustments made.
Noteworthy is the table's persistence; it continues to display reliably even if users choose to customize the mathematical calculations, providing a consistent and adaptable tool for informed decision-making in trading.
This detailed breakdown offers traders a clear guide to interpreting the information presented by the table, ensuring optimal use and understanding of the Adaptive MFT Extremum Pivots indicator.
---
Usage:
Table Layout:
The table is a crucial component of this indicator, providing a structured representation of various market levels. Color-coded cells enhance readability, with blue indicating key levels and a semi-transparent background to maintain chart visibility.
1. Utilizing a Table for Enhanced Visibility:
In presenting this wealth of information, the indicator employs a table format beneath the chart. The use of a table is deliberate and offers several advantages:
2. Structured Organization:
The table organizes the diverse data into a structured format, enhancing clarity and making it easier for traders to locate specific information.
3. Concise Presentation:
A table allows for the concise presentation of multiple data points without cluttering the main chart. Traders can quickly reference key levels without distraction.
4. Dynamic Visibility:
As the market dynamically evolves, the table seamlessly updates in real-time, ensuring that the most relevant information is readily visible without obstructing the candlestick chart.
5. Color Coding for Readability:
Color-coded cells in the table not only add visual appeal but also serve a functional purpose by improving readability. Key levels are easily distinguishable, contributing to efficient analysis.
Data Values:
Numerical values for each level are displayed in their respective cells, with precision defined by the iPrecision configuration parameter.
Configuration:
// User configuration: You can modify this part without code understanding
// Table location configuration
// Position: Table
const string iPosition = position.bottom_right
// Width: Table borders
const int iBorderWidth = 1
// Color configuration
// Color: Borders
const color iBorderColor = color.new(color.white, 75)
// Color: Table background
const color iTableColor = color.new(#2B2A29, 25)
// Color: Title cell background
const color iTitleCellColor = color.new(#171F54, 0)
// Color: Characters
const color iCharColor = color.white
// Color: Data cell background
const color iDataCellColor = color.new(#25456E, 0)
// Precision: Numerical data
const int iPrecision = 3
// End of configuration
The code includes a configuration block where users can customize the following parameters:
Precision of Numerical Table Data (iPrecision):
// Precision: Numerical data
const int iPrecision = 3
This parameter (iPrecision) sets the precision of the numerical values displayed in the table. The default value is 3, displaying numbers in #.### format.
Position of the Table (iPosition):
// Position: Table
const string iPosition = position.bottom_right
This parameter (iPosition) sets the position of the table on the chart. The default is position.bottom_right.
Color preferences
Table borders (iBorderColor):
// Color: Borders
const color iBorderColor = color.new(color.white, 75)
This parameters (iBorderColor) sets the color of the borders everywhere within the window.
Table Background (iTableColor):
// Color: Table background
const color iTableColor = color.new(#2B2A29, 25)
This is the background color of the table. If you've got cells without custom background color, this color will be their background.
Title Cell Background (iTitleCellColor):
// Color: Title cell background
const color iTitleCellColor = color.new(#171F54, 0)
This is the background color the title cells. You can set the background of data cells and text color elsewhere.
Text (iCharColor):
// Color: Characters
const color iCharColor = color.white
This is the color of the text - titles and data - within the table window. If you change any of the background colors, you might want to change this parameter to ensure visibility.
Data Cell Background: (iDataCellColor):
// Color: Data cell background
const color iDataCellColor = color.new(#25456E, 0)
The data cells have a background color to differ from title cells. You can configure this is a different parameter (iDataColor). You might even set the same color for data as for the titles if you will.
---
Mathematical Background:
Monthly and Weekly Extremums:
The indicator calculates the High (H) and Low (L) of the previous month and week, ensuring accurate representation of these key levels.
Standard Monthly Pivot Point:
The standard pivot point is determined based on the previous month's data using the formula:
PivotPoint = (PrevMonthHigh + PrevMonthLow + Close ) / 3
Monthly Pivot Points (R1, R2, R3, S1, S2, S3):
Additional pivot points are calculated for Resistances (R) and Supports (S) using the monthly data:
R1 = 2 * PivotPoint - PrevMonthLow
S1 = 2 * PivotPoint - PrevMonthHigh
R2 = PivotPoint + (PrevMonthHigh - PrevMonthLow)
S2 = PivotPoint - (PrevMonthHigh - PrevMonthLow)
R3 = PrevMonthHigh + 2 * (PivotPoint - PrevMonthLow)
S3 = PrevMonthLow - 2 * (PrevMonthHigh - PivotPoint)
---
Code Explanation and Interpretation:
The table displayed beneath the chart provides the following information:
Monthly Extremums:
(H) High of the previous month
(L) Low of the previous month
// Function to get the high and low of the previous month
getPrevMonthHighLow() =>
var float prevMonthHigh = na
var float prevMonthLow = na
monthChanged = month(time) != month(time )
if (monthChanged)
prevMonthHigh := high
prevMonthLow := low
Weekly Extremums:
(H) High of the previous week
(L) Low of the previous week
// Function to get the high and low of the previous week
getPrevWeekHighLow() =>
var float prevWeekHigh = na
var float prevWeekLow = na
weekChanged = weekofyear(time) != weekofyear(time )
if (weekChanged)
prevWeekHigh := high
prevWeekLow := low
Monthly Pivots:
Pivot: Standard pivot point based on the previous month's data
// Function to calculate the standard pivot point based on the previous month's data
getStandardPivotPoint() =>
= getPrevMonthHighLow()
pivotPoint = (prevMonthHigh + prevMonthLow + close ) / 3
Resistances:
R3, R2, R1: Monthly resistance levels
// Function to calculate additional pivot points based on the monthly data
getMonthlyPivotPoints() =>
= getPrevMonthHighLow()
pivotPoint = (prevMonthHigh + prevMonthLow + close ) / 3
r1 = (2 * pivotPoint) - prevMonthLow
s1 = (2 * pivotPoint) - prevMonthHigh
r2 = pivotPoint + (prevMonthHigh - prevMonthLow)
s2 = pivotPoint - (prevMonthHigh - prevMonthLow)
r3 = prevMonthHigh + 2 * (pivotPoint - prevMonthLow)
s3 = prevMonthLow - 2 * (prevMonthHigh - pivotPoint)
Initializing and Populating the Table:
The myTable variable initializes the table with a blue background, and subsequent table.cell functions populate the table with headers and data.
// Initialize the table with adjusted bgcolor
var myTable = table.new(position = iPosition, columns = 5, rows = 10, bgcolor = color.new(color.blue, 90), border_width = 1, border_color = color.new(color.blue, 70))
Dynamic Data Population:
Data is dynamically populated in the table using the calculated values for Monthly Extremums, Weekly Extremums, Monthly Pivot Points, Resistances, and Supports.
// Add rows dynamically with data
= getPrevMonthHighLow()
= getPrevWeekHighLow()
= getMonthlyPivotPoints()
---
Conclusion:
The Adaptive MFT Extremum Pivots indicator offers traders a detailed and clear representation of critical market levels, empowering them to make informed decisions. However, users should carefully analyze the market and consider their individual risk tolerance before making any trading decisions. The indicator's disclaimer emphasizes that it is not investment advice, and the author and script provider are not responsible for any financial losses incurred.
---
Disclaimer:
This indicator is not investment advice. Trading decisions should be made based on a careful analysis of the market and individual risk tolerance. The author and script provider are not responsible for any financial losses incurred.
Kind regards,
Ely
ICT Time Windows by Scuba SteveJust an easy to use time based indicator that allows you to track ICT London Open Killzone, New York Open killzone, AM session Silver Bullet time window & PM Session Silver Bullet Time Window, and last but not least the Last Hour of trading which often has nice moves.
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!
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 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!
How To Set Backtest Time Ranges
Example how to set the time range window to be backtested for both entries and exits. Additional examples are also included showing how to set the date range and toggle plot visibility.
By incorporating this code with your own strategy's logic, it will allow you to backtest various time windows.
Much gratitude to @LucF and @a.tesla2018 for help with including ':1234567' for time ranges on weekends. Thank you both!
NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
How To Auto Set Date RangeExample how to automatically set the date range window to be backtested from X days or weeks ago to present. Additional options are also included to manually set the date range or to show entire range available.
Normally when you change chart period it changes the number of days being backtested, which means as you increase the chart period (for example from 5min to 15min), you also increase the number of days traded. So you can not compare apples to apples for which period would yield best performance for your strategy.
By incorporating this code with your own strategy's logic (replacing buy and sell), it will allow you to compare results of different period backtests over the same duration of time.
Date Range: ALL uses entire history.
Date Range: DAYS uses number you set in # Days or Weeks
Date Range: WEEKS uses number you set in # Days or Weeks
Date Range: MANUAL uses manual dates you set in From and To fields
Much gratitude to @pinechrix for suggesting this improvement to me, and to @Gesundheit for pointing me in the right direction on the original example I published previously. Thank you both!
NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
How To Set Backtest Date RangeExample how to select and set date range window to be backtested. Normally when you change chart period it changes the number of days being backtested which means as you increas the chart period (for example from 5min to 15min) you also increase the number of days traded, so you can not compare apples to apples for which period would yield best returns for your strategy. Now you can. Incorporate this code replacing buy and sell with your strategy, then simply input the From and To dates in Format -> Inputs, and then change the chart period to view updated results.
NOTE: There is a limit in backtesting to 2000 orders, so please be aware of this when setting your date ranges. If you set your range too high, you may be exceeding this limit on some periods and not on others, so this would yield incorrect comparison of returns per period. If you see in your backtesting results that you are nearing this limit for one of your periods you are testing, then reduce the date range to a smaller number of days.
Enjoy!
(Thanks to @Gesundheit "Adeel" for pointing me in the right direction on this!)