Learn to deal with classes, study the examples:
https://www.mql5.com/en/docs/basis/types/classes
https://www.mql5.com/en/articles/351: The Basics of Object-Oriented Programming
There is a lot more that all most probably will answer your question, just search here (top right the lens) for classes and select: Documentation, Articles, CodeBase, Forum, ..: https://www.mql5.com/en/search#!keyword=Classes
Documentation on MQL5: Language Basics / Data Types / Structures, Classes and Interfaces
- www.mql5.com
Structures, Classes and Interfaces - Data Types - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
To initialize your class requires five parameters | CIndicatorMA(string symbol, int timeframe, int period, ENUM_MA_METHOD method, int appliedPrice); |
You are trying to create five class instances with no parameters. | CIndicatorMA MAAnchorFast; CIndicatorMA MAAnchorSlow; CIndicatorMA MAMainFast; CIndicatorMA MAMainMid; CIndicatorMA MAMainSlow; |
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
Hello, I need some help in finding my error in use inheritance from class CIndicatorMA.
I have a Class CIndicator MA set up like this (it uses a Base class CIndicatorBase which deals with the buffers en index of indicators - not relevant for this question)..
Then I using the class CIndicator within an EA using the following code:
However when I compile I get the following error messages:
1. 'CIndicatorMA' - wrong parameter count
2. 'Init' - function not defined
The variables used in de different MA's are off course set up in the beginning of the EA.
What do I miss? Any help or hint would be very much appreciated.