1. Go to this page and download the library: Download trademinator/indicators library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
trademinator / indicators example snippets
use Trademinator\Indicators\Indicators;
use function Trademinator\Indicators\normalize_ticker;
// $exchange is your application's CCXT exchange instance.
$tickers = $exchange->fetch_ohlcv('BTC/USD', '1m', null, 100);
normalize_ticker($tickers, reindex: true, indexUnit: 'milliseconds');
$indicators = new Indicators();
$emaKey = $indicators->ema($tickers, 14);
$rsiKey = $indicators->rsi($tickers, 14);
$atrpKey = $indicators->atrp($tickers, 14);
$last = end($tickers);
echo $last[$emaKey];
use Trademinator\Indicators\Traits\Patterns;
final class MyAnalyzer
{
use Patterns; // Includes Technical, which
use Trademinator\BcMath\PrecisionContext;
use Trademinator\BcMath\PrecisionPolicy;
use Trademinator\Indicators\Indicators;
$policy = new PrecisionPolicy(
minimumScale: 16,
guardDigits: 4,
maximumScale: 48,
);
// An explicit working scale chosen by the application for this stream.
$context = new PrecisionContext(scale: 24, policy: $policy);
$indicators = new Indicators(precision: $context);
$indicators->ema($tickers, 14);
$indicators->rsi($tickers, 14);
$indicators->atrp($tickers, 14);
$calculator = new Indicators();
$key = $calculator->ema($tickers, 14, context: $context);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.