任何菜鸟问题,为了不给论坛添乱。专业人士,不要路过。没有你就无处可去 - 6. - 页 380

 
Integer:


没有。

这是个好办法。


对了!谢谢你!;)
 
Integer:

将光标移到OrderSend后面的第一个开口括号,删除这个括号,重新输入,这时会出现一个参数类型的工具提示,检查所有参数是否是同一类型。 。

非常感谢,我没有把订单 的到期日放进去,现在可以了!
 
Integer:
测量了正向和反向循环的速度。100个订单,反向循环的速度是5倍。但从来没有这么多的订单,最多只有10个。如果有10个订单,速度会快3倍。选择逆向循环是可想而知的。

循环是在一个勾中执行还是在几个勾中执行?
 
Example2:

循环是在一个滴答中执行还是在几个滴答中执行?

我不明白。它只是执行,仅此而已,蜱虫与它完全没有关系。
 
//|+-------------------------------------------------------------------------------------------------------+
//|Inputs                                                                                                  |
//|+-------------------------------------------------------------------------------------------------------+
extern double Lots_Typ = 0.1;
extern double TP_Typ = 100;
extern double SL_Typ = 100;
extern double Timeframe = 0; 
//|+-------------------------------------------------------------------------------------------------------+
extern double _N_  = 1;
//|+-------------------------------------------------------------------------------------------------------+
extern double Line_6  = 2.5;
extern double Line_7  = 3;
extern double Line_8  = 3.5;
extern double Line_9  = 4;
extern double Line_10 = 4.5;
extern double Line_11 = 5;
//|+-------------------------------------------------------------------------------------------------------+
extern double RSI_Type_Line_1 = 0;
extern double RSI_Period_Line_1_1 = 5;
extern double ADX_Type_Price_1 = 0;
extern double ADX_Period_Line_1 = 5;
extern double RVI_Period_Line_1 = 5;
extern double Stohastic_MA_Metod_1 = 0;
extern double Stochastic_Period_Line_A_1 = 10;
extern double Stochastic_Period_Line_B_1 = 6;
//|+-------------------------------------------------------------------------------------------------------+
extern double RSI_Type_Line_2 = 0;
extern double RSI_Period_Line_1_2 = 10;
extern double ADX_Type_Price_2 = 0;
extern double ADX_Period_Line_2 = 10;
extern double RVI_Period_Line_2 = 10;
extern double Stohastic_MA_Metod_2 = 0;
extern double Stochastic_Period_Line_A_2 = 10;
extern double Stochastic_Period_Line_B_2 = 6;
//|+-------------------------------------------------------------------------------------------------------+
extern double RSI_Type_Line_3 = 0;
extern double RSI_Period_Line_1_3 = 20;
extern double ADX_Type_Price_3 = 0;
extern double ADX_Period_Line_3 = 20;
extern double RVI_Period_Line_3 = 20;
extern double Stohastic_MA_Metod_3 = 0;
extern double Stochastic_Period_Line_A_3 = 10;
extern double Stochastic_Period_Line_B_3 = 6;
//|+-------------------------------------------------------------------------------------------------------+
//|Declaration                                                                                             |
//|+-------------------------------------------------------------------------------------------------------+
double Line_1_A; double Line_2_A; double Line_3_A;
double Line_1_B; double Line_2_B; double Line_3_B;
double Line_1_C; double Line_2_C; double Line_3_C;
double Line_1_D; double Line_2_D; double Line_3_D;
double Line_1_I; double Line_2_I; double Line_3_I;
double Line_1_F; double Line_2_F; double Line_3_F;
double Line_1_K; double Line_2_K; double Line_3_K;
double Line_1_L; double Line_2_L; double Line_3_L;
double Line_1_M; double Line_2_M; double Line_3_M;
//|+-------------------------------------------------------------------------------------------------------+
double Lines_1; 
double Lines_2;
double Lines_3;
//|+-------------------------------------------------------------------------------------------------------+
double price;
//|+-------------------------------------------------------------------------------------------------------+
//|+-------------------------------------------------------------------------------------------------------+
//|Start                                                                                                   |
//|+-------------------------------------------------------------------------------------------------------+
//|+-------------------------------------------------------------------------------------------------------+
//|Level 1                                                                                                 |
//|+-------------------------------------------------------------------------------------------------------+
int start() 
{ 
    //|+---------------------------------------------------------------------------------------------------+
    //|Level 2                                                                                             |
    //|+---------------------------------------------------------------------------------------------------+
    price = Bid;
    //|+---------------------------------------------------------------------------------------------------+
    Line_1_A = iRSI(Symbol(),Timeframe,RSI_Period_Line_1_1,RSI_Type_Line_1,0);
    Line_1_M = iRSI(Symbol(),Timeframe,RSI_Period_Line_1_2,RSI_Type_Line_1,0);
    Line_1_L = iRSI(Symbol(),Timeframe,RSI_Period_Line_1_3,RSI_Type_Line_1,0);
    Line_1_B = iStochastic(Symbol(),Timeframe,Stochastic_Period_Line_A_1,Stochastic_Period_Line_B_1,Stochastic_Period_Line_B_1,Stohastic_MA_Metod_1,0,0,0);
    Line_1_K = iStochastic(Symbol(),Timeframe,Stochastic_Period_Line_A_1,Stochastic_Period_Line_B_1,Stochastic_Period_Line_B_1,Stohastic_MA_Metod_1,0,1,0);
    Line_1_C = iADX(Symbol(),Timeframe,ADX_Period_Line_1,ADX_Type_Price_1,0,0);
    Line_1_D = iADX(Symbol(),Timeframe,ADX_Period_Line_1,ADX_Type_Price_1,1,0);
    Line_1_I = iADX(Symbol(),Timeframe,ADX_Period_Line_1,ADX_Type_Price_1,2,0);
    Line_1_F = iRVI(Symbol(),Timeframe,RVI_Period_Line_1,ADX_Type_Price_1,0);
    //|+---------------------------------------------------------------------------------------------------+
    Line_2_A = iRSI(Symbol(),Timeframe,RSI_Period_Line_1_1,RSI_Type_Line_2,0);
    Line_2_M = iRSI(Symbol(),Timeframe,RSI_Period_Line_1_2,RSI_Type_Line_2,0);
    Line_2_L = iRSI(Symbol(),Timeframe,RSI_Period_Line_1_3,RSI_Type_Line_2,0);
    Line_2_B = iStochastic(Symbol(),Timeframe,Stochastic_Period_Line_A_2,Stochastic_Period_Line_B_2,Stochastic_Period_Line_B_2,Stohastic_MA_Metod_2,0,0,0);
    Line_2_K = iStochastic(Symbol(),Timeframe,Stochastic_Period_Line_A_2,Stochastic_Period_Line_B_2,Stochastic_Period_Line_B_2,Stohastic_MA_Metod_2,0,1,0);
    Line_2_C = iADX(Symbol(),Timeframe,ADX_Period_Line_2,ADX_Type_Price_2,0,0);
    Line_2_D = iADX(Symbol(),Timeframe,ADX_Period_Line_2,ADX_Type_Price_2,1,0);
    Line_2_I = iADX(Symbol(),Timeframe,ADX_Period_Line_2,ADX_Type_Price_2,2,0);
    Line_2_F = iRVI(Symbol(),Timeframe,RVI_Period_Line_2,ADX_Type_Price_2,0);
    //|+---------------------------------------------------------------------------------------------------+
    Line_3_A = iRSI(Symbol(),Timeframe,RSI_Period_Line_1_1,RSI_Type_Line_3,0);
    Line_3_M = iRSI(Symbol(),Timeframe,RSI_Period_Line_1_2,RSI_Type_Line_3,0);
    Line_3_L = iRSI(Symbol(),Timeframe,RSI_Period_Line_1_3,RSI_Type_Line_3,0);
    Line_3_B = iStochastic(Symbol(),Timeframe,Stochastic_Period_Line_A_3,Stochastic_Period_Line_B_3,Stochastic_Period_Line_B_3,Stohastic_MA_Metod_3,0,0,0);
    Line_3_K = iStochastic(Symbol(),Timeframe,Stochastic_Period_Line_A_3,Stochastic_Period_Line_B_3,Stochastic_Period_Line_B_3,Stohastic_MA_Metod_3,0,1,0);
    Line_3_C = iADX(Symbol(),Timeframe,ADX_Period_Line_3,ADX_Type_Price_3,0,0);
    Line_3_D = iADX(Symbol(),Timeframe,ADX_Period_Line_3,ADX_Type_Price_3,1,0);
    Line_3_I = iADX(Symbol(),Timeframe,ADX_Period_Line_3,ADX_Type_Price_3,2,0);
    Line_3_F = iRVI(Symbol(),Timeframe,RVI_Period_Line_3,ADX_Type_Price_3,0);
        //|+-----------------------------------------------------------------------------------------------+
        //|Level 3                                                                                         |
        //|+-----------------------------------------------------------------------------------------------+
        Lines_1 = price * (_N_ * (((Line_1_B + Line_1_F) / Line_1_K) - ((Line_1_D + Line_1_I) / Line_1_C) + ((Line_1_A + Line_1_M) / Line_1_L)));
        //|+-----------------------------------------------------------------------------------------------+
        Lines_2 = price * (_N_ * (((Line_2_B + Line_2_F) / Line_2_K) - ((Line_2_D + Line_2_I) / Line_2_C) + ((Line_2_A + Line_2_M) / Line_2_L)));
        //|+-----------------------------------------------------------------------------------------------+
        Lines_3 = price * (_N_ * (((Line_3_B + Line_3_F) / Line_3_K) - ((Line_3_D + Line_3_I) / Line_3_C) + ((Line_3_A + Line_3_M) / Line_3_L)));
            //|+-------------------------------------------------------------------------------------------+
            //|Level 4 Auto_Sistem_1                                                                       |
            //|+-------------------------------------------------------------------------------------------+  

            if(Line_7 > Lines_1 && Lines_1 > Line_6)
            {
            Alert("Сигнал на покупку (2.5 , 3)");
            OrderSend(Symbol(),OP_BUY,Lots_Typ,Ask,5,SL_Typ,TP_Typ);
            }
            return;}}
这是我截然不同的悲痛专家。:)
不做交易。
我搞不清楚原因。
请给予帮助。
 

在关闭几个未平仓的头寸时,测试器不断出现错误138(要求的价格已过期)。此外,一个仓位正常关闭,而后来打开的仓位却没有关闭,出现错误138。也许开发者可以回答,根据历史数据,价格怎么会过时,或者是否有一些其他参数被用于识别这种错误的算法?如果我们将OrderClose放入无限循环中,并在其中恒定引用RefreshRates,那么无论如何,该位置不会关闭,并显示错误138。当然,循环并没有被终止,尽管我们已经设置了平仓 时退出。

我的模拟账户是在Alpari开的。我没有另外加载历史记录,但有很多错误,比如:2013.12.29 16:27:09 TestGenerator: unmatched data error (volume limit 10340 at 2013.08.23 12:00 exceeded),等等。

有谁能建议在这种情况下该怎么做?那么这个不能在几个4小时的蜡烛内平仓的测试器是什么呢?

 
Link_x:
这是我截然不同的悲痛专家。:)不做交易。 我搞不清楚原因。 请给予帮助。



在视觉模式下测试。使用Comment() 来输出Line_7, Lines_1, Line_6。看看它们是如何变化的,这些条件是否能够得到满足。
 
Example2:

for (int i = 0; i < OrdersTotal(); i++){
如果(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == true){
利润=利润+订单利润()+订单佣金()+订单交换()。
}

}

只有 "Profit "需要被声明为一个分量级的变量。如果我们为买入和卖出增加一个检查,我们将能够为卖出和买入订单分别计算利润。


谢谢,我知道了......但如何一次性关闭所有货币对的所有未结订单?.... - 也是用蛮力?.... - 没有其他选择?
 
Integer:
在视觉模式下测试。使用Comment()来输出Line_7, Lines_1, Line_6。看看它们是如何变化的,以及这些条件是否能够得到满足。


交易条件得到满足,但交易没有得到满足。
 
i999i:

谢谢,我明白了利润......但如何同时关闭所有符号的所有未平仓订单?....,这是相同的搜索方法吗?....,没有其他选项?


你还应该考虑到,如果有一个以上的订单,它们可能不会在一个周期内全部结束。你还应该考虑到,如果有一个以上的订单,它们可能不会在一个周期内全部关闭,在下一个tick上将不满足条件,其余的订单将保持开放。这就是为什么我们需要一个额外的全局或静态变量。如果关闭条件得到满足,我们就把这个变量设置为真。然后,在每个tick上,如果变量为真,我们就关闭循环中的所有订单;如果我们设法关闭了所有的订单,我们就将变量设为假。