DownloadDidi_Index Current Candle Drawing?

1
Hi, I have the Didi_Index.mq4 indicator. It does something I've never seen any other indicator do. It does not draw on the CURRENT candle. All other indicators would display data values for their buffers on CURRENT candles, except for the Didi_Index.mq4. I tried looking in the code and looking through the MQL4 documentation to see what it could be, I can't seem to figure it out. Does anyone know why this indicator behaves this way?


Re: Didi_Index Current Candle Drawing?

2
Reynaldocruz011 wrote: Mon Oct 24, 2022 5:20 am Hi, I have the Didi_Index.mq4 indicator. It does something I've never seen any other indicator do. It does not draw on the CURRENT candle. All other indicators would display data values for their buffers on CURRENT candles, except for the Didi_Index.mq4. I tried looking in the code and looking through the MQL4 documentation to see what it could be, I can't seem to figure it out. Does anyone know why this indicator behaves this way?
locate this line : for(int i = 1; i < Bars; i++)
change it as : a) for(int i = 0; i < Bars; i++)
or / and as : b) for(int i = Bars; i >=[1 or 0]; i--)

0 is the index of the current bar
1 is past one (second on the chart)
2 is past two (third on the chart)
and so on
The default indexing of all arrays and indicator buffers is left to right. The index of the first element is always equal to zero. Thus, the very first element of an array or indicator buffer with index 0 is by default on the extreme left position, while the last element is on the extreme right position.
ref for reading : https://docs.mql4.com/series/bufferdirection / https://book.mql4.com/variables/arrays

happy reading
regards
These users thanked the author Xronos__ for the post (total 2):
Reynaldocruz011, Jimmy


Who is online

Users browsing this forum: Applebot [Crawler], BeatlemaniaSA, behar, Bing [Bot], WhatsApp [Bot] and 89 guests