Download MetaTrader 5

Working correclty with CExpertBase class.

To add comments, please log in or register
Deposit to your account via WebMoney
Rodolfo Andrade
940
Rodolfo Andrade 2014.04.28 20:09 

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? 

Rogerio Figurelli
Moderator
39643
Rogerio Figurelli 2014.04.29 06:29  
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));
Rodolfo Andrade
940
Rodolfo Andrade 2014.04.29 20:01  
figurelli:

Why not?

It was exactly what I needed, thank you very much.
Rogerio Figurelli
Moderator
39643
Rogerio Figurelli 2014.04.29 23:33  
Rodorush:
It was exactly what I needed, thank you very much.
I supposed it, you are welcome.
To add comments, please log in or register