Perhaps you should read the manual.
Array Functions / ArrayResize - Reference on algorithmic/automated trading language for MetaTrader 5
Array Functions / ArrayResize - Reference on algorithmic/automated trading language for MetaTrader 5
I am writing the code in MT4 and this function is the same as MT5, I use the function in the manual and it is still giving me error!
extern int bars=200;
double my_array[];
ArrayResize(my_array,1,bars );
The error is undeclared identifier bars, however it is already defined as int external variable.
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
- www.mql5.com
//| Expert initialization function | //| Expert deinitialization function | //| Expert tick function | //| test1 |...
zabanmail.info: The error is undeclared identifier
bars,
-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - Post all relevant code; there is no context. You can't have ArrayResize outside of a function.
- Do you understand that your code only makes the array a size of one?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi I would like to create an array with size of an extern variable. The below is code which generates error. Thanks for your time.
extern int bars=200;