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.
1.1. Using API from PHP
PHP supports SOAP and Streamster API very well. Installing PHP on your computer is simple - download and install the Windows binaries from the PHP.net site. PHP version 5 or later is required. Some PHP versions on Windows do not have SOAP enabled by default - you can enable the SOAP extension by editing the PHP.INI file and uncommenting the extension=php_soap.dll line.
To perform a simple PHP test, create a PHP file named "test.php" and edit it in Windows Notepad. Paste the following code into it:
<?php $api = new SoapClient ("http://127.0.0.1:8018/service.wsdl", array('features' => SOAP_SINGLE_ELEMENT_ARRAYS)); $quote = $api -> GetQuote("EUR/USD"); echo $quote -> Last; ?>
Test the above PHP script by running "php test.php" and it should simply display the last price of EUR/USD.
To test for critical errors (for example, when Streamster is not started at all, when method parameters are invalid, etc), you can use the standard PHP exception handling.
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.