精易论坛

标题: 提取这段JS中的一段函数 [打印本页]

作者: pf0546    时间: 2019-4-19 20:10
标题: 提取这段JS中的一段函数
地址: https://img.bafang.com/cdn/assets/okfe/okui/okline/0.1.19/okui-combkline.js

提取这段JS 中  关于 MACD 和 KDJ 的计算方法。
最好能返回 其中 DIF,DEA,MACD ,K,D,J 的值,
或者能帮我指出 其中的计算方法也行。
我从网上找的计算方法 和网站上的数值不一样。
谢谢。
其中一部分代码:

var np = function(t) {
            function e() {
                var t;
                !function(t, e) {
                    if (!(t instanceof e))
                        throw new TypeError("Cannot call a class as a function")
                }(this, e),
                t = Zh(this, tp(e).call(this));
                var n = new gc("SHORT",2,200,12)
                  , o = new gc("LONG",2,200,26)
                  , r = new gc("MID",2,200,9);
                t.addParameter(n),
                t.addParameter(o),
                t.addParameter(r);
                var i = new fc("DIF",new ns(new ga(new Vi,n),new ga(new Vi,o)));
                t.addOutput(i);
                var a = new fc("DEA",new ga(i,r));
                t.addOutput(a);
                var u = new fc("MACD",new Hu(new ns(i,a),new Wi(2)),fc.outputStyle.MACDStick);
                return t.addOutput(u),
                t
            }
            return function(t, e) {
                if ("function" != typeof e && null !== e)
                    throw new TypeError("Super expression must either be null or a function");
                t.prototype = Object.create(e && e.prototype, {
                    constructor: {
                        value: t,
                        writable: !0,
                        configurable: !0
                    }
                }),
                e && ep(t, e)
            }(e, nh),
            function(t, e, n) {
                e && Qh(t.prototype, e),
                n && Qh(t, n)
            }(e, [{
                key: "getName",
                value: function() {
                    return "MACD"
                }
            }]),
            e
        }();



作者: pf0546    时间: 2019-4-19 20:14
为什么看不到自己的帖子??
作者: joga    时间: 2019-8-22 15:50
pf0546 发表于 2019-4-19 20:14
为什么看不到自己的帖子??

请问题主把算法提取出来了吗




欢迎光临 精易论坛 (https://125.confly.eu.org/) Powered by Discuz! X3.4