|
Streamster™ API
The pages referenced below describe how to use Streamster™ API, which can be used to create applications that interface with Novativa Streamster™. Applications using the Streamster API can retrieve various data from Novativa Streamster, execute and modify orders on the market and perform a variety of related actions.
To open and read a particular page, please click on its title.
3.2. ChangeOrder
ChangeOrder changes certain parameters of a pending order. The ChangeOrder method has one parameter, an "Order" structure, which specifies the ID of the order to be changed and the new parameters of the order.
The following fields in the Order structure are valid and used when calling the ChangeOrder method:
 | OrderID: Contains the ID of the order to be changed |  | PriceType: MARKET (Default), LIMIT or STOP |  | Price: Required field when PriceType parameter is set to LIMIT or STOP |  | DurationType: GTC (Default), GTD or IOC |  | Duration: Required when DurationType parameter is set to GTD (Good Till Date) |  | Quantity: Required field |  | QuantityType: FULL (Default) or PARTIAL |  | ExitStopLoss: Optional; when empty, Exit Stop Loss parameter will be reset for the position |  | ExitTarget: Optional; when empty, Exit Target parameter will be reset for the position |  | Text: Sets the Text parameter of the position |
All other fields in the Order structure are ignored when the ChangeOrder 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 ChangeOrder 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 an order.
<?php
$api = new SoapClient ("http://127.0.0.1:8018/service.wsdl",
array('features' => SOAP_SINGLE_ELEMENT_ARRAYS));
$order -> OrderID = "CR82JA01D";
$order -> Price = 8756.24;
$order -> PriceType = "LIMIT";
$order -> ExitTarget = 8765;
$order -> Quantity = 10;
$order -> DurationType = "GTD";
$order -> Duration = date("c", time() + 3600);
$order -> Text = "test order from my script";
$api -> ChangeOrder($order);
?>
Sample - Visual Basic:
The following code changes an order.
Dim api As StreamsterApi = New StreamsterApi
Dim o As Order = New Order
o.OrderID = "K82LVC9DR"
o.Price = 8756.24
o.PriceSpecified = True
o.PriceType = "LIMIT"
o.ExitTarget = 8765
o.ExitTargetSpecified = True
o.Quantity = 10
o.QuantitySpecified = True
o.DurationType = "GTD"
o.Duration = DateAdd("d", 1, Now())
o.DurationSpecified = True
o.Text = "test order from my script"
api.ChangeOrder(o)
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.
|