Quote:
Originally Posted by mystified
I have added levels to HMA:
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Black
#property indicator_color2 Red
#property indicator_width1 2
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_level1 80
#property indicator_level2 60
#property indicator_level3 40
#property indicator_level4 20
#property indicator_levelcolor DarkSlateGray
But the indicator doesnt appear on a seperate window properly.Any help much appreciated.
|
Because the indicator is forced bounded:
Remove this two lines:
#property indicator_minimum 0
#property indicator_maximum 100
Levels only works fine on bounded indicators but to do a bounded indicator the calculation must include the limits.
Example: RSI = 100-(100/(1+U/D))
We know by that formula that the indicator will move between 0-100 and because that we could include 70-30 levels without fear to they would disappear.
Another example is MACD = EMA(CLOSE, 12)-EMA(CLOSE, 26)).
We set a level on M5 and when we move to H1 most probable is the level has gone.
So, we take the same formula and we make some changes MACD = (EMA(CLOSE, 12)-EMA(CLOSE, 26))/EMA(CLOSE, 26). And now we have a percent indicator. Is not bounded but we have less probabilities to lost our levels.