what is "uninit reason 0"?

 

i tried to open an order using script but got this error "uninit reason 0".

what is it?

how to fix it?

please help.

 

What a useless comment.

The documentation is useless solving this question. 

 
qkum:

What a useless comment.

The documentation is useless solving this question. 

Did you try clicking on the link on the webpage?

uninitialization reason

Uninitialization Reason Codes - Named Constants - Constants, Enumerations and Structures - MQL4 Reference
Uninitialization Reason Codes - Named Constants - Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
Uninitialization Reason Codes - Named Constants - Constants, Enumerations and Structures - MQL4 Reference
 
qkum: What a useless comment. The documentation is useless solving this question. 

The link provided absolutely answers the question.

 
William Roeder #:

The link provided absolutely answers the question.

It certainly does not.

It says reason code 0 is calling the expertremove function to remove the script.

Thats interesting but wholly unhelpful as to what that is actually doing and why in english.

 

You are reading it backwards. Reason code 0 is not calling anything. The EA, in one of its functions, called the ExpertRemove() function.

Upon return, the terminal has called OnDeinit and will remove the EA upon return. That is English.

 
so how to solve it? you still are not answering
 
myworldbox #:
so how to solve it? you still are not answering

There is nothing to solve.

 
@Keith Watford you are being entirely unhelpful.  I have the same issue, and ExpertRemoval() function is not (explicitly)called.  However, on a little more investigation, although a function had been correctly defined, there were no instructions in the OnStart() component of the script to call that function. So @myworldbox although this is a little late (10 years!) the answer is to check if you have anything in the OnStart function that will call (some of) the rest of the code . 
 
mkhpd #: although a function had been correctly defined, there were no instructions in the OnStart() component of the script to call that function.

Scripts run once and then exit. No ExpertRemove() required. Code is working as written.

If you don't want “run once and exit”, then code an EA, not a script. “There is nothing to solve,” PICNIC.

Reason: