What is the meaning of the values returned from trader_bbands()?

丶灬走出姿态 提交于 2019-12-05 13:25:44

A1:
1. Review the php-library documentation on trader_bbands(), as a first step.
2. Publish MCVE-altogether-with-a-DataSET to allow validation against a common DataSET
3. Compare reference implementations to prove { PASS | FAIL }-status of Trader php-library implementation.

Ad Step 1.:
array trader_bbands ( array $real [, integer $timePeriod [, float $nbDevUp [, float $nbDevDn [, integer $mAType ]]]] )

Let's agree to set $nbDevUp = 1.0, not a technically smallest float TRADER_REAL_MIN
Let's agree to set $nbDevDn = 1.0.

Let's agree to set $timePeriod = 7

Let's agree to set $real

$real = array(
               0 => 2000.0,
               1 => 2001.0,
               2 => 2002.0,
               3 => 2003.0,
               4 => 2004.0,
               5 => 2005.0,
               6 => 2006.0,
               );

Expectations:

The .std()-sigma-related values ought get into a fair fashion, independently of not knowing all implementation details about the Trader php-library model of trader_bbands() calculus, particularly in the TRADER_MA_TYPE_EMA mode, missing the exponential-weighting details used inside their model.

Nevertheless

A) There ought be sure all differences
between $bBand[0][i] - $bBand[1][i] == $bBand[1][i] - $bBand[2][i] to be == 2.0

B) There ought be a value of what value of the exponent was used in .ewma()-method documented somewhere in Trader php-library.

Well, sure, without such value, one may resort to a brute-force reverse search for a matching value used, but it may be a rather inefficient method to prove the $bBand[1] values are calculated in Trader php-library in a manner compatible to the common Quant-practice to use
ewmaEXP = 2.0 / ( timePeriod + 1 ).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!