I am curious about the usage of results of something like trader_macd() / trader_sma() ?
$this->getRecentData() gets the data in descending order e.g.
<?php return [ '2018-01-03' => 5, '2018-01-02' => 15, '2018-01-01' => 20, ];
trader_sma($recnetData, 2) will get
<?php return [ 10, 20]
In the code, pretty much everywhere uses array_pop() which returns the last element of array (in this case 20 is returned, but actually 10 is the latest SMA)
Is this correct? The default data size is 168, if the interval is one day then SMA result is average of some price data 100+ days ago, should it use the first element from the result array?
I am curious about the usage of results of something like trader_macd() / trader_sma() ?
$this->getRecentData() gets the data in descending order e.g.
<?php return [ '2018-01-03' => 5, '2018-01-02' => 15, '2018-01-01' => 20, ];
trader_sma($recnetData, 2) will get
<?php return [ 10, 20]
In the code, pretty much everywhere uses array_pop() which returns the last element of array (in this case 20 is returned, but actually 10 is the latest SMA)
Is this correct? The default data size is 168, if the interval is one day then SMA result is average of some price data 100+ days ago, should it use the first element from the result array?