Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 677

 
Вадим Мотеюнас:
Hello, do you know if mql4 will be supported in the future, when it seems that mt4 is no longer available?
It has never been sold, it has always been free.
 
Alexey Viktorov:
That was never the case, it has always been free.

do brokers use mt for free at the metaquotes?

 

Dear friends, help me out here. I have tried to write my own indicator based on ZigZag, or to be more precise, to output its averages. I've got awrong drawing and in the comment the average is not standing still and grows withevery tick, while the array is clearly shown. Please advise me the correct code. I'm attaching mine:


that's how he draws


Here's the code:


//+------------------------------------------------------------------+
//|                                                           01.mq4 |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window

#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 1

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

extern int ExtDepth=12;
extern int ExtDeviation=5;
extern int ExtBackstep=3;
extern int nn=30;

int shift, ww=0;
double zz, SredRazmax=0.0; 
double HZZ[];


int OnInit()
  {
//--- indicator buffers mapping
    SetIndexBuffer(0,HZZ);
  SetIndexStyle(0,DRAW_SECTION);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| 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[])
  {
//---
  for(shift = 0; shift <= Bars-1; shift++){
      zz = iCustom(NULL, 0, "ZigZag", ExtDepth, ExtDeviation, ExtBackstep, 0, shift);
           if(zz > 0.0)   {
           HZZ[ww]=zz;
            ww++;          }
           else {
           continue;
           }
    }
//---------------------------------------------+
//расчет среднего значения           
//---------------------------------------------+      
  for(ww=0;ww<=nn;ww++){
       if(HZZ[ww]>HZZ[ww+1]){
          SredRazmax += (HZZ[ww]- HZZ[ww+1]);      
         }     
        else if(HZZ[ww]<HZZ[ww+1]){
         SredRazmax += (HZZ[ww]- HZZ[ww+1])*(-1);
        }
        else{
        continue;
           }
     }  
        
  if(SredRazmax>0){    
   
      Comment("Средний размах = ", SredRazmax/nn,",",HZZ[0],",",HZZ[1],",",HZZ[2],",",HZZ[3],",",HZZ[4]);      
        }
   
       
//--- return value of prev_calculated for next call
 return(0);

  
 
  }
//+------------------------------------------------------------------+
Files:
 
Вадим Мотеюнас:

do brokers use mt at metaquotes for free?

Where is the mention of brokers?

Forum on trading, automated trading systems & strategy testing

Any questions for newbies on MQL4, help and discussion on algorithms and codes

Vadim Motiejunas, 2018.10.23 17:10

hello, is there any info on whether mql4 will be supported in the future, if it seems like mt4 sales have stopped?

 
Alexey Viktorov:
Where is the mention of brokers?

Read between the lines, even if it is just one line ))

 
Sergey Basov:

Read between the lines, even if it's just one line ))

I have to practice... I'll try to start training tomorrow.

 
Вадим Мотеюнас:
Hello, is there any info on whether mql4 will be supported in the future if mt4 is no longer supported?

MT4 development is stopped, MQL4 support is very limited (or stopped too), that's all the info from the forum.

It's time for MT5.

 
Sergey Basov:

MT4 development stopped, MQL4 support very limited (or stopped too), that's all the info from the forum.

Time for MT5.

Updated to 1127 yesterday - about support. About development - not anymore.

 
Sergey Basov:

The development of MT4 is stopped, support for MQL4 is very limited (or also stopped), that's all the info from the forum.

I am thinking of going deeper into mql4 or am I just wasting my time?

I have some skills with mql4 , i think i will go deeper, but i don't know if it will be a waste of time?

 
Вадим Мотеюнас:

I have some skills in mql4, I'm thinking of going deeper, but will it be a waste of time?

My opinion: If I have "some", there will not be much "loss" in switching to mql5. The languages are pretty much the same with only minor differences/wording. The difference is in the trading API and functions to work with it.

So, start writing in mql5 and with its study the knowledge on mql4 will be increased.

Reason: