Hello there.
I've been trying to create an indicator (for learning purposes) that tracks the maximum and the minimum value of the last N samples in the current period.
I want to use the indicator from a class inheriting from CExpertSignal.
I noticed that most articles talk about creating custom indicators, but they are not really "custom", they are based on a existing one.
So, if I want to get the maximum and the minimum from the last N samples, I have been considering:
1) Using CopyHigh, CopyLow from the CExpertSignal and then compute the maximum and the minimum, with no indicator.
2) Find a way to create a "real" custom indicator and compute the max and the min there, and then use the indicator in the CExpertSignal.
What should I try?
I found this code : https://github.com/dennislwm/MLEA/blob/master/MQL5/Include/EA/TurtleSignal.mqh
This is the data I need. Is this the right way to do it? My guess is that it is better to find a way that avoids the multiple copies.
double CTurtleSignal::Highest(int spannedPeriod) { double ret = 0; int copied = CopyHigh(m_symbol.Name(), m_period, 1, spannedPeriod, High); for (int i=0; i<spannedPeriod; i++) ret = MathMax(ret, High[i]); return ret; }

I found this code : https://github.com/dennislwm/MLEA/blob/master/MQL5/Include/EA/TurtleSignal.mqh
This is the data I need. Is this the right way to do it? My guess is that it is better to find a way that avoids the multiple copies.
}

- 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 there.
I've been trying to create an indicator (for learning purposes) that tracks the maximum and the minimum value of the last N samples in the current period.
I want to use the indicator from a class inheriting from CExpertSignal.
I noticed that most articles talk about creating custom indicators, but they are not really "custom", they are based on a existing one.
So, if I want to get the maximum and the minimum from the last N samples, I have been considering:
1) Using CopyHigh, CopyLow from the CExpertSignal and then compute the maximum and the minimum, with no indicator.
2) Find a way to create a "real" custom indicator and compute the max and the min there, and then use the indicator in the CExpertSignal.
What should I try?