- LogLevel
- SetExpertMagicNumber
- SetDeviationInPoints
- SetTypeFilling
- SetTypeFillingBySymbol
- SetAsyncMode
- SetMarginMode
- OrderOpen
- OrderModify
- OrderDelete
- PositionOpen
- PositionModify
- PositionClose
- PositionClosePartial
- PositionCloseBy
- Buy
- Sell
- BuyLimit
- BuyStop
- SellLimit
- SellStop
- Request
- RequestAction
- RequestActionDescription
- RequestMagic
- RequestOrder
- RequestSymbol
- RequestVolume
- RequestPrice
- RequestStopLimit
- RequestSL
- RequestTP
- RequestDeviation
- RequestType
- RequestTypeDescription
- RequestTypeFilling
- RequestTypeFillingDescription
- RequestTypeTime
- RequestTypeTimeDescription
- RequestExpiration
- RequestComment
- RequestPosition
- RequestPositionBy
- Result
- ResultRetcode
- ResultRetcodeDescription
- ResultDeal
- ResultOrder
- ResultVolume
- ResultPrice
- ResultBid
- ResultAsk
- ResultComment
- CheckResult
- CheckResultRetcode
- CheckResultRetcodeDescription
- CheckResultBalance
- CheckResultEquity
- CheckResultProfit
- CheckResultMargin
- CheckResultMarginFree
- CheckResultMarginLevel
- CheckResultComment
- PrintRequest
- PrintResult
- FormatRequest
- FormatRequestResult
PositionClose
Belirtilen sembol ile bir açık pozisyonu kapatır.
bool PositionClose(
|
Belirtilen fiş değerine sahip olan pozisyonu kapatır.
bool PositionClose(
|
Parametreler
symbol
[in] Kapatılmak istenen pozisyonun sembolünün ismi.
ticket
[in] Kapatılan pozisyonun fişi.
deviation=ULONG_MAX
[in] Mevcut fiyattan maksimum sapma (puan bazında).
Dönüş Değeri
Temel yapılar başarıyla denetlenirse 'true', aksi durumda 'false'.
Not
PositionClose(...) yönteminin başarıyla sonuçlanması her zaman başarılı bir alım-satım işlemi uygulandığı anlamına gelmez. Bu yüzden, alım-satım isteğinin sonucunun (işlem sunucusunun dönüş kodu) ResultRetcode() yöntemi kullanılarak denetlenmesi önemlidir.
Netleştirme (netting) sisteminde (ACCOUNT_MARGIN_MODE_RETAIL_NETTING ve ACCOUNT_MARGIN_MODE_EXCHANGE) bir sembol üzerinde sadece bir pozisyon bulunabilir. Bu pozisyon bir veya daha fazla işlemin sonucu açılmış olabilir. Müşteri terminalinde Araçkutusunun "İşlem" sekmesi içinde birlikte gösterilen mevcut bekleyen emirler ve pozisyonlar birbirleriyle karıştırılmamalıdır.
Çoklu pozisyonlara izin verilemsi durumunda (ACCOUNT_MARGIN_MODE_RETAIL_HEDGING) bir sembol üzerinde birden fazla pozisyon açılabilir. Bu durumda PositionClose fonksiyonu en düşük fiş numarasına sahip olan pozisyonu kapatır.