1. Go to this page and download the library: Download romulodl/macd 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/ */
romulodl / macd example snippets
$macd = new Romulodl\Macd();
$macd->calculate(array $values, int $short_period = 12, int $long_period = 26, int $signal_period = 9);
//returns an array values with the macd and signals
//for example
//
[
[
100, // macd value
90 // signal value
],
[
99, //macd value from the previous candle
89 // signal value from the previous candle
]
]