Loading ...

有偿求助:费舍尔指标代码编写,加微:MEQSUPER

Author: 1070278998@qq.com, Created: 2021-12-20 15:47:42, Updated:


More

小小梦 您好,可以发到众包区,有不少开发者可以联系。

小小梦 完整的测试,文章,在文库里公开了。不知道写的对不对,你可以测试看看。我是按照这个费雪转换算法实现的。

smario 梦神效率真高哈哈哈

小小梦 ``` function getHighest(arr, period) { if (arr.length == 0 || arr.length - period < 0) { return null } var beginIndex = arr.length - period var ret = arr[beginIndex].High for (var i = 0 ; i < arr.length - 1 ; i++) { if (arr[i + 1].High > ret) { ret = arr[i + 1].High } } return ret } function getLowest(arr, period) { if (arr.length == 0 || arr.length - period < 0) { return null } var beginIndex = arr.length - period var ret = arr[beginIndex].Low for (var i = 0 ; i < arr.length - 1 ; i++) { if (arr[i + 1].Low < ret) { ret = arr[i + 1].Low } } return ret } function calcFisher(records, ratio, period) { var preFish = 0 var preX = 0 var arrFish = [] // 当K线长度不足,不满足周期时 if (records.length < period) { for (var i = 0 ; i < records.length ; i++) { arrFish.push(0) } return arrFish } // 遍历K线 for (var i = 0 ; i < records.length ; i++) { var fish = 0 var x = 0 var bar = records[i] var mid = (bar.High + bar.Low) / 2 // 当前BAR不足period计算时 if (i < period - 1) { fish = 0 preFish = 0 arrFish.push(fish) continue } // 计算周期内最高价和最低价 var bars = [] for (var j = 0 ; j <= i ; j++) { bars.push(records[j]) } var lowestLow = getLowest(bars, period) var highestHigh = getHighest(bars, period) // 价变参数 x = ratio * 2 * ((mid - lowestLow) / (highestHigh - lowestLow) - 0.5) + (1 - ratio) * preX if (x > 0.99) { x = 0.999 } else if (x < -0.99) { x = -0.999 } preX = x fish = 0.5 * Math.log((1 + x) / (1 - x)) + 0.5 * preFish preFish = fish arrFish.push(fish) } return arrFish } ```

小小梦 X.X!

1070278998@qq.com https://www.kancloud.cn/wizardforcel/python-quant-uqer/186235 http://www.danglanglang.com/gupiao/2281 你别抽时间了呀 现在就搞吧

小小梦 好的,抽时间研究下。

1070278998@qq.com 你们官方增加这个指标吗 有时间表吗 这个指标把我高头大了e