Bollinger Band testing

 

I am just starting in MLQ4 I want to know if someone can tell me how to test to see if the price bar has crossed the upper or lower Bollinger bands, and how to test to see if the close is above or below the bands.

Thank You

wmwhit

 
wmwhit:

I am just starting in MLQ4 I want to know if someone can tell me how to test to see if the price bar has crossed the upper or lower Bollinger bands, and how to test to see if the close is above or below the bands.

Thank You

wmwhit


if Bid>iBands(mode_upper) =>price has broken upper band

if Bid<iBands (mode_lower)=>price has broken lower band


For your second question, Bid for the last bar is equal to close.


Dam.

 
damtoul wrote >>

if Bid>iBands(mode_upper) =>price has broken upper band

if Bid<iBands (mode_lower)=>price has broken lower band

For your second question, Bid for the last bar is equal to close.

Dam.

Thanks I will give it a try and see if I can get it to do what I want.

 
wmwhit wrote >>

Thanks I will give it a try and see if I can get it to do what I want.

thanks for the start, but when I run the program it flags the price when it above the medium line and not the upper Bollinger Band and same the the lower test, when it goes below the medium or mddile line it flags as below. I can take this code and make it check for the upper above the middle or medimu band

Reason: