Since when the external variables do not work?

To add comments, please log in or register
Andres.riosp
50
Andres.riosp  
Hello everyone,

Less than 40 days ago I made an indicator, in mql5 and inside the input parameters I can put external variables (extern int, extern color, etc), but now I can not put it anymore, since they do not appear in the input parameters tab when The indicator is loaded.

the question is:
If they have been removed, how to use these external variables?

To use as a replacement for external variables. (Extern int, extern string, etc?


thanks

Files:
honest_knave
Moderator
2302
honest_knave  

Nothing has changed so there is probably an issue in your code.

Trying posting the section of code where you declare them

Andres.riosp
50
Andres.riosp  
honest_knave:

Nothing has changed so there is probably an issue in your code.

Trying posting the section of code where you declare them


are you sure,?? We are talking about mql5, (just to confirm jejeje)
The new indicators or advisers do not show me, with the old advisors or indicators, is observed correctly, but if I compile those indicators again, they are not seen from that moment

I thought it was because of the compiler update
I have the March 24 version.

Can you check again please

Look at the test images. The simplest of simple


//+------------------------------------------------------------------+
//|                                                      example.mq5 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
extern int abc=123;   
input int def=234;   

//I want to see 2 parameters when attaching the indicator


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
  {
//---
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

Look attached

Files:
222.jpg 40 kb
honest_knave
Moderator
2302
honest_knave  

You know what, I didn't read your post properly. I thought you meant neither extern nor input were working.

I just tried it on build 1570 and you are quite right - no extern.

MQL4 is still happy with them though.

I'm not aware of any published change... but I may have missed it.

One of the other guys more clued up on MQL5 may be able to assist 

Amir Yacoby
1219
Amir Yacoby  

input does work. extern has other meaning, use input:

input int abc=123;  
Marco vd Heijden
Moderator
8163
Marco vd Heijden  

extern is the very old way and obsolete for that purpose so use:

input
static input
sinput
These should all work.
Amir Yacoby
1219
Amir Yacoby  
extern in new version is a shared external variable (declared in different files)
Ex Ovo Omnia
3358
Ex Ovo Omnia  
Amir Yacoby:
extern in new version is a shared external variable (declared in different files)

Interesting, I did not notice that either.

Such tiny syntax changes move the MQL5 more apart from the MQL4 syntax (which is frozen currently). I am starting to doubt whether my attempt to unify my classes for use in both platforms had any sense.

Andres.riosp
50
Andres.riosp  
Ex Ovo Omnia:

Interesante, no me di cuenta de que tampoco.

Tales cambios de sintaxis diminutas mover el MQL5 más aparte de la sintaxis MQL4 (que se congela en la actualidad). Estoy empezando a dudar de que mi intento de unificar mis clases para su uso en ambas plataformas tenía ningún sentido.

You're right, the gap widens.

Thank you all for replying
To add comments, please log in or register