improper enumerator cannot be used

To add comments, please log in or register
GrumpyDuckMan
839
GrumpyDuckMan  

Hello everyone,

I'm not really understanding this error message atm.

      string LOW=DoubleToStr(MarketInfo(symbol,MODE_LOW),digits);
      string HIGH=DoubleToStr(MarketInfo(symbol,MODE_HIGH),digits);
      string OPEN=DoubleToStr(MarketInfo(symbol,MODE_OPEN),digits);  // 'MODE_OPEN' - improper enumerator cannot be used        
      string CLOSE=DoubleToStr(MarketInfo(symbol,MODE_CLOSE),digits);// 'MODE_CLOSE' - improper enumerator cannot be used

I would like to ask, how do I resolve the error?

I'm not sure of the difference between this working and the above not working.

      string LOW=DoubleToStr(MarketInfo(symbol,MODE_LOW),digits);
      string HIGH=DoubleToStr(MarketInfo(symbol,MODE_HIGH),digits);
Keith Watford
Moderator
15716
Keith Watford  
GrumpyDuckMan:

Hello everyone,

I'm not really understanding this error message atm.

I would like to ask, how do I resolve the error?

I'm not sure of the difference between this working and the above not working.

Read the documentation. 

ID

Value

Description

MODE_LOW

1

Low day price

MODE_HIGH

2

High day price

Nothing about getting the High and Low.

Marco vd Heijden
Moderator
8804
Marco vd Heijden  

Please use 

iOpen(
iHigh(
iLow(
iClose(
GrumpyDuckMan
839
GrumpyDuckMan  

Hello friend,

so why "improper enumerator cannot be used" ?

The error makes no sense to me. I have read the documents.. the error isn't illustrated within mql4 documents.

Anthony Garot
2418
Anthony Garot  
GrumpyDuckMan:

Hello friend,

so why "improper enumerator cannot be used" ?

The error makes no sense to me. I have read the documents.. the error isn't illustrated within mql4 documents.

MODE_OPEN and MODE_CLOSE are not listed here

https://book.mql4.com/appendix/marketinfo

Marco vd Heijden
Moderator
8804
Marco vd Heijden  

You haven't read the documents because those enumerations do not belong to the call MarketInfo()

If you had read the documentation you would know this:

Series Array Identifiers

Series array identifier used with ArrayCopySeries()iHighest() and iLowest() functions. It can be any of the following values:

ID

Value

Description

MODE_OPEN

0

Open price

MODE_LOW

1

Low price

MODE_HIGH

2

High price

MODE_CLOSE

3

Close price

MODE_VOLUME

4

Volume, used in iLowest() and iHighest() functions

MODE_TIME

5

Bar open time, used in ArrayCopySeries() function

 

ArrayCopySeries - Array Functions - MQL4 Reference
ArrayCopySeries - Array Functions - MQL4 Reference
  • docs.mql4.com
If data are copied from another chart with different symbol and/or timeframe, it is possible that the necessary data will lack. In this case, error ERR_HISTORY_WILL_UPDATED (4066 - requested history data under updating) will be placed into the last_error variable, and there will be necessary to retry copying...
To add comments, please log in or register