交易中的机器学习:理论、模型、实践和算法交易 - 页 1862

 
Roman:

设置 -> 常规 -> 插入()和关闭}])'"
也许这将会有所帮助?

或者编译。
然后在错误选项卡上,双击第一个错误。
光标将进入没有封闭括号的地方。
于是对每个括号,双击错误, 把括号,编译。

任务是在Python中生成一个工作的Mql代码,那么为什么要对它进行修补呢?

几乎完成

 
Roman:

设置 -> 常规 -> 插入()和关闭}])'"
也许这将会有所帮助?

或者编译。
然后在错误选项卡上,双击第一个错误。
光标将进入没有封闭括号的地方。
于是对每个括号,双击一个错误, 把括号,编译。

我想我已经明白了,你不能在离线情况下做....。

投资组合是真正的东西....

 

瞧瞧

在调试器中会很麻烦 :D

这不是你能得到的最大的树

double decision_tree(double &features[]) { 
    if ( features[11] <= 0.000385 )  {
        if ( features[9] <= -0.000275 )  {
            if ( features[9] <= -0.000465 )  {
                if ( features[5] <= 0.00034 )  {
                    if ( features[10] <= -0.00034 )  {
                        return 2; }
                    if ( features[10] > -0.00034 )  {
                        if ( features[11] <= -0.00031 )  {
                            return 1; }
                        if ( features[11] > -0.00031 )  {
                            return 2; } } }
                if ( features[5] > 0.00034 )  {
                    return 1; } }
            if ( features[9] > -0.000465 )  {
                if ( features[4] <= -0.000465 )  {
                    return 1; }
                if ( features[4] > -0.000465 )  {
                    if ( features[9] <= -0.000425 )  {
                        if ( features[5] <= -0.00015 )  {
                            return 1; }
                        if ( features[5] > -0.00015 )  {
                            return 2; } }
                    if ( features[9] > -0.000425 )  {
                        if ( features[8] <= -0.000165 )  {
                            if ( features[4] <= -0.000395 )  {
                                if ( features[5] <= -0.00033 )  {
                                    return 1; }
                                if ( features[5] > -0.00033 )  {
                                    return 2; } }
                            if ( features[4] > -0.000395 )  {
                                return 2; } }
                        if ( features[8] > -0.000165 )  {
                            if ( features[8] <= -4.5 e-05 )  {
                                return 1; }
                            if ( features[8] > -4.5 e-05 )  {
                                return 2; } } } } } }
        if ( features[9] > -0.000275 )  {
            if ( features[3] <= 0.000605 )  {
                if ( features[1] <= -0.00036 )  {
                    return 2; }
                if ( features[1] > -0.00036 )  {
                    if ( features[9] <= -0.000115 )  {
                        if ( features[2] <= 0.000165 )  {
                            if ( features[4] <= -0.000125 )  {
                                if ( features[7] <= -0.00014 )  {
                                    if ( features[6] <= -0.000265 )  {
                                        if ( features[8] <= -0.0003 )  {
                                            return 1; }
                                        if ( features[8] > -0.0003 )  {
                                            return 2; } }
                                    if ( features[6] > -0.000265 )  {
                                        return 1; } }
                                if ( features[7] > -0.00014 )  {
                                    if ( features[10] <= -0.00015 )  {
                                        return 1; }
                                    if ( features[10] > -0.00015 )  {
                                        return 2; } } }
                            if ( features[4] > -0.000125 )  {
                                return 1; } }
                        if ( features[2] > 0.000165 )  {
                            return 2; } }
                    if ( features[9] > -0.000115 )  {
                        if ( features[1] <= -0.000175 )  {
                            if ( features[8] <= 0.000145 )  {
                                return 1; }
                            if ( features[8] > 0.000145 )  {
                                if ( features[2] <= -9.5 e-05 )  {
                                    return 0; }
                                if ( features[2] > -9.5 e-05 )  {
                                    return 2; } } }
                        if ( features[1] > -0.000175 )  {
                            if ( features[11] <= 0.000195 )  {
                                if ( features[11] <= -5.5 e-05 )  {
                                    if ( features[5] <= 9.5 e-05 )  {
                                        return 1; }
                                    if ( features[5] > 9.5 e-05 )  {
                                        if ( features[2] <= -2.5 e-05 )  {
                                            return 0; }
                                        if ( features[2] > -2.5 e-05 )  {
                                            return 1; } } }
                                if ( features[11] > -5.5 e-05 )  {
                                    if ( features[8] <= -8.5 e-05 )  {
                                        if ( features[2] <= 2.5 e-05 )  {
                                            return 1; }
                                        if ( features[2] > 2.5 e-05 )  {
                                            return 2; } }
                                    if ( features[8] > -8.5 e-05 )  {
                                        return 1; } } }
                            if ( features[11] > 0.000195 )  {
                                if ( features[4] <= -0.00024 )  {
                                    return 0; }
                                if ( features[4] > -0.00024 )  {
                                    if ( features[2] <= 0.00021 )  {
                                        if ( features[1] <= 1.5 e-05 )  {
                                            return 1; }
                                        if ( features[1] > 1.5 e-05 )  {
                                            return 1; } }
                                    if ( features[2] > 0.00021 )  {
                                        if ( features[5] <= 0.00024 )  {
                                            return 0; }
                                        if ( features[5] > 0.00024 )  {
                                            return 1; } } } } } } } }
            if ( features[3] > 0.000605 )  {
                if ( features[11] <= 0.000195 )  {
                    return 2; }
                if ( features[11] > 0.000195 )  {
                    return 0; } } } }
    if ( features[11] > 0.000385 )  {
        if ( features[11] <= 0.00049 )  {
            if ( features[3] <= 0.000155 )  {
                if ( features[8] <= 0.00036 )  {
                    return 0; }
                if ( features[8] > 0.00036 )  {
                    return 1; } }
            if ( features[3] > 0.000155 )  {
                if ( features[11] <= 0.00041 )  {
                    if ( features[5] <= 0.00047 )  {
                        return 0; }
                    if ( features[5] > 0.00047 )  {
                        return 1; } }
                if ( features[11] > 0.00041 )  {
                    return 1; } } }
        if ( features[11] > 0.00049 )  {
            if ( features[4] <= -0.00022 )  {
                return 1; }
            if ( features[4] > -0.00022 )  {
                if ( features[2] <= 0.000345 )  {
                    return 0; }
                if ( features[2] > 0.000345 )  {
                    if ( features[7] <= 0.00061 )  {
                        return 1; }
                    if ( features[7] > 0.00061 )  {
                        return 0; } } } } }


 return 3; }
 

检查树的工作方式是否相同。

关于mql。

2020.07.11 23:17:15.120 code check (EURUSD,M5)  Result 2.0
2020.07.11 23:17:15.121 code check (EURUSD,M5)   0.00000  0.00030  0.00031  0.00019  0.00005 -0.00009 -0.00014 -0.00014 -0.00008 -0.00025 -0.00014 -0.00038

在python中。

lll = [0.00000,  0.00030,  0.00031,  0.00019,  0.00005, -0.00009, -0.00014, -0.00014, -0.00008, -0.00025, -0.00014, -0.00038]
lll = np.array(lll).reshape(1,-1)
clf.predict(lll)

>>> clf.predict(lll)
array([2])
 
Renat Akhtyamov:

我想我已经明白了,你不能在离线情况下做....。

公文包是一个真正的作品....

它在离线时表现良好。 我已经测试过了。

我的头上有一件毛皮大衣。

有一个错误。

罗曼,寻找你的错误,它在历史上应该可以正常工作

;)

蒸汽的, 7年前

每天最多可进行10次预测试

接下来的内容........

 
@Maxim Dmitrievsky 还需要解析器吗?
附加的文件:
parser.zip  2 kb
 
Renat Akhtyamov:

离线生活就很好,我已经测试过了。

它使我的外套变色。

有一个愚蠢的错误。

罗曼,在自己身上找一个错误,在故事上应该可以正常工作。

;)

蒸汽的, 7年前

每天最多可进行10次预测试

接下来的内容........

所以我没有说它在历史上不起作用:))
我说我没有为历史完成它,所以我暂时推迟了开发。
因此,准备历史数据是重要步骤之一。
而所有模型的建立和测试都考虑到了历史。
这就是统计学 ))
对你来说,一切都很顺利。

 
纳尼克斯
@Maxim Dmitrievsky 还需要解析器吗?

谢谢,括号内仍有遗漏,例如这里

if(L_55_1  >  0.00047) {
    if(L_30_1  <= 0.00044)
        { return 2;}
    if(L_30_1  >  0.00044) {
        if(L_25_1  <= 0.00047) {
            if(L_5_1  <= 0.00012)
                { return 0;}
            if(L_5_1  >  0.00012)
                { return 2;} }
        if(L_25_1  >  0.00047) return 2; } }

红色--应该是这样的。

我的都是这样做的。否则,条件将不能正确工作,树将计算错误的

 
Maxim Dmitrievsky:

谢谢,括号还是没有,例如这里

红色的是它们应该有的样子。

我家的都是这样做的。否则,条件将不正确地工作,树的计数将是错误的

从你的代码中,我大致开始了解了树木的工作原理。与多项式相比,算法很弱,我认为....
 
Mihail Marchukajtes:
从你的代码中,我已经大致开始了解树的工作原理。与多项式相比,算法很弱,所以在我看来....

不要胡说八道。