Good day! I am trying to write a distinction for the selected position - buy or sell. I am writing it this way.
if (PositionGetInteger(POSITION_TYPE)== ??? {
What should I compare it with? I do not see it in the reference. There it really is not written, it is not false and True, some kind of ENUM_POSITION_TYPE, I click on it and the link leads to the same table.
Dimka-novitsek: Good day! I am trying to make a distinction for a position - buy or sell. I am writing it this way. With what should it be compared? I do not see it in the help. There it really is not written, it is not false and True, it is some ENUM_POSITION_TYPE, I click on it and the link leads to the same table.
I'm sorry, could you please write a few lines above and let's say I have an order selected somehow, not a position. Here I use the function PositionGetDouble, what will happen? What will this function report, and will it report anything?
Dimka-novitsek: Excuse me, let's say, a few lines above, I have an order selected, not a position. Here I use the PositionGetDouble function, what will happen? What will the function report, and will it report anything?
It looks like moving the cursor to the right line. If the cursor is already on the correct line (the situation when the PositionSelect(symbol) function was called earlier in the code and returned true), one can use the PositionGetXXX or PositionSetXXX functions immediately; if the cursor is on another line, it needs to be positioned first.
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.
I'm trying to find out the value of one lot with SymbolInfoDouble(Symbol(),SYMBOL_MARGIN_INITIAL),but the result is =0.Can you tell me what's wrong?
https://www.mql5.com/ru/forum/1111/page95#comment_14665
https://www.mql5.com/ru/forum/1111/page95#comment_14665
Good day! I am trying to make a distinction for a position - buy or sell. I am writing it this way. With what should it be compared? I do not see it in the help. There it really is not written, it is not false and True, it is some ENUM_POSITION_TYPE, I click on it and the link leads to the same table.
There is a table at the very bottom of the page
compare with
POSITION_TYPE_BUY for BUY and
POSITION_TYPE_SELL for SELL
Excuse me, let's say, a few lines above, I have an order selected, not a position. Here I use the PositionGetDouble function, what will happen? What will the function report, and will it report anything?
The function will give out something, but there is no guarantee, before using the PositionGetDouble function you should use PositionSelect(symbol)
if it hasn't been called before.
It looks like moving the cursor to the right line. If the cursor is already on the correct line (the situation when the PositionSelect(symbol) function was called earlier in the code and returned true), one can use the PositionGetXXX or PositionSetXXX functions immediately; if the cursor is on another line, it needs to be positioned first.
THANK YOU!!!