It clearly says that on line 553 it's possible to use a variable that has no value. Try to write bool pr=false; This will fool the compiler but you'd better check it properly. After all, if the order type is a pending order, you will still have pr without a value...
The question was addressed in the article about mql4 language, so I immediately noticed Time[0].
After a closer look, it becomes clear that it is a user-defined array.
And here is a comment from the documentation:
Note
The function uses synchronous calling - it means that the function waits for execution of all commands that were placed in the chart queue before it was called, so this function might be time-consuming. You should keep this in mind if you work with a large number of objects on the chart.
Since an object in one price coordinate can have several values, it is necessary to specify the line number. This function can be applied only to the following objects:
Trend line (OBJ_TREND)
Trend line by angle (OBJ_TRENDBYANGLE)
Gann Line (OBJ_GANNLINE)
Equidistant channel (OBJ_CHANNEL) - 2 lines
Linear regression channel (OBJ_REGRESSION) - 3 lines
Standard deviation channel (OBJ_STDDEVCHANNEL) - 3 lines
It clearly says that in line 553 it is possible to use a variable which has no value. Try to write bool pr=false; This will fool the compiler, but it's better to check everything properly. After all, if the order type is a pending order, you will still have pr without value...
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
wrote this code.
the meta-editor mumbles.
Why does it mate?
#property strict
Is your pr initialized?
wrote this code.
the meta-editor mumbles.
Why does it mate?
#property strict
It clearly says that on line 553 it's possible to use a variable that has no value. Try to write bool pr=false; This will fool the compiler but you'd better check it properly. After all, if the order type is a pending order, you will still have pr without a value...
on the previous one, and what's here from mql4? the OnTick() function?
The question was addressed in the article about mql4 language, so I immediately noticed Time[0].
After a closer look, it becomes clear that it is a user-defined array.
And here is a comment from the documentation:
Note
The function uses synchronous calling - it means that the function waits for execution of all commands that were placed in the chart queue before it was called, so this function might be time-consuming. You should keep this in mind if you work with a large number of objects on the chart.
Since an object in one price coordinate can have several values, it is necessary to specify the line number. This function can be applied only to the following objects:
Is your pr initialised?
I thought it was initialized by zero when declared.
It clearly says that in line 553 it is possible to use a variable which has no value. Try to write bool pr=false; This will fool the compiler, but it's better to check everything properly. After all, if the order type is a pending order, you will still have pr without value...
thanks for reminding me about the pending orders)
Is this the right way to do it?
thanks for reminding me about the pending orders)
is this the right way to do it?
if (pr==false) is equivalent to if (!pr)
if (pr==true) is equivalent to if (pr)
I use Alert instead of Print - it should appear right away without opening the journal. And there is no extra information
if (pr==false) is equivalent to if (!pr)
if (pr==true) is equivalent to if (pr)
I use Alert instead of Print - it shows up instantly on the screen without opening the journal. And there is no extra information
We get OrderClosePrice() after the transaction is closed.
Is it possible to write OrderClosePrice() like this?
We receive OrderClosePrice() after the trade is closed.
You can. But be careful. For an open position, it returns the closing price. Correspondingly: for Buy - Bid, for Sell - Ask