'PositionGetInteger' - no one of the overloads can be applied to the function call order.mq5 214 13 In short, not the function, but the call. Or rather what I feed into it.
boolPositionGetInteger(
ENUM_POSITION_PROPERTY_INTEGER property_id, // идентификатор свойстваlong& long_var // сюда примем значение свойства
);
Dimka-novitsek: 'PositionGetInteger' - no one of the overloads can be applied to the function call order.mq5 214 13 In short, it's not the function but the call. Or rather what I feed into it.
You still don't read the documentation. You don't even try to copy it.
What's that got to do with it? Can't find it? It doesn't work?
//--- будем искать позицию по символу графика, на котором работает экспертstring symbol=Symbol();
//--- попробуем получить позициюbool selected=PositionSelect(symbol);
if(selected) // если позиция выбрана
{
long pos_id =PositionGetInteger(POSITION_IDENTIFIER);
double price =PositionGetDouble(POSITION_PRICE_OPEN);
ENUM_POSITION_TYPE type=(ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE);
long pos_magic =PositionGetInteger(POSITION_MAGIC);
string comment =PositionGetString(POSITION_COMMENT);
PrintFormat("Позиция #%d по %s: POSITION_MAGIC=%d, цена=%G, тип=%s, комментарий=%s",
pos_id, symbol, pos_magic, price,EnumToString(type), comment);
}
else// если выбрать позицию не удалось
{
PrintFormat("Не удалось выбрать позицию по символу %s. Ошибка",symbol,GetLastError());
}
}
Надежный торговый робот не может быть создан без понимания механизмов работы торговой системы MetaTrader 5. Клиентский терминал получает от торгового сервера информацию о позициях, ордерах и сделках. Чтобы правильно обработать эти данные средствами MQL5 необходимо хорошо представлять как происходит взаимодействие mql5-программы и среды исполнения терминала.
Dimka-novitsek: 'PositionGetInteger' - no one of the overloads can be applied to the function call order.mq5 214 13 In short, not the function, but the call. Or rather what I feed into it. I have ????????????
I found this to be a natural declaration, but the compiler is swearing. It warns in the following way
'Type' - undeclared identifier orderni.mq5 213 18
'Type' - some operator expected ordernir.mq5 213 18
'POSITION_TYPE' - expression has no effect ordernir.mq5 213 4
I'm not an expert in English, but it's not clear either way. Efficiency of expression... ???? Yes and what's the point?
I found this to be a natural declaration, but the compiler is swearing. It is cursed in the following way
'Type' - undeclared identifier ordernir.mq5 213 18
'Type' - some operator expected ordernii.mq5 213 18
POSITION_TYPE' - expression has no effect ordernir.mq5 213 4
I'm not an expert of English, but I don't understand it anyway.
THANK YOU!!! I'll have a look.
Super!!! It's an int!!!
'POSITION_TYPE' - expression has no effect orderni.mq5 213 4
I found this to be a natural declaration, but the compiler is swearing. It was cursed in the following way
'Type' - undeclared identifier orderni.mq5 213 18
'Type' - some operator expected ordernir.mq5 213 18
'POSITION_TYPE' - expression has no effect ordernir.mq5 213 4
I'm not an expert in English, but it's not clear either way.
ENUM_POSITION_TYPE TypeTHANK YOU!!! I'll have a look.
Super!!! It's an int!!!
'PositionGetInteger' - no one of the overloads can be applied to the function call order.mq5 214 13 In short, it's not the function but the call. Or rather what I feed into it.
You still don't read the documentation. You don't even try to copy it.
What's that got to do with it? Can't find it? It doesn't work?
https://www.mql5.com/ru/articles/211
'PositionGetInteger' - no one of the overloads can be applied to the function call order.mq5 214 13 In short, not the function, but the call. Or rather what I feed into it. I have ????????????