Forum

Testing indicators, does not redraw on each tick

Hi, As far as I know the close price for the current, not yet completed bar is the last price. Therefore the close price is constantly changing with each tick. I can see this happen when simulating indicators of other people. But of course not my indicator. It looks like it immediately jumps to the

Using ArrayResize

Hi, I have the code below. It checks if price broke above a Donchian channel and then retraced for a number of bars . When I hard-code the integer into my dcVals array things work as expected. It only prints exactly when the channel was broken and 5 bars retraced. But when I use a variable, DC_BARS

Calling iMA efficiently

Hi, I have the function below and it works. But then I read this: https://www.mql5.com/en/articles/43 where it says that iCustom is best called in OnInit(). Is this also true for my function? I can imagine that every call to iMA recreates a moving average calculated over many values and then only