MODE_CLOSE is currently part of an existing enumeration and is a reserved word in MQL — Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Chart Timeframes
You can not reuse or redefine it. So use a new name for your enumeration elements.
//+----------------------------------------------+ //| declaration of enumerations | //+----------------------------------------------+ enum PRICEMODE { PRICEMODE_CLOSE, // Close PRICEMODE_HIGHLOW // High/Low }; input PRICEMODE f=MODE_CLOSE; //price field ... if(f==PRICEMODE_CLOSE) { xu[bar]=close[bar]; xd[bar]=close[bar]; } ...

- www.mql5.com
The problem is that MODE_CLOSE exists: https://www.mql5.com/en/docs/constants/chartconstants/enum_timeframes
Just rename it.
As you are not new to programming here you can search: https://www.mql5.com/en/search#!module=mql5_module_documentation
and here is a list of all functions with short explanation for a kind of keyword search: https://www.mql5.com/en/docs/function_indices

- www.mql5.com
MODE_CLOSE is currently part of an existing enumeration and is a reserved word in MQL — Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Chart Timeframes
You can not reuse or redefine it. So use a new name for your enumeration elements.
The problem is that MODE_CLOSE exists: https://www.mql5.com/en/docs/constants/chartconstants/enum_timeframes
Just rename it.
As you are not new to programming here you can search: https://www.mql5.com/en/search#!module=mql5_module_documentation
and here is a list of all functions with short explanation for a kind of keyword search: https://www.mql5.com/en/docs/function_indices
Hi Carl, thanks for the replay. You are right, I should have searched MQL's references before, but I tough it was about the time to make some friends over here.
Also I said that I'm not new to programming because a lot of traders ask programming question too and sometimes they started to code because of trading, so it may be frustrating explain some simple concepts to those with very little experience.
Have a good weekend.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello forum,
I'm totally new to MQL, but no to programming.
I downloaded an Indicator (divergence.mq5) from the codebase and I get two errors on an input variable initialized with an enum value.
The code:
The errors have the same message
ambiguous access, can be one of:
0. enumeration value 'MODE_CLOSE' 0 0
1. enumeration value 'MODE_CLOSE' divergence.mq5 44 4
Any help will be greatly appreciated.
Thank you.