How to use function in EA which inherit from a Class. Get wrong parameter count.Please help
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
- www.mql5.com
| 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; |
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.