Working correclty with CExpertBase class.

 

Hello, I can't see what's the problem with the following code:

#include <Expert\ExpertBase.mqh>
#include <Trade\SymbolInfo.mqh>

void OnStart() {
   CExpertBase candle;
   CSymbolInfo *mysymbol = new CSymbolInfo();
   
   if(CheckPointer(mysymbol)==POINTER_INVALID)
             Print(__FUNCTION__," the variable 'mysymbol' isn't initialized!");
   mysymbol.Name(_Symbol);
   candle.Init(mysymbol,_Period,_Point);
   
   Print(DoubleToString(NormalizeDouble(candle.Open(1),_Digits),_Digits));
}

I can't get the correct value of candle open price at index 1.

Could someone help me, please? 

 
Rodorush:

Hello, I can't see what's the problem with the following code:

I can't get the correct value of candle open price at index 1.

Could someone help me, please? 

Why not?

   double Open_buf[];
   CopyOpen(NULL,0,0,2,Open_buf);
   ArraySetAsSeries(Open_buf,true);
   Print(DoubleToString(NormalizeDouble(Open_buf[1],_Digits),_Digits));
 
figurelli:

Why not?

It was exactly what I needed, thank you very much.
 
Rodorush:
It was exactly what I needed, thank you very much.
I supposed it, you are welcome.
Reason: