Download MetaTrader 5

Close prices array unavailable to compiler

To add comments, please log in or register
strontiumDog
292
strontiumDog  

https://www.mql5.com/en/docs/standardlibrary/expertclasses/expertbaseclasses/cexpertbase/cexpertbaseclose

Suggests to me that there is a function called Close which returns the double of the price of the candle specified as an integer argument.

Great. And from the crumb, I see

MQL5 ReferenceStandard LibraryTrading Strategy ClassesBase classes for Expert AdvisorsCExpertBaseClose

It's part of the Standard lib.  So why is my compiler not finding it, or any other function under CExpert? 

I specify

#include <Expert\CExpertBase.mqh>

at the top of my EA, but compiler can't find the header find, and nor can I.


Anyone know?

Documentation on MQL5: Standard Library / Trading Strategy Classes / Base classes for Expert Advisors / CExpertBase / Close
Documentation on MQL5: Standard Library / Trading Strategy Classes / Base classes for Expert Advisors / CExpertBase / Close
  • www.mql5.com
Standard Library / Trading Strategy Classes / Base classes for Expert Advisors / CExpertBase / Close - Documentation on MQL5
strontiumDog
292
strontiumDog  
strontiumDog:

https://www.mql5.com/en/docs/standardlibrary/expertclasses/expertbaseclasses/cexpertbase/cexpertbaseclose

Suggests to me that there is a function called Close which returns the double of the price of the candle specified as an integer argument.

Great. And from the crumb, I see

MQL5 ReferenceStandard LibraryTrading Strategy ClassesBase classes for Expert AdvisorsCExpertBaseClose

It's part of the Standard lib.  So why is my compiler not finding it, or any other function under CExpert? 

I specify

#include <Expert\CExpertBase.mqh>

at the top of my EA, but compiler can't find the header find, and nor can I.


Anyone know?

Looks like I have to not specify the C.

#include <Expert\ExpertBase.mqh>

works.

But then it gives me a massive number 1.7...e+308.  I'll use CopyClose instead.

Alain Verleyen
Moderator
33350
Alain Verleyen  
strontiumDog:

Looks like I have to not specify the C.

Right, there is a typo in the documentation.


#include <Expert\ExpertBase.mqh>

works.

But then it gives me a massive number 1.7...e+308.  I'll use CopyClose instead.

Yes it's better if you use the class only for these function.
strontiumDog
292
strontiumDog  
angevoyageur:
Right, there is a typo in the documentation.


Yes it's better if you use the class only for these function.
cheers; it's always good to know it's not me..
To add comments, please log in or register