Digital Signal Processing for Trading Strategy
Spectral analysis in modern trading
Any trading signal is organized in a rather complicated way. It can be concluded that it consists of many rhythms with different periods, and the rhythms are not constant - they appear and disappear during their evolution in time. The structure of quotes signal rhythms can be evaluated using the digital spectrum analysis used in digital signal processing.
Spectral analysis is now widely used in trading. Figure 1 shows a typical spectrum of some signal quotes. The peaks with different heights on the spectrum graph reflect the magnitude (amplitude sweep) of the rhythms with the corresponding periods. The spectrum graph is displayed in the range of periods up to 100 (rightmost value).
Figure 1 shows that the range of rhythms in magnitude (amplitude) increases with increasing periods of rhythms (the height of the spectrum peaks increases from left to right), this is almost always observed for the quotation signals of various traded instruments.
We can conclude that the quote signal on average consists of a set of rhythms, superimposed on each other, and the amplitude of the rhythms is greater the greater the value of the period.
Indicators or digital filters
When building a trading strategy using digital signal processing technology it is possible to separate these rhythms from each other and make trading decisions based on their correlationthat is, to form trading signals.
To divide (stratify) a complex quotation signal into simpler components (rhythms with different periods and different amplitude sweeps), digital filters are used. Now the methods of calculation and development of digital filters are widely enough presented in numerous literature.
Indicators: low-pass filters
To divide (stratify) a complex quote signal into simpler components we will use digital low-pass filters (LPF), for example, moving average SMA. The task of SMA is to smooth (average) all fluctuations with periods smaller than the averaging period of SMA and leave out (pass) all fluctuations with periods larger than the averaging period of the indicator. The low-pass filter does the same, but
- there is a possibility of stronger suppression of the averaged fast oscillations (higher quality of smoothing),
- change the ratio of passing (non-smoothed) rhythms (i.e., change the desired reaction of the smoothed curve to the change in the quotation signal over time),
- control the insertion delay of the LPF (i.e., control the response of the smoothed curve to changes in the quotation signal).
Different types of moving averages: SMA, EMA, weighted moving averages, previously published moving average with improved smoothing quality RAMA - are low-pass filters (LPFs).
Let's look at some examples
Figure 2 shows the previously published moving average RAMA(60) with a smoothing period of 60, also shows the oscillator obtained using two digital LPFs, that is the double smoothed curve - the result of smoothing by these two digital LPFs. The digital LPFs were calculated specifically according to the standard methods given in the literature to emphasize the structure of the signal rhythms of the quotes. It should be noted that the oscillator (indicator), obtained using two specially calculated digital LPFs, is located in the quotation window, instead of in the footnote "below", which is convenient, because the smoothed curves oscillator in this case are also level lines (reference lines) for quotation charts.
Figure 3 shows a moving average RAMA (40) with a smoothing period of 40 and an oscillator obtained using two calculated digital LPFs with the appropriate (selected) settings.
Figure 4 shows the RAMA (20) and the appropriately tuned oscillator of two digital LPFs, adding a signal (blue) line from the output of another digital LPF with a small smoothing period.
In Figure 5, the graphs of Figures 2-4 are combined.
Therefore, Figure 5 shows three modified moving averages with periods of 60, 40 and 20, as well as three oscillators, obtained using pairs of digital pulses, and an additional signal line, obtained using one digital pulses. The figure clearly shows the decomposition of the quote signal into simpler rhythm structures, which can be used to build effective trading strategies.
Check the effectiveness of the assembly
Figures 6, 7, 8 show charts with saved settings for other parts of the quotation charts.
Digital signal processing opens up a wide range of technological possibilities for use in trading. Currently, the methods for calculating various digital filters are widely available in numerous literature and digital filtering is used in various technical analysis systems. Digital filters are a powerful and flexible tool for building effective trading strategies.