[警告关闭!]任何新手问题,为了不给论坛添乱。专业人士,不要走过。没有你,哪里都不能去。 - 页 848

 

我想这就是为什么

while (att_to_modify_sell<= attempt_to_modify)
 
vasya_vasya:

我想这就是原因。

谢谢,注意到后直接删除了帖子,但你还是设法回复了它 :)

我还是不喜欢我的循环模式......

任务是在市场尝试平仓N次失败后修改订单!

请告诉我如何在代码中很好地做到这一点。

谢谢你!

 
vasya_vasya:

我认为这是因为这个原因。

att_to_modify=2;
att_to_modify_sell=0;
            
Print("att_to_modify_sell="+att_to_modify_sell);
Print("Модификация SL, попытка установить новый СЛ, ord_open_sell="+ord_open_sell+" stop_TP="+stop_TP+" Старый СЛ= "+ord_sl+" Bid="+Bid+" ord_take_profit="+ord_take_profit+" Ask="+Ask);
Print("Модификация в цикле1");   
ticket=OrderModify(ticket_sell,0,NormalizeDouble((ord_open_sell-stop_TP*Point),Digits),NormalizeDouble(ord_take_profit,Digits),0,0); //первый перенос СЛ
  if(ticket<0)
  {               
    Print("OrderModify(SELLSTOP install first SL) failed with error #",GetLastError());
    att_to_modify_sell+=1;
    Sleep(3000);
    if (att_to_modify_sell>=attempt_to_modify /*&& Ask<(ord_open_sell-stop_TP*Point-p_TS_DIST*Point)*/)                     
    {
      OrderClose(ticket_sell,ord_lots,MarketInfo(Symbol(),MODE_ASK),3,Green);
    }
    if(ticket>=0)
    {
      att_to_modify_sell=attempt_to_modify+1;
      Print("Модификация прошла успешно");
    }  
    Print("att_to_modify_sell!!!="+att_to_modify_sell);           
  }

结论。

2010.09.14 16:46:04 2010.06.07 00:00 MM1.20 EURUSD,M5: OrderModify错误 130
2010.09.14 16:46:04 2010.06.07 00:00 MM_1.20 EURUSD,M5: In-Cycle1 Modification
2010.09.14 16:46:04 2010.06.07 00:00 MM_1.20 EURUSD,M5: SL修改,试图设置一个新的SL, ord_open_sell=1.19799000 stop_TP=200 旧SL=1.20499000 Bid=1.19470000 ord_take_profit=1.19479000 Ask=1.19483000
2010.09.14 16:46:04 2010.06.07 00:00 MM_1.20 EURUSD,M5: att_to_modify_sell=0


有一个错误,为什么我没有处理这个条件呢?

if(ticket<0) ?????


因此,没有显示任何印刷品......

Print("OrderModify(SELLSTOP install first SL) failed with error #",GetLastError());
Print("att_to_modify_sell!!!="+att_to_modify_sell); 


一段代码在att_to_modify的尝试后关闭了市场上的订单!

谢谢你!

 
EA是否有可能自行停用?
 
Elliotttrader:

输出。

2010.09.14 16:46:04 2010.06.07 00:00 MM1.20 EURUSD,M5: OrderModify error 130
2010.09.14 16:46:04 2010.06.07 00:00 MM_1.20 EURUSD,M5: Modification in loop1
2010.09.14 16:46:04 2010.06.07 00:00 MM_1。20 EURUSD,M5: SL修改,尝试设置新的SL, ord_open_sell=1.19799000 stop_TP=200 旧SL=1.20499000 Bid=1.19470000 ord_take_profit=1.19479000 Ask=1.19483000
2010.09.14 16:46:04 2010.06.07 00:00 MM_1.20 EURUSD,M5: att_to_modify_sell=0

有一个错误,为什么我没有处理这个条件呢?

因此没有印刷品被打印出来......

一段代码在att_to_modify的尝试后关闭了市场上的订单!

谢谢!


错误130--错误的停止。

分析函数中的第三个参数

ticket=OrderModify(ticket_sell,0,NormalizeDouble((ord_open_sell-stop_TP*Point),Digits),NormalizeDouble(ord_take_profit,Digits),0, 0);//first transfer SL

根据我的理解,这是一个卖出指令,而且止损价被降低了。

也许我们需要 "+" -ord_open_sell+stop_TP*Point

 
abolk:


错误130--错误的停止。

分析函数中的第三个参数

ticket=OrderModify(ticket_sell,0,NormalizeDouble((ord_open_sell-stop_TP*Point),Digits),NormalizeDouble(ord_take_profit,Digits),0, 0);//第一次翻身的SL

按照我的理解,这是一个卖出指令,你根据价格来设置止损。

也许我们需要 "+" -ord_open_sell+stop_TP*Point

我不是在问这个错误。我在问为什么没有被处理。
if(ticket<0)
谢谢你!
 
Elliotttrader:
我不是在问这个错误。我在问为什么它对我不起作用。
谢谢你!

首先,打印修改后的票据打印值
 
abolk:

对于初学者来说,打印修改后的票据价值


我在写一个问题,但没有改变什么,问题没有解决,所以我再重复一遍,希望能得到解决问题的方法。

我正在给自己写一个指标,我需要从历史上得到大约2000个条形图,这样一个循环。

for (int i=1; i<1900; i++)

它将只检索到1000条。

我试图设置Bars变量,但它说它的值等于1000,尽管事实上我已经绘制了图表和历史数据到2000。

为什么会发生这种情况,什么是错误的????

请告知!!!!

 
abolk:

对于初学者来说,修改后打印票面价值

简称为

               Print("Модификация SL, попытка установить новый СЛ, ord_open_sell="+ord_open_sell+" stop_TP="+stop_TP+" Старый СЛ= "+ord_sl+" Bid="+Bid+" ord_take_profit="+ord_take_profit+" Ask="+Ask);
               Print("Модификация в цикле1");             
               ticket=OrderModify(ticket_sell,0,NormalizeDouble((ord_open_sell-stop_TP*Point),Digits),NormalizeDouble(ord_take_profit,Digits),0,0); //первый перенос СЛ
               Print("ticket="+ticket);

               if(ticket<0){Print("OrderModify(SELLSTOP install first SL) failed with error #",GetLastError());}

               Print("Модификация закончена");


2010.09.14 20:35:26 2010 06.07 00:00 MM_1.20 EURUSD,M5: 修改完毕
2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: ticket=0
2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: OrderModify错误 130
2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: Loop1的修改
2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: SL修改,试图设置一个新的SL,order_open_sell=1.19799000 stop_TP=200 旧SL=1.20499000 Bid=1.19470000 order_take_profit=1.19479000 Ask=1.19483000

2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: att_to_modify_sell=0


伙计们,我遇到了一个小故障。如何在错误中

ticket
是天真的0-lu?
 
Elliotttrader:

简称为

2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: 修改完毕
2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: ticket=0
2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: OrderModify错误 130
2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: Loop1的修改
2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: SL修改,试图设置一个新的SL,order_open_sell=1.19799000 stop_TP=200 旧SL=1.20499000 Bid=1.19470000 order_take_profit=1.19479000 Ask=1.19483000

2010.09.14 20:35:26 2010.06.07 00:00 MM_1.20 EURUSD,M5: att_to_modify_sell=0

伙计们,我遇到了一个小故障。如何在错误中

是naven 0-lu?

打印 -- ticket_sell,并显示门票变量类型