MQL4 - automated forex trading   /  

Forum

Normalizing: from moving average to oscillator

Back to topics list To post a new topic, please log in or register

avatar
101
MrH 2007.09.21 17:54 

Let's say you have a moving average on a chart, and you want to get that into a seperate window at the bottom of the screen, you would think that by just changing #property indicator_chart_window into #property indicator_separate_window and done is done. But the problem here is that the price oscillations will make your moving average -which is now in a seperate window- change the minimum and maximum of the window. Now you probably think, this is easy, just change the minimum and maximum of the window and you're done, but the problem here it's practically not doable because you don't know the maximum of the price action. Hence, you have to normalize: you have to change the value the moving average has calculated into a value between 0 and 100 to make your moving average a true oscillator (like rsi, macd, stochs, ...).

Now my question is: does anyone know how to do this?

there are multiple applications for this problem and sharing this solution could help your fellow trader (me :-) without giving up your competitive edge I think.

cheers.

article

Price Forecasting Using Neural Networks

Many traders speak about neural networks, but what they are and what they really can is known to few people. This article sheds some light on the world of artificial intelligence. It describes, how to prepare correctly the data for the network. Here you will also find an example of forecasting using means of the program Matlab.


avatar
2462
phy 2007.09.21 18:31 

Uh... how about like rsi, and stochastic (macd has no limits).

Search out how those are calculated and you might find your answer.


avatar
101
MrH 2007.09.22 16:37 
won't work because the true oscillators work in a different way than a normalized moving average.

avatar
101
MrH 2007.09.22 19:14 
well maybe this could work: divide the change of price by the maximum range of prices for the day

avatar
2462
phy 2007.09.22 19:20 

Oscillators display the current value as a "percent" of a prior range, so depending on what you want to see, that can work.

Back to topics list  

To add comments, please log in or register