What is different between extern and input

 

I can declare indicator parameter with any of two word = 'extern' or 'input'.

My question what is different between two word.  

extern mType      PendingOrderType         = 0; 
input  mType      PendingOrderType         = 0; 
 
 
Unlike input variables, values of extern variables can be modified in the program during its operation. External variables are always reinitialized immediately before the OnInit() is called.
 
qjol:

Extern variables

PCRider:
Unlike input variables, values of extern variables can be modified in the program during its operation. External variables are always reinitialized immediately before the OnInit() is called.


hi

when i use extern in my code then run it

the input windows dont show so i cant  modified  variables . but when use input and run my code input windows show me 

where is my mistake???

#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

extern int a;    
input int b;
int OnInit()
  {
//---
   a=a+5;
   Comment(a)
//---
   return(INIT_SUCCEEDED);
  }
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • 2021.02.02
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
 
Nikolas Toni:


hi

when i use extern in my code then run it

the input windows dont show so i cant  modified  variables . but when use input and run my code input windows show me 

where is my mistake???

Please edit your post and use the code button (Alt+S) when pasting code.

EDIT your original post, please do not just post the code correctly in a new post.


This is the MQL4 section.

Are you getting MQL4 confused with MQL5?

In MQL4 externs will show in the input window, in MQL5 they will not.

Look up extern in the documentation relating to whichever language you are using.