Knowledgebase:
NewSLTPOrder
Posted by Rula Halaseh, Last modified by Rawan Al Hourani on 05 February 2018 01:39 PM

Syntax

 Public Function NewSLTPOrder(Ticket As Integer, Lots As Double, Optional SL As Variant = "", Optional TP As Variant = "", Optional TransTag As String = "") As CallingResultsEnum

This function is used to create a new SL/TP order for specific position .A user account must be selected before using this method.After NewSLTPOrder method executes the NewSLTPOrderResult event fires

Parameters

Part Description 
Ticket Associated ticket number to open manage order on it ,value of type Integer.
Lots Amount of lots , the value of type Double.
SL Stop loss amount, the optional value of type Object.
TP Take profit amount , the optional value of type Object.
TransTag String value is used to mark the new SLTP order operation when the result came from the server.

Return value

Returns value of type CallingResultsEnum , if the request sent to the server successfully it will return SuccessResult.

Sample

 
 Public WithEvents m_oBOAPI As CVertexFXBOAPI

 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

   Dim result As CallingResultsEnum
   Dim Pos As COOpenPosition
   Pos = m_oBOAPI.OpenPositionByIndex(1)
     result = m_oBOAPI.NewSLTPOrder(Pos.Ticket,Pos.Lots,"",Pos.Price+2,"")
     MsgBox(result)

  End Sub

 Private Sub m_oBOAPI_NewSLTPOrderResult(ByRef Result As VertexFXBOAPI10.NewOrderResultEnum, ByRef OrderID As Integer, ByRef ServerTime As String,TransTag as String) Handles m_oBOAPI.NewSLTPOrderResult

        MsgBox(Result)

    End Sub
 


See Also


VertexFX Backoffice API Index

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions