Forum

BandWidth - Bollinger Envelope: no error when compiling, yet cannot divide by buffer (no line drawn on indicator window).

I am trying to recreate the BandWidth indicator for the Bollinger Envelope (not BBands, but Envelope). I am still struggling with the not normalized version. See code below. My issue: when trying to draw the line, no line is to be seen. The formula is (UpperBB - lowerBB) / middleBB. I tested around

Prevent EA from getting restarted every time when switched to another time period

Thanks for reading this. My goal is to have the code run in the background unaffected by me changing the time period (M1, M5 etc.). Right now, once the time period is changed, the code gets restarted from the top and my whole "Counter"-logic (see code below) doesn't work. Goal of the EA: check all