omkoding / cot
此包的最新版本(v1.2)没有可用的许可证信息。
v1.2
2019-07-12 14:35 UTC
Requires
- php: ^7.1.3
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- phpunit/phpunit: ^7.5
- symfony/var-dumper: ^4.3
This package is auto-updated.
Last update: 2024-09-13 03:14:05 UTC
README
解析原始COT报告,来源为https://www.cftc.gov/dea/futures/deacmesf.htm 或来自https://www.cftc.gov/MarketReports/CommitmentsofTraders/HistoricalViewable/index.htm的存档版本
安装
composer require omkoding/cot
用法
<?php require __DIR__.'/../vendor/autoload.php'; use OmKoding\Cot\Report; use OmKoding\Cot\Symbol; $report = new Report; // get latest report $report->latest(); // get latest report by symbol $report->latest(Symbol::EURO_FX); // get by date and symbol $report->byDate('09/11/2018', Symbol::EURO_FX); // list all symbol Symbol::all();
响应
array:3 [
"slug" => "EURO_FX",
"symbol" => "EURO FX",
"date" => "2018-09-11",
"current" => array:2 [
"non-commercial" => array:3 [
"long" => 164639
"short" => 153469
"spreads" => 19095
]
"commercial" => array:2 [
"long" => 277060
"short" => 310471
]
]
"changes" => array:2 [
"non-commercial" => array:3 [
"long" => -8696
"short" => -11903
"spreads" => 5389
]
"commercial" => array:2 [
"long" => 23044
"short" => 26696
]
]
"open-interest" => array:3 [
"current" => 550492
"non-commercial" => array:3 [
"long" => 29.9
"short" => 27.9
"spreads" => 3.5
]
"commercial" => array:2 [
"long" => 50.3
"short" => 56.4
]
]
]
测试
测试文件位于tests
文件夹中。运行phpunit
进行测试。