PositionGetSymbol
Returns the symbol corresponding to the open position and automatically selects the position for further working with it using functions PositionGetDouble, PositionGetInteger, PositionGetString.
string PositionGetSymbol( |
Parameters
index
[in] Number of the position in the list of open positions.
Return Value
Value of the string type. If the position was not found, an empty string will be returned. To get an error code, call the GetLastError() function.
코드예 1.
- EA 가 배치되는 챠트의 symbol 의 전체 포지션 수량 구하는 함수.
int GetNumPosition(string symbol)
{
int count_position_symbol;
for(int idx = 0; idx < PositionsTotal(); idx++)
{
if(symbol == PositionGetSymbol(idx)) count_position_symbol++;
}
return count_position_symbol;
}
상세
https://www.mql5.com/en/docs/trading/positiongetsymbol
첫등록 : 2019년 4월 19일
최종수정 :
본 글 단축주소 : https://igotit.tistory.com/2121
'트레이딩 > 메타트레이더 코딩' 카테고리의 다른 글
MQL5. 포지션 함수, 클래스. (0) | 2019.04.23 |
---|---|
MQL5. CPositionInfo (0) | 2019.04.23 |
MQL5. PositionSelect, PositionGetDouble, PositionGetInteger, PositionGetString (2) | 2019.04.19 |
MQL5. PositionsTotal (0) | 2019.04.19 |
MQL5. NormalizeDouble (0) | 2019.04.19 |
댓글