type
status
date
slug
summary
AI summary
AI translation
tags
category
password
icon
💡
By registering an account on OKX Crypto Exchange using the invitation link from blackcat1402, you can enjoy several benefits. These include a 10% rebate on spot contract trades, a 20% discount on fees, permanent access to blackcat1402 Membership and Advanced Indicators, free internal testing of the Advanced Trading System, and exclusive services such as member technical indicator customization and development.
💡
OKX Crypto Exchange blackcat1402 invitation registration link:
Hello everyone, today I want to share my TradeStation formula alchemy with you, hoping to help you quickly select truly practical and useful indicators.
Firstly, we all know that TradeStation software has a wide variety of formulas, which can be overwhelming. But how can we find the truly useful indicators from them? This requires the help of my cat's sense of smell! My cat's sense of smell is very sensitive and can sniff out those indicators with potential.
notion image
Also, this cat combines the theory of John F Ehlers filters introduced in previous articles. This theory states that indicators that usually include recursive filters perform exceptionally well in practical applications. New friends who don't understand filter theory can refer back to the previous articles.
So, what are recursive filters? Simply put, recursive filters are indicators that can smooth out the current price. They can filter out some noise and display trends more accurately. Based on my experience, I have summarized an unwritten TradeStation formula: formulas that usually include some kind of novel recursive filter are likely to be high-quality, assuming there are no future functions.
Why is that? Because recursive filters can make indicators closer to the true price movement and reduce the possibility of misjudgment. Therefore, these types of indicators are usually more reliable in practical applications. Whether it's short-term or long-term trading, I recommend everyone to try using indicators that include recursive filters. They may be your secret weapon for increasing profits! Of course, the above are just some of my personal insights and experiences. In stock selection, timing, and trading processes, other factors need to be considered. However, I firmly believe that sharing the TradeStation formula gold mining technique today can help you quickly find truly practical and good indicators.
I am able to have this theoretical foundation thanks to years of studying John F Ehlers' market theory, while you, the viewers, get to directly access the essence, which is a win. Additionally, being able to understand today's article still requires a theoretical foundation from the previous ones.
First, what is a recursive filter?
A recursive filter, also known as an IIR (Infinite Impulse Response) filter, is a type of digital filter whose output is a function of the current input, past inputs, and past outputs. Because it depends on previous output values, it has "memory" and can recursively use these old outputs to influence new outputs. This contrasts with non-recursive filters (such as FIR filters, Finite Impulse Response), where the output is solely based on input values. Recursive filters are also referred to as IIR filters (Infinite Impulse Response filters). The characteristic of an IIR filter is that its impulse response is infinite, in contrast to FIR (Finite Impulse Response) filters, which have a finite impulse response. The output of an IIR filter not only depends on the current and past inputs but also on past outputs, which is where the term "recursive" comes from. Based on the theory of digital signal processing (DSP), we need to have the ability to distinguish between these two types of filters.

Filters in Digital Signal Processing

In digital signal processing, filters are an important technique used to process time series data. There are primarily two methods for designing filters: Finite Impulse Response (FIR) and Infinite Impulse Response (IIR). These concepts were originally introduced by John F. Ehlers and applied to time series data in financial markets.
Finite Impulse Response (FIR) Filters:
  1. The output of FIR filters is based only on a finite number of input values and does not use past output values.
  1. The response of FIR filters decays to zero within a finite time and is fixed.
  1. Due to not using past output values, FIR filters have inherent stability.
  1. When a highly smooth output is required, FIR filters may introduce more delay.
Infinite Impulse Response (IIR) Filters:
  1. The output of IIR filters is based on both the input and previous output values and can extend infinitely.
  1. IIR filters can be more compact and efficient, but they also carry the risk of stability issues.
  1. Due to the use of past output values, IIR filters have a faster response but may introduce oscillations.
Differences from Traditional Filters:
  1. In financial analysis, low-pass, high-pass, and band-pass filters refer to the frequency response characteristics of the filters, not their implementation methods. A low-pass filter allows low-frequency components to pass through, while a high-pass filter allows high-frequency components to pass through.
  1. FIR and IIR describe the structure and operation of the filters, not the types of frequency they filter.
  1. Therefore, a low-pass filter can be designed using either FIR or IIR, and similarly, high-pass or band-pass filters can also be based on FIR or IIR.
Overall, FIR and IIR offer different implementations and design methods for filters, while low-pass, high-pass, and band-pass describe the frequency characteristics of the filters. John F. Ehlers utilized these concepts in digital signal processing to create more advanced and adaptable technical indicators.
In TradingView, many commonly used moving averages or filters can be classified as FIR or IIR structures. Here are some common moving averages and their corresponding structures:
FIR (Finite Impulse Response) Structure:
  1. Simple Moving Average (SMA): This is a basic FIR filter that calculates the average of a fixed number of prices over a recent period of time.
  1. Weighted Moving Average (WMA): This is also an FIR filter, but it assigns more weight to the most recent data points.
  1. Triangular Moving Average: It is a variation of WMA that applies weighted averages to the data points twice.
IIR (Infinite Impulse Response) Structure:
  1. Exponential Moving Average (EMA): EMA is an IIR filter. It considers all previous data but gives more weight to the most recent data.
  1. Double Exponential Moving Average (DEMA) and Triple Exponential Moving Average (TEMA): These are extensions of EMA that reduce lag by using complex calculations. They are both based on IIR structures.
  1. Wilder's Moving Average (Wilder's MA): This is another IIR filter commonly used in calculating RSI.
These are just a few examples of the moving averages and filters available in TradeStation. Each type of moving average has its own characteristics and uses. The choice of which one to use depends primarily on your trading strategy and goals. However, understanding the FIR and IIR structures behind them can help you better understand how they work and their potential advantages and limitations.
Through the above technical introduction, there are actually many common recursive filters, such as EMA and DEMA, which are very good performing moving averages. However, when I mentioned "alchemy", I am not referring to technical indicators in TradeStation formulas that include these "common" recursive filters. So, don't assume that any indicator that includes EMA is a good indicator. What I am referring to are TradeStation formulas that have "non-typical" but possess the characteristics of generalized recursive filters. Not all of these are top-notch indicators, but high-quality technical indicators often include recursive filters. I can only mention this point briefly, as success depends on the individual.
The reason why technical indicators in TradeStation formulas that include "non-typical" recursive filters are likely to be high-quality is because recursive filters are especially suitable for real-time systems as they usually require less computational and storage resources. However, due to their recursive nature, they may become unstable under certain conditions. Moreover, their characteristic of using previous outputs as inputs makes them particularly prone to "adaptability", thus possessing the characteristics of adaptive filters in JFE theory. Therefore, these technical indicators often demonstrate strong adaptability when facing market style changes.
Let's take an example:
The Kalman filter is an effective recursive filter that provides a way to estimate the state of a linear dynamic system. It was proposed by Rudolf E. Kalman in 1950. Here is a simple explanation of its principles and usage:

Principle:

  1. Two main steps: Prediction step and update step.
      • Prediction step: Predicts the current state based on past estimates.
      • Update step: Updates the predicted state when new measurement is received.
  1. Consideration of noise: Kalman filter is specifically designed to handle two types of noise in the system: process noise (uncertainty within the system) and measurement noise (uncertainty of the measuring device).
  1. Recursiveness: Kalman filter uses past estimates and the latest measurement to update the current state estimation. This recursiveness makes it particularly useful in real-time systems.

Usage:

  1. State estimation: In many applications, it is not possible to directly measure certain states due to various reasons. Kalman filter provides a method to estimate these states from measurable states.
  1. Sensor fusion: In a multi-sensor environment, Kalman filter can integrate information from different sensors to provide an optimal estimation.
  1. Application areas: Kalman filter is widely used in aviation, autonomous vehicles, robotics, economic forecasting, and many other fields.
  1. Implementation: To implement Kalman filter, you need to know the dynamics of the system (usually defined by a state transition matrix), statistical characteristics of process and measurement noise, and information on how measurements are obtained from the state.
In summary, Kalman filter is a powerful tool for estimating the state of a linear dynamic system, especially when there is uncertainty in these states and measurements.
And smart people studying the market, under the pressure of "limited TradeStation computing resources and expression methods" as I often say, may develop their own recursive filters that are equivalent to "Kalman filters" (although it is not appropriate to say so, but the principle is easier to understand). These highly adaptive recursive filters often exhibit excellent performance to the point where their excellence can be visually observed. However, many people tend to overlook them because they do not know why they are so excellent, how they are classified, and how to distinguish them.
The important thing is to say it in one sentence. To be honest, after saying the above paragraph, this cat feels that it can already come to an end. As for how to find indicators in TradeStation formulas that include excellent recursive filters, it depends on your abilities and luck. And as long as you are interested, when you come across code related to recursive filters, you will naturally feel some "excitement". In any case, here are some inspirations. You can start with the recursive filters below to understand their characteristics and methods. Pay attention when reading the code. Many experienced individuals who write effective TradeStation formulas probably don't even realize that they are writing code similar to a simplified Kalman filter...
Recursive filters and non-recursive filters are mainly used in digital signal processing. The following are common types of these two types of filters:
Recursive Filters (IIR):
  1. Butterworth Filter: It provides the maximum flat frequency response.
  1. Chebyshev Filter: It has two types, Type I and Type II, where Type I allows ripple in the passband and Type II has some ripple in the stopband.
  1. Elliptic (or Cauer) Filter: This filter has ripple in both the passband and the stopband.
  1. Bessel Filter: It provides the optimal phase response.
  1. Legendre Filter: It falls between Butterworth and Chebyshev, aiming to provide a better balance between the stopband and the passband.
  1. Kalman Filter: Primarily used for estimating time-varying system parameters.
  1. Exponential Moving Average (EMA): Commonly used in financial time series data.
  1. Weighted Moving Average (WMA)
  1. High-order IIR Filters: These can be constructed by cascading or paralleling low-order filters.
  1. Adaptive Filters: These filters can be adjusted based on the statistical characteristics of the input signal.
Non-Recursive Filters (FIR):
  1. Windowing Method: This includes Hamming window, Hanning window, Blackman window, etc.
  1. Frequency Sampling Method: Another common FIR design method.
  1. Parks-McClellan Algorithm: This is an optimization method commonly used for designing FIR filters.
  1. Gaussian Filter
  1. Sinc Filter
  1. Simple Moving Average (SMA)
  1. Triangle Filter: Also known as double moving average filter.
  1. Bandpass, Bandstop, and Allpass FIR Filters: These are designed based on the desired frequency response.
  1. Gaussian Filter
  1. Raised Cosine Filter: Commonly used in communication systems.
It should be noted that this list is based on the context of digital signal processing, and in the field of finance and other applications, only some of these filters may be widely used in the market.
数字魔法师:揭秘Pine脚本的实时K线原理通达信公式淘金秘诀:是否具备递归滤波器特征
blackcat1402
blackcat1402
This cat is an esteemed coding influencer on TradingView, commanding an audience of over 8,000 followers. This cat is proficient in developing quantitative trading algorithms across a diverse range of programming languages, a skill that has garnered widespread acclaim. Consistently, this cat shares invaluable trading strategies and coding insights. Regardless of whether you are a novice or a veteran in the field, you can derive an abundance of valuable information and inspiration from this blog.
Announcement
type
status
date
slug
summary
AI summary
AI translation
tags
category
password
icon
🎉Webhook Signal Bots for Crypto are Coming!🎉
--- Stay Tuned ---
👏From TradingView to OKX, Binance and Bybit Exchange Directly!👏