본문 바로가기
트레이딩/메타트레이더 코딩

MQL5. PositionGetSymbol

by i.got.it 2019. 4. 19.

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(
int index // Number in the list of positions
);

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

 

Documentation on MQL5: Trade Functions / PositionGetSymbol

 

www.mql5.com

 

 

 


첫등록 : 2019년 4월 19일

최종수정 : 

 

본 글 단축주소 : https://igotit.tistory.com/2121

 


 

댓글



 

비트코인




암호화폐       외환/나스닥/골드       암호화폐/외환/나스닥/골드 암호화폐/외환/나스닥/골드   암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)     롤오버 이자 없는 스왑프리계좌
( 스왑프리 암호화폐도 거래 가능 )    
MT4, MT5 , cTrader 모두 지원     FTMO 계좌 매매운용. MT4,MT5