PositionSelect
Chooses an open position for further working with it. Returns true if the function is successfully completed. Returns false in case of failure. To obtain information about the error, call GetLastError().
bool PositionSelect( |
반환값.
- true : 함수호출결과 성공인 경우, fasle : 호출결과 실패인 경우 포지션0인 경우에도 false 반환됨.
설명.
- 인자로 전달된 심볼 1개에 포지션 여러 개인 경우엔 ticket 번호가장 작은 것 1개만 선택됨.
- PositionSelect 이후 연속하여 아래 함수를 호출하는 식으로 사용된다.
PositionGetDouble, PositionGetInteger, PositionGetString
상세
PositionSelect
https://www.mql5.com/en/docs/trading/positionselect
Documentation on MQL5: Trade Functions / PositionSelect
PositionSelect Chooses an open position for further working with it. Returns true if the function is successfully completed. Returns false in case of failure. To obtain information about the error, call GetLastError(). bool PositionSelect( string symb
www.mql5.com
PositionGetDouble
https://www.mql5.com/en/docs/trading/positiongetdouble
Documentation on MQL5: Trade Functions / PositionGetDouble
PositionGetDouble The function returns the requested property of an open position, pre-selected using PositionGetSymbol or PositionSelect. The position property must be of the double type. There are 2 variants of the function. 1. Immediately returns the pr
www.mql5.com
PositionGetInteger
https://www.mql5.com/en/docs/trading/positiongetinteger
Documentation on MQL5: Trade Functions / PositionGetInteger
//+------------------------------------------------------------------+ //| Trade function | //+------------------------------------------------------------------+ void OnTrade() { //--- check if a positio
www.mql5.com
PositionGetString
https://www.mql5.com/en/docs/trading/positiongetstring
Documentation on MQL5: Trade Functions / PositionGetString
PositionGetString The function returns the requested property of an open position, pre-selected using PositionGetSymbol or PositionSelect. The position property should be of the string type. There are 2 variants of the function. 1. Immediately returns the
www.mql5.com
첫등록 : 2019년 4월 19일
최종수정 :
본 글 단축주소 : https://igotit.tistory.com/2120
'트레이딩 > 메타트레이더 코딩' 카테고리의 다른 글
MQL5. CPositionInfo (0) | 2019.04.23 |
---|---|
MQL5. PositionGetSymbol (0) | 2019.04.19 |
MQL5. PositionSelect, PositionGetDouble, PositionGetInteger, PositionGetString (2) | 2019.04.19 |
MQL5. PositionsTotal (0) | 2019.04.19 |
MQL5. NormalizeDouble (0) | 2019.04.19 |
메타트레이더 5. MetaEditor. MQL5 Script. CyClosePositionAll (0) | 2019.04.19 |
PositionSelect하면
다음 Select 전까지는 계속 그게 선택되어 있는 건가요?
포지션 선택이 언제까지 유효하죠?
답글
본 함수는 인자로 전달된 심볼 1개에 포지션 여러 개인 경우엔 ticket 번호가장 작은 것 1개만 선택됩니다. 함수 호출한 시점에 ticket 번호 가장 작은 포지션이 선택된 상태로 있게되고, 이후 본 함수 다시 호출하기전까진 계속 유지됩니다.
한편, 저의 경우엔 포지션 상황 전체를 알 수 있는 정보가 아니다 보니 이 함수는 사용할 일이 없더군요..
실전에서 유용하게 활용하는 코드예 참조
1. 심볼1개의 모든 포지션등.
https://igotit.tistory.com/2689