-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
37 lines (27 loc) · 1012 Bytes
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
require_once('vendor/autoload.php');
/******************************************************************************
* Get securities
*/
$txSecuritiesHost = '10.200.160.149:35554';
$txSecurities = new \PhpGrpc\TXSecurities($txSecuritiesHost);
$securityList = $txSecurities->search('tsl', \Proto\Common\Lang::ru, 10);
echo "\n\nGot " . count($securityList) . " securities\n\n";
/** @var \Grpc\Txsecurities\ClientSecurity $security */
foreach ($securityList as $security) {
echo $security->serializeToJsonString();
}
/******************************************************************************
* Get quotes
*/
$mdStreamHost = 'msa-ftcd1-tst02:5666';
//$finamId = 484958;
//$finamId = 22460;
$finamId = 393749;
$mdStream = new \PhpGrpc\MDStream($mdStreamHost);
$quoteList = $mdStream->getQuotesByFinamId($finamId);
echo "\n\nGot " . count($quoteList) . " quotes\n\n";
/** @var \Proto\Marketdata\Quote $quote */
foreach ($quoteList as $quote) {
echo $quote->serializeToJsonString();
}