Skip to content

stock,stock calc,php stock,macd,rsi,boll,trix,roc,bias,dma,kdj,cci,wr,obv,psy,arbr,dmi

Notifications You must be signed in to change notification settings

jiangxyang/stock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

股票技术指标计算,仅供参考学习

stock,stock calc,php stock,macd,rsi,boll,trix,roc,bias,dma,kdj,cci,wr,obv,psy,arbr,dmi

基于 thinkphp 6.0.13LTS(也可以用别的框架或者原生,后续改写Factor.php文件引入即可) 和 PHP Trader类的函数

thinkphp phpTraderNative

// 1
composer create-project topthink/think tpstock
// 2
composer require lupecode/php-trader-native
// 安装php-trader-native后找到vendor/lupecode/php-trader-native/source/Trader.php文件第238行,改写$newOutReal[$index + $offset] = $inDouble;如下
$newOutReal[$index + $offset] = number_format($inDouble,3,'.',''); // 四舍五入保留3位,自行决定是否修改

Factor.php 文件可放置到项目的extend文件夹下,自行引入即可

stock主表数据示例

image

stock_daily表数据示例,每开市日及时更新即可

image

调用方法

dd(Factor::macd(1,0)); // 1为stock_id,0表示仅返回最新那天的指标,如果为1则表示返回全部的天数指标

About

stock,stock calc,php stock,macd,rsi,boll,trix,roc,bias,dma,kdj,cci,wr,obv,psy,arbr,dmi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages