Ι found one error in this code but Ι dont what? Can you help me find it!

 

Hello, I found here one error in data but i dont what?
Can you help me find it and work for create file .ex5

Thank you

Files:
Vertex.mq5  11 kb
 
Ahmed Ahmed Elnagdy:

Hello, I found here one error in data but i dont what?
Can you help me find it and work for create file .ex5

Thank you

This will get it to compile:

double FindExtremum(double &data[], int count, int index) {

You also have a warning that can be fixed this way:

void OnDeinit(const int reason) {

I haven't tested the run-time of your code.

 
Anthony Garot:

This will get it to compile:

You also have a warning that can be fixed this way:

I haven't tested the run-time of your code

thank you for your important 
but are you test it if its work in mt5 or not 
when i try test it i dont found any thing in chart 

no line red or blue or any from options i put it in chart , why ?

thank you

i upload mq5 after solution it 
and upload mq4 until show what or how work 

Files:
Vertex.mq5  22 kb
Vertex.ex5  29 kb
Vertex.mq4  3 kb
 
Ahmed Ahmed Elnagdy :

thank you for your important 
but are you test it if its work in mt5 or not 
when i try test it i dont found any thing in chart 

no line red or blue or any from options i put it in chart , why ?

thank you

i upload mq5 after solution it 
and upload mq4 until show what or how work 

You have a gross error: you are trying to create an iMA indicator at each tick.

In MQL5, an indicator handle is created ONE time (usually in OnInit), then data from the indicator is received using CopyBuffer.

Urgently redo.

 
Ahmed Ahmed Elnagdy :

thank you for your important 
but are you test it if its work in mt5 or not 
when i try test it i dont found any thing in chart 

no line red or blue or any from options i put it in chart , why ?

thank you

i upload mq5 after solution it 
and upload mq4 until show what or how work 

Second: why mock standard variables and add “_" before the name in OnCalculate function?

Here is the standard and no need to try to break it:

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
 

Third: use the library for smoothing

#include <MovingAverages.mqh>

(example in code RSI Custom Smoothing 3)

RSI Custom Smoothing 3
RSI Custom Smoothing 3
  • www.mql5.com
Smoothing type - тип сглаживания (выбирается из перечисления ENUM_MA_METHOD) Smoothing Period - период усреднения для сглаживания Если сглаживание задано (параметр "Use Smoothing" поставлен в "true") - то тип сглаживания и период отображаются в окне индикатора названия уровней теперь более понятные - Value Level Down и Value Level   Up ...
Reason: