Indıcator buffer variables does not seem

 

hello, I have a problem when converting from mql4 to mql5. I would be glad if anyone can help. I can't find where I went wrong.


I have defined as follows:

#property indicator_buffers 15 

double buf_Open[];

int OnInit() {

        
   IndicatorSetString(INDICATOR_SHORTNAME,"usdind");

   SetIndexBuffer(8, buf_Open);
   SetIndexStyleMQL4(8, DRAW_NONE);
]

for the SetIndexStyle function (mql4), i used to convert it by using this article : https://www.mql5.com/en/articles/81


and in the OnCalculate function, all array values are available :

buf_Open[ind] = somefunc(ind, open[ind]); //I checked here and the data is coming as follows: 55.5454, 60.4343


however in the indicator window, the values next to the label show 0 (metatrader 5)

In similarly written mql4 codes, the data appears here: 

Thank you very much in advance.

Migrating from MQL4 to MQL5
Migrating from MQL4 to MQL5
  • www.mql5.com
This article is a quick guide to MQL4 language functions, it will help you to migrate your programs from MQL4 to MQL5. For each MQL4 function (except trading functions) the description and MQL5 implementation are presented, it allows you to reduce the conversion time significantly. For convenience, the MQL4 functions are divided into groups, similar to MQL4 Reference.
 
#property indicator_buffers 2

   SetIndexBuffer(8, buf_Open);

You declare you have two buffers. Yet, you try to set the ninth.

You don't declare any plots.

 
William Roeder:

You declare you have two buffers. Yet, you try to set the ninth.

You don't declare any plots.

yes, actually there are others but I took one as an example. Actual value is 15 for indicator_buffers i edited again now. And also i declare :

#property indicator_plots 15