dprmc/ice-remote-plus-client

一个PHP客户端,用于连接到theice.com的Remote Plus服务。

v1.0.16 2024-08-03 00:19 UTC

This package is auto-updated.

Last update: 2024-09-03 00:29:31 UTC


README

Packagist

更新到价格可用性

以下是我们RemotePlus活动网站的链接,您可以在其中查看RemotePlus中每个活动的预期时间。 http://rplus.intdata.com/help/rpevents.html

不同类型的证券在不同时间可用。

关于RMBS PRC可用性的重要公告

RMBS证券预计将在东部标准时间16:00发布。

-- Jon Anderson - 客户支持 - ICE数据服务 - 2019-01-29

ICE提供的文档

https://rplus.intdata.com/documentation/RemotePlus_UserGuide.pdf

您需要向theice.com的代表询问一份名为“RemotePlusSM指南至数据”的文档,以了解您可请求的每个可用项目代码的详细信息。

摘要

此PHP库作为The ICE的RemotePlus API的客户端。

示例

以下是使用RemotePlusClient的基本语法。

$user   = $_ENV[ 'ICE_USER' ];
$pass   = $_ENV[ 'ICE_PASS' ];
$cusips = [ '17307GNX2',
            '07325KAG3',
            '22541QFF4',
            '933095AF8',
            '86358EUD6',
            '07384YTS5' ];
$date   = '2019-01-23';
$items  = [ 'IEBID', 'IEMID', 'IEASK' ];

$remotePlusResponse = RemotePlusClient::instantiate( $user, $pass )
                                      ->addCusips( $cusips )
                                      ->addDate( $date )
                                      ->addItems( $items )
                                      ->run();
                                      
// Get all of the MID prices
$midPrices = $remotePlusResponse->getAllValuesForItem( 'IEMID' );
print_r($midPrices);
/*
Array
(
    [17307GNX2] => 91.31362
    [07325KAG3] => 90.33492
    [22541QFF4] => !NA
    [933095AF8] => 29.60287
    [86358EUD6] => 66.0742
    [07384YTS5] => 71.06705
)
*/

// Get the SecurityResponse object for a given CUSIP.
// (this one does not have a valid price for that date, so this will throw a ItemValueNotAvailable exception.
$securityResponse = $remotePlusResponse->getByIdentifier( '22541QFF4' );
$price            = $securityResponse->getItem( 'IEMID' );

其他可用函数

RemotePlusClient的run()方法将返回我的RemotePlusResponse对象。以下是如何与该对象交互的示例。

// Returns an associative array of all the SecurityResponse objects, using the security identifier as the key. 
$allSecurityResponses = $remotePlusResponse->getResponses();
foreach($allSecurityResponses as $cusip => $securityResponse):
    $midPrice = $securityResponse->getItem('IEMID');
    echo $midPrice; // 90.413
endforeach;

获取MID价格数组。

$midPrices = $remotePlusResponse->getAllValuesForItem('IEMID');
print_r($midPrices);
/*
Array
(
    [17307GNX2] => 91.31362
    [07325KAG3] => 90.33492
    [22541QFF4] => !NA
    [933095AF8] => 29.60287
    [86358EUD6] => 66.0742
    [07384YTS5] => 71.06705
)
*/

获取某个证券的SecurityResponse对象

$securityResponse = $remotePlusResponse->getByIdentifier('17307GNX2');
$midPrice = $securityResponse->getItem('IEMID'); 
echo $midPrice; // 90.413