Skip to content

Commit

Permalink
add signal into macd
Browse files Browse the repository at this point in the history
  • Loading branch information
romulodl committed Feb 26, 2021
1 parent 042a7c1 commit ded1dba
Show file tree
Hide file tree
Showing 5 changed files with 535 additions and 248 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ or add `romulodl/macd` to your `composer.json`. Please check the latest version

```php
$macd = new Romulodl\Macd();
$macd->calculate(array $values, int $short_period = 12, int $long_period = 26);
//returns a float value
$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
]
]
```

For example:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"romulodl/ema": "^2.0"
"romulodl/ema": "^3.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit ded1dba

Please sign in to comment.