Indicators Input Window Length - Problems And SolutionsIntroduction
Most technical indicators possesses a user defined input window length, this input affect the indicator output and for a long time, have been the cause of many innovations in technical analysis.
In this post i want to discuss the effects and particularities of indicators inputs window length, the challenges they introduce in trading and their effect when paired with machine learning forecasting models, i hope this post will be easy to read, let me know if you had difficulties understanding it.
Speed And Efficiency Problems
An input window length can involve the number of data processed by the indicator, therefore higher window length's will process more data, which result in a slower computation time, therefore in high-frequency/algorithmic trading where response time matter, maximizing the profitability might be made at the cost of the indicator response time, and even if computerized trading has been praised for its speed, small lag times can actually affect your strategy, therefore one might enter a trade at a different value than the targeted price.
Note : High frequency trading (hft) is a commonly mistaken term, one might believe that hft require the trader to open and close a large number of trades in a short amount of time, in reality hft is related to the "rate at which data is processed".
Solution - Efficient Data Processing
Solutions have been proposed in order to make certain tools more efficient. For example the simple moving average is a common tool that is the basis of many other indicators, its calculation involve summing the length last data points and diving this sum by length . In signal processing, such tool require what is called "memory", the data points must be stored in order for them to be processed, this is extremely inefficient and slow, therefore alternatives have been proposed, one of them is still mainly used in technical analysis today and is called the exponential moving average (ema), the process of computing an exponential moving average is called exponential averaging, and has the form of :
ema = sc*input+(1-sc)*(past ema value)
where sc is called the smoothing constant where 1 > sc > 0 . We only need 2 data values in order to perform this computation, lets denote a moving average of period length sma(input,length) , we can estimate it using exponential averaging with sc = 2/(length+1) . The computation time of the exponential moving average is way lower than the one of the sma . This is the most elegant and efficient estimation of the simple moving average.
The exponential moving average is the simplest "IIR Filter", or infinite response filter, those filters are as well extremely efficient since they use recursion. Exponential averaging is also the core of many adaptive indicators. In my experience, recursion will always let you create extremely efficient tools.
Window Length And Optimization Problems
Optimization is a branch of mathematics that help us find the best parameters in order to maximize/minimize a certain function, and thanks to computers this process can be made faster. Optimizing technical indicators during backtesting involve finding the input window length (set of inputs if there are more than 1 input) that maximize the profit of a strategy.
The most common approach is brute forcing, in which we test every indicator inputs window length combination and keep the one that yield the best results. However optimization is still computationally intensive, having 2 indicators already involve a high number of combinations. This is why it is important to select a low number of indicators for your strategy. But then other problems arise, the best input window length (set of inputs) might change in the future. This is due to the fact the market price is non-stationary and one of the reasons technical indicators are looked down.
In order to deal with this problem, we can propose the following solutions :
Use indicators/Information with no input window length -> Vwap/Volume/True Range/Cumulative Mean...etc.
Study the relationship between the optimal input window length and price evolution -> Regression analysis
Forecast the optimal input window length -> Forecasting
The last two are extremely inefficient, kinda nightmarish, and would be time consuming if one use a serious backtesting procedure. However the first solution is still appealing and might actually provide a efficient result.
Machine Learning Forecasting - Performance And Technical indicators Input Window Length Dependency
Technical indicators outputs can be used as inputs for machine learning algorithms. We could think that we also need to optimize the input window length of the indicators when using machine learning (which would lead to high computations time, machine learning already involve optimization of a high number of parameters), however a research paper named "Forecasting price movements using technical indicators: Investigating the impact of varying input window length" by Yauheniya Shynkevicha, T.M. McGinnitya, Sonya A. Colemana, Ammar Belatrechec and Yuhua Li highlight an interesting phenomenon, the abstract tell us that :
"The highest prediction performance is observed when the input window length is approximately equal to the forecast horizon"
In short, if you want to forecast market price 14 step ahead with a machine learning model, you should use indicators with input window length approximately equal to 14 as inputs for the model in order to get the best performance. This would allow to skip a lot of optimizations processes regarding the technical indicators used in the model. They used 3 different type of ML algorithms, support vector machine (svm) , adversarial neural networks (ann) and k nearest neighboring (knn) , which reinforce their conclusion.
In the paper, we can see something interesting with the indicators they selected as inputs, they used : A simple moving average, an exponential moving average, the average true range, the Average Directional Movement Index, CCI, ROC, RSI, %R, stochastic oscillator.
First thing we can see is that they used the exponential moving average instead of the wilder moving average for certain calculations, which i think is a good choice. We can also see they used many indicators outputting the same kind of information, in this case we often talk about "Multicollinearity", for example :
The CCI, ROC, RSI, %R, Stochastic output similar information, all remove the trend in the price, the CCI and ROC are both centered around 0 and the %R, RSI and stochastic oscillator around 50. The SMA and EMA also output similar information.
In technical analysis this practice is often discouraged since the indicators will output the same kind of information, this lead to redundancy. However such practice has been seen a lot in machine learning models using technical indicators. Maybe that a higher amount of multicollinearity between indicators allow to strengthen the relationship between the forecast horizon and the indicators input window length.
Conclusion
We talked (a lot) about indicator inputs window length, what problems they cause us and how we can find solutions to those problems. Also we have seen that the forecasting performance of ML models can be higher when they use indicators outputs with input window length equal to the forecasting horizon. This can make to make the process of forecasting financial market price with ML models using technical indicators more efficient.
ML is a recurring subject in financial forecasting, those algorithms offer the hope to make technical indicators more useful, and indeed, technical indicators and ML models can benefits from each others, however it is sad to observe that classical indicators are mainly used instead of newer ones, but its also encouraging in the sense that more research can be done, using newer material/procedures.
Thanks for reading !
Forecasting
EURGBP SA L O H A
Hey every one, staying patient to start the week, haven't place a trade for a week now as am waiting for clearer set ups as we are in an overall corrective market IMHO.
There are a few pairs I have on watch but am currently only looking at EURGB S.
Weekly - Been in a bearish trend since the second week of august. Strong bear market.
D - Major impulse down with many corrective patterns down to .84877 but honestly doubt I'll personally be holding it down all the way if we do get a sell indication. Daily in a descending channel with at least two touches in the channel.
4hr/1hr - Both extremely corrective atm. potential for a triple touch on this trend line as price does not have to go all the way up to the outer trend line as Mark likes to say, it can reverse any time, the market is imperfect.
staying vigilantly patient with sell alerts if it breaks down below the ascending trend line.
alert at .89200 just to see where price is
I'm keeping in mind that price can go earlier than expected as well. Comfortable with waiting for a impulse break and enter on the first correction.
Wish you a profitable week in the charts and in life traders!
Mahalo for reading!
OXY Options Outsmarted?OXY could be headed for the little, red boxes. How do I know? It's very simple. So I noticed a pattern of options expiring at resistance or support. The red boxes are options expiration dates. The hypothesis of this experiment is to plot options expiration dates against key support and resistance levels along a predetermined path extrapolated from earlier moves.
BTCUSD: Measuring The Move of the Descending Triangle BreakdownIn 2018 there was an accuracy within 0.25% ($16) of the measured breakdown of the descending triangle . The calculation equaled $3,145 (-48.2%) with the low arriving at $3,129. Based on the 2019 Daily descending triangle , the measured move of -32% takes the price to $6,410, give or take $16. If this Daily triangle is breached to the upside I will calculate the Weekly descending triangle , that has a reduced measured move.
BTC/USD is finishing a bull flag before resuming uptrend!There's something noticeble on the daily chart: it is possible to observe that the probable first Elliot Wave Cycle of the bull trend is concluding in the form of a bull flag. The abcde are the labels of the price movement regarding to the correction. The price will probably visit the $8500 area before resuming the uptrend, wich will show big green bars on the volume.
EUR/JPY 120.794 / 120.929 VS 121.241 / 121.259. Trade SetupHello Traders, EUR/JPY 120.794 / 120.929 VS 121.241 / 121.259.
Expecting A Continuation / Consolidation / Corrective pattern ( Blue )
looking to retest the previous higher low's 120.794 / 120.929
after which we will look for ( Yellow )
The Break of 121.241 / 121.259 VS 122.112 / 122.293.
EUR/NZD 1.65358 / 1.65830 VS 1.69674 / 1.69966.Hello Traders, EUR/NZD 1.65358 / 1.65830 VS 1.69674 / 1.69966.
4H TrendLine Break or Bounce Looking for a possible 5th Wave down ( Yellow )
We need a setup / impulse correction for a move
Towards 1.65358 / 1.65830 VS 1.63863 / 1.62049.
Second possibility a continuation / consolidation / corrective pattern
to continue the upside movement
breaking the 4H Trend towards 1.69674 / 1.69966.
AUD/USD 0.070754 VS 0.69282 / 0.69202.Hello Traders, AUD/USD 0.070754 VS 0.69282 / 0.69202.
We are breaking the 4H Trend looking for Possible Larger Running Flat completion
we would need to see a rejection ( Yellow impulse & correction ) to continue the upside ( Green ) VS 0.71064 / 0.71805.
Second possibility ( Blue ) looking for continuation / consolidation / corrective patterns
to continue the downside movement breaking 0.69202 / 0.69282 VS 0.68530 / 0.68389.
USD/SEK 9.49245 / 9.47372 VS 9.30490. Trade SetupsHello Traders, USD/SEK 9.49245 / 9.47372 VS 9.30490. looking for a small continuation/ consolidation / corrective pattern ( Yellow )
to continue the upside movement breaking 9.49245 / 9.47372 VS 9.53482 / 9.54526.
Or signs of reversal ( Impulse Correction / Blue ) back towards the previous Low's to retest 9.30490 for a bigger corrective pattern.
WTICO/USD West Texas Oil 55.639 / 55.229 VS 60.707 / 60.339.Hello Traders, WTICO/USD West Texas Oil 55.639 / 55.229 VS 60.707 / 60.339.
Expecting another impulse down after finishing the corrective pattern ( Blue ) To Break 55.639 / 55.229 VS 53.072 / 50.935.
Second possibility ( Fuchsia ) we continue up to retest the 60.707 / 60.339. for a bigger corrective structure on the previous impulse up.
EUR/USD Range: 1.11988 / 1.12078 VS 1.12706 / 1.2758Hello Traders, EUR/USD Range: 1.11988 / 1.12078 VS 1.12706 / 1.2758
Looks like we have a complete 3 wave Corrective pattern Looking to break 1.11988 / 1.12078 VS 1.11338 / 1.10583.
Possibly ( Yellow ) one more Move to the upside 1.12706 / 1.2758 before we get the Break.
USD/JPY 108.967 / 108.856 VS 107.821 / 107.706. Trade SetupsHello Traders, USD/JPY 108.967 / 108.856 VS 107.821 / 107.706.
Possible Short Term Buy looking for a Setup / Flag for a move towards 108.286 / 108.240
at which point we will look for the continuation / corrective / consolidation pattern VS 108.967 / 108.856
Or the possibility that it's still a part of the corrective structure for one more down move Retesting / Breaking 107.821 / 107.706.
EUR/USD 1.12758 / 1.2706 VS 1.12078 / 1.11988. Trade SetupsHello Traders, EUR/USD 1.12758 / 1.2706 VS 1.12078 / 1.11988.
Expecting Short Term Upside towards 1.12758 / 1.2706
to complete a 3 wave Consolidation / Continuation / Corrective Pattern for the downside
To Break 1.12078 / 1.11988 VS 1.11333 / 1.11283 / 1.11160.
USD/CHF 0.98418 / 0.98287 VS 0.99468 / 0.99388.Hello Traders, USD/CHF 0.98418 / 0.98287 VS 0.99468 / 0.99388.
Correcting the Impulse Up possible short term buy setup / flag forming Break 0.98528
To retest previous High's ( Blue ) 0.99035 / 0.99022 VS 0.99468 / 0.99388.
Second Possibility ( Fuchsia ) Devoloping A running flat for one more move Breaking 0.98418 / 0.98287
within the current smaller down trend