I wrote this function which returns two arrays, but i had to define it as a pointer. It's throwing me errors please can anyone help me here
Files:
function_error_074504.PNG
37 kb
Use the button to insert your code. Don't use picture of it please.
MQL5.community - User Memo
- www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.
bool* HighLowVerify(double &uHighs[], double &uLows[], double &Zigzag[], double &CCIReader[]) { bool positiveHighs[], negativeLows[]; // read price and time of each candlestick in the uzigzag array. // compare that value to the CCI reading for (int i = 0; i < ArraySize(Zigzag); i++) { if (CCIReader[i] >= 1) { ArrayCopy(positiveHighs, Zigzag, 0, 0); Print("The value of this is positive", positiveHighs[i]); } else if (CCIReader[i] <= -1) { ArrayCopy(negativeLows, Zigzag, 0, 0); Print("The value of this is negative", negativeLows[i]); } } return (positiveHighs,negativeLows); }Sorry about that here's the code
Quantum Dev #: Sorry about that here's the code
- Do not post code that will not compile. Your function definition says you are returing a pointer to a bool. MTx does not have pointers. It only has handles to a class.
- Do not post code that will not compile. You are attempting to return two values. You can only return one.
William Roeder #:
Thank you. I'll do the logistic another way
- Do not post code that will not compile. Your function definition says you are returing a pointer to a bool. MTx does not have pointers. It only has handles to a class.
- Do not post code that will not compile. You are attempting to return two values. You can only return 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