ghostjat / shoonya-php
Shoonya-API和websocket的PHP包装器或连接器。
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.0
- katzgrau/klogger: ^1.2.2
- ratchet/pawl: ^0.4.1
- spomky-labs/otphp: ^11.0
README
感谢有您
Finavsia https://prism.finvasia.com/register/?franchiseLead=OTA1ODY=
Shoonya-php (非官方)
此PHP库用于连接到Finvasia Shoonya OMS。
这是Shoonya的RestAPI和websocket的PHP包装器或连接器。
安装
要安装此包,请使用Composer
composer require ghostjat/Shoonya-php
Shoonya-php API
public __construct()
public login(): bool 在Shoonya中登录
public logout(): bool 从Shoonya注销
public forgotPassword(string $uid, string $pan, string $dob): bool 重置密码
public getWatchListNames(): array|bool 获取观察名单名称
public getWatchList(string $wlname): array|bool 获取观察名单
public addScripWatchList(string $wlname, string|array $instrument): boolean 将股票添加到观察名单
public deleteScripWatchList(string $wlname, string|array $instrument): boolean 从观察名单中删除股票
public searchScrip(string $searchtext, string $exchange = 'BSE'): array 搜索股票
public getToken(string $tysm, string $exch = 'NFO'): string 获取股票的token
public getLTP(string $tysm, string $exch = 'NFO') 获取股票的最新交易价格
public getLimits(string $prd = null, string $seg = null, string $exch = null)
public getOptionChain(string $tsym, int $strprc, int $count = 5, string $exch = 'NFO'): array 获取期权链
public getScripInfo(string $token, string $exch = 'BSE') 获取股票信息
public getQuotes(string $token, string $exchange = 'BSE'): array 获取股票的实时报价
public getTimePriceSeries( string $token, string $startTime = null, string $endTime = null, string $interval = '15', string $exch = 'BSE' ) 获取基于分钟的基于时间的价格数据
public getDailyPriceSeries(string $tysm, string $startDate, string $endDate = null, string $exch = 'NSE') 获取每日价格序列数据
public positionProductConversion()
public singleOrderHistory(int $orderNo) 获取单个订单历史
public getOrderbook(): array 获取订单簿
public getTradebook(): array|bool 获取交易簿
public getHoldings(string $productType = self::Delivery): array|object 获取投资组合持仓
public getPositions(): array|stdClass
public placeOrder( type $buy_or_sell, type $productType, type $exchange, type $tradingSymbol, type $quantity, type $discloseQty, type $priceType, int $price = 0.0, int $triggerPrice = null, type $retention = 'DAY', type $amo = 'NO', type $remarks = null, int $booklossPrice = 0.0, int $bookprofitPrice = 0.0, int $trailPrice = 0.0, ): boolean 下达不同类型的订单
public getOrderStatus(string $orderNo): boolean 获取已放置订单的状态
public modifyOrder( type $orderNo, type $exchange, type $tradingSymbol, type $newquantity, type $newpriceType, type $newprice = 0.0, type $newtriggerPrice = null, type $booklossPrice = 0.0, type $bookprofitPrice = 0.0, type $trailPrice = 0.0, ): boolean 修改已放置的订单
public cancelOrder(type $orderNo): boolean 取消已放置的订单
public exitOrder(type $orderNo, type $productType): boolean 关闭/退出头寸
public gttOrder( string $buy_or_sell, string $productType, string $exchange, string $tradingSymbol, float $priceToCompare, int $quantity, float $price = 0, string $ai_t = self::AITG, string $retention = 'DAY', string $remarks = null, int $discloseQty = null, ): boolean 设置 GTT 或 GTC 订单
public cancelGtt(int $alID): boolean 取消已放置的 GTT
public getPendingGtt() 获取待处理的 GTT 订单详情
public getEnableGtt()
public getSessionData(): array 获取当前会话临时数据
public subscribe(array|string $intst, $feedType = self::FeedTouchLine) WS 相关函数
public unsubscribe(array|string $intst, $feedType = self::FeedTouchLine)
public subscribeOrders()
public telegram(string $msg): bool 发送 Telegram 通知
待办
AAB PMS RLAB Live-Algo 算法回测
作者
@author Shubham Chaudhary
@author https://www.linkedin.com/in/drshubh/
@blog https://ghostjat.medium.com
@since Aug 2022
@version 1.0.1
@license MIT
许可
版权所有 (C) 2022 Shubham Chaudhary-保留所有权利。