doxadoxa / php-indicators
Indicator library for PHP.
dev-master
2019-04-12 14:15 UTC
Requires
- php: ^7.1
- ext-trader: *
This package is auto-updated.
Last update: 2025-03-13 03:49:45 UTC
README
Trading indicators library. It's need for
simplify working with trader
extension.
Requires
php 7.3+
ext-trader
Install
composer install doxadoxa/phpindicators
Tests
Test not exists yet.
Example
$klines = ExternalApi::getKlines('btcusdt', '1m'); $ohlvc = new OHLVC( $klines ); $sma14 = $ohlvc->close()->sma(14); $sma3 = $ohlvc->close()->sma(3); $atr = $ohlvc->atr(3); if ( $sma3->crossBelow( $sma14 ) ) { Trader::setStopLossOn( $sma3[0] - $atr[0] * 10 ); }