Hi everyone.
I was trying to write an script in metaeditor. i wrote the four basic mathematical operations but when I apply the script on chart, the window for input isn't appeared. Despite I add the code #property script_show_inputs .
What should I do?
Attach your code using the button .
#property script_show_inputs extern int x; extern double y; double SUM, SUB, MUL, DIV; //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { SUM = x+y; SUB = x-y; MUL = x*y; DIV = x/y; Comment(SUM, " ",SUB, " ", MUL, " ", DIV); }Vladimir Karputov #:
Attach your code using the button
one more thing I forgot to mention is that I'm using MetaEditor5 which was downloaded with MT4 and I'm trying to write code with MQL4. Is there any problem with that?
Hi everyone.
I was trying to write an script in metaeditor. i wrote the four basic mathematical operations but when I apply the script on chart, the window for input isn't appeared. Despite I add the code #property script_show_inputs.
What should I do?
The input window does appear.
Get out of the habit of using extern unless you have a particular reason to use it. Use input instead.
It is a good idea to give your inputs a default value.
input double y;
is likely to default to zero and so
DIV = x/y;
will give you a zero divide error.
input double y=1;
will not.
The input window does appear.
Get out of the habit of using extern unless you have a particular reason to use it. Use input instead.
It is a good idea to give your inputs a default value.
is likely to default to zero and so
will give you a zero divide error.
will not.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone.
I was trying to write an script in metaeditor. i wrote the four basic mathematical operations but when I apply the script on chart, the window for input isn't appeared. Despite I add the code #property script_show_inputs.
What should I do?