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.



2.3. GetTrades

GetTrades method returns an array of "Trade" structures. This array corresponds directly to the Trades window in Streamster. Each Trade structure in the returned array contains one trade with its associated fields as displayed in Streamster. GetTrades returns an array of Trade structures which contain only fields available in Streamster - if you wish to retrieve any fields not currently shown in Streamster's Trades window, you have to add them by clicking the Columns button.

Sample - PHP: The following sample retrieves all trades and lists them.

<?php

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

$r = $api -> GetTrades();
if(property_exists($r, "Trade")) {
    foreach($r -> Trade as $n => $TradeInfo) {
        echo "\tTrade " . $n . "\n";
        foreach($TradeInfo as $field => $value) {
            echo "\t\tField: " . $field . " = " . $value . "\n";
        }
    }
}

?>

Sample - Visual Basic: The following sample retrieves all trades and lists them.

Dim api As StreamsterApi = New StreamsterApi

Dim at As Trade()
Dim t As Trade

at = api.GetTrades()

For Each t In at
    Console.WriteLine("")
    Console.WriteLine("Trade:")

    Console.WriteLine("TradeID: " & t.TradeID)
    Console.WriteLine("Desk: " & t.Desk)
    Console.WriteLine("Instrument: " & t.Instrument)
    Console.WriteLine("Side: " & t.Side)
    Console.WriteLine("Phase: " & t.Phase)
    Console.WriteLine("Price: " & t.Price)
    Console.WriteLine("Quantity: " & t.Quantity)
    Console.WriteLine("Executed: " & t.Executed)
    Console.WriteLine("Status: " & t.Status)
    Console.WriteLine("Currency: " & t.Currency)
    Console.WriteLine("Text: " & t.Text)
    Console.WriteLine("OrderID: " & t.OrderID)
Next


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.