Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
Bollinger bands in a seperate window with steady size
Let's say you have a moving average (or a bollinger band, which is a moving average + and - 2 standard deviations) 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,...). Because if you look at the picture, you see that by scrolling the chart more to the right, the shape of the bands changes. I want to prevent this by normalizing it (give it a value between 0 & 100).
Now my question is: Does anyone know how to divide the change of price by the maximum range of prices for the day? Or a way to prevent the bollinger from changing shape? I've attached the code.
thanks a lot for the answers guys, but I think I have expressed myself in the wrong way, let me restate the problem:
let's say you have a 20 period moving average in your chart window, and you want to convert this into an oscillator in your seperate window: you want divide the change of price by the maximum range of n periods (20), which essentially gives you an oscillator. Any idea how to do this?