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

Syntax

Public Function NewSLTPOrder(ByRef ticket As Integer, ByRef Lots As Double, [ByRef SL As Object = ""], [ByRef TP As Object = ""], [ByRef TransTag As String = ""]) As CallingResultsEnum

This function is used to set a new SL/TP order for specific ticket number.After NewSLTPOrder method executes the NewSLTPOrderResult event fires.

Parameters

Part Description 
ticket  Associated ticket number to put SL/TP on it , value of type Integer. 
Lots  Amount of lots , value of type Double
SL  Stop loss amount ,optional value.
TP  Take profit amount ,optional value.
TransTag String value to mark the SLTP order when the result came from server, optional value.

Return value

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

Sample

Private Sub Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn.Click

        Dim result As VertexFXClientAPI10.CallingResultsEnum

        'API is a predefined variable as CVertexFXClientAPI10
        Dim Pos As VertexFXClientAPI10.COOpenPosition
        
        Pos = API.OpenPositionByIndex(1)

        result = API.NewSLTPOrder(Pos.Ticket,Pos.Lots,"","","New SLTP By API")

        MsgBox("New SLTP Order Result : " & result.Tostring)

End Sub

 


See Also


VertexFX Client 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