Now, if i change small piece of code -as follows- i get strange behavior form indicator. It plots some vertical lines in my chart filling form top to down of monitor.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi all. I 'm going to try DRAW_COLOR_CANDLES in my indicator. I've written following which works correctly in coloring Engulf candles:
Now, if i change small piece of code -as follows- i get strange behavior form indicator. It plots some vertical lines in my chart filling form top to down of monitor.
double open_pre = open[i-1]; bool StrongEngulf_Up = close[i]>open[i] && close[i-1]<=open_pre; bool StrongEngulf_Down = close[i]<open[i] && close[i-1]>=open_pre;In fact, thr code is more sophisticated. I've simplified it to show the exact problem.
Q1: Why this occurs?
Q1: Why should i use index "i-1" to refer to previous candle?
Thanks in advance for your help