Home
Account Center
Services

Streamster API

The pages referenced below describe how to use the Streamster API to create applications that interface with the Streamster trading platform. Applications using the Streamster API can retrieve various data from the platform, execute and modify orders and positions, and perform a variety of related actions.

To open and read a particular page, please click on its title.



3.4. ChangePosition

ChangePosition changes certain parameters of an open position. The ChangePosition method has one parameter, a "Position" structure, which specifies the ID of the position to be changed and the new parameters of the position.

The following fields in the Position structure are valid and used when calling the ChangePosition method:

PositionID: Contains the ID of the position to be changed

ExitStopLoss: Sets the Exit Stop Loss parameter; when empty, Exit Stop Loss parameter will be reset for the position

ExitTarget: Sets the Exit Target parameter; when empty, Exit Target parameter will be reset for the position

Text: Sets the Text parameter of the position

All other fields in the Position structure are ignored when the ChangePosition method is called.

NOTE: If any of the above fields are left empty, a default value will be assumed, not the previous value associated with the order. For example, if ChangePosition is invoked with ExitStopLoss field left empty, the Exit Stop Loss value will be reset - it will not have the value as it was before the call.

Sample - PHP: The following code changes a position.

<?php

$api = new SoapClient ("http://127.0.0.1:8018/service.wsdl",
    array('features' => SOAP_SINGLE_ELEMENT_ARRAYS));

$position -> PositionID = "B2HN72VL3";
$position -> ExitStopLoss = 3.20;
$position -> ExitTarget = 3.50;
$position -> Text = "hello world";

$api -> ChangePosition($position);

?>

Sample - Visual Basic: The following code changes a position.

Dim api As StreamsterApi = New StreamsterApi

Dim p As Position = New Position

p.PositionID = "B2HN72VL3"
p.ExitStopLoss = 3.20
p.ExitStopLossSpecified = True
p.ExitTarget = 3.50
p.ExitTargetSpecified = True
p.Text = "hello world"

api.ChangePosition(p)


Send us your comments and any suggestions you might have about the Streamster API. We look forward to receiving your input and improving content on this page to help you utilize the API to its full extent.