Syntax
Public Overrides Function ManualNewSLTPOrder (ByVal AccountID As Integer, ByVal Ticket As Integer, ByVal Lots As Double ,ByVal OrderType As VertexFXBridgeAPI .OperationTypeEnum , ByVal SymbolID As String , Optional ByVal SL As Object = "" , Optional ByVal TP As Object = "") As VertexFXBridgeAPI.TransResult
This function is used to create a manage order to an existing position for a specific account number. After ManualNewSLTPOrder method executes, NewSLTPOrderResult event fired.
Parameters
Key | Description |
AccountID | Account number which is required to create a manage order for. Value of type is Integer. |
Ticket | Position ticket number to be managed. Value of type is Integer. |
OrderType | Opertation type can be one of OperationTypeEnum. |
SymbolID | The symbol ID which is required to open a manage order on. Value of type Integer. |
Lots | Amount of lots. Value of type is Double. |
SL | Stop loss value. Optional value of type Double. |
TP | Take profit value. Optional Value of Type Double. |
Return value
Returns value of type TransResult. If the request was sent to server successfully it will return Succeeded.
Sample
Private Sub NewSLTP_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewSLTP.Click Dim Result As VertexFXBridgeAPI.TransResult Dim vClient As VertexFXBridgeAPI.Client Dim vPosition As VertexFXBridgeAPI.Position Dim vAccount As VertexFXBridgeAPI.Account vClient = BO.GetBO.ClientByIndex (1) vAccount = BO.GetBO.AccountByIndex (vClient.ClientID, 1) vPosition = BO.GetBO.OpenPositionByIndex (1) Result= BO.GetBO.ManualNewSLTPOrder (vAccountID, CInt (vPosition.Ticket), vPosition.Lots, vPosition.BuySell, CInt (vPosition.SymbolID), 1,) End Sub
See Also