初学者的问题 MQL5 MT5 MetaTrader 5 - 页 1280

 
Tango_X:
你好!当你在市场上购买程序时,激活数是什么意思?我可以同时在不同的电脑和不同的账户上使用这个程序吗?问题是,我们想为两个人购买一个程序,并分别使用它们。

最好是向自由职业者订购 - 程序的类型,它将是你的开放源代码。

 
Fergert Фергерт:
请告诉我如何检查某一类型的订单(在这种情况下是ORDER_TYPE_BUY_LIMIT)或神奇的数字是否存在,如果它被关闭,EA将继续其工作。我将非常感激...

Min Max for N Bars Martingale 2 代码中计算四种挂单的例子

//--- вызов функции
   int count_buy_limits=0,count_sell_limits=0,count_buy_stops=0,count_sell_stops=0;
   CalculateAllPendingOrders(count_buy_limits,count_sell_limits,count_buy_stops,count_sell_stops);
//--- сама функция
//+------------------------------------------------------------------+
//| Calculate all pending orders                                     |
//+------------------------------------------------------------------+
void CalculateAllPendingOrders(int &count_buy_limits,int &count_sell_limits,int &count_buy_stops,int &count_sell_stops)
  {
   count_buy_limits  = 0;
   count_sell_limits = 0;
   count_buy_stops   = 0;
   count_sell_stops  = 0;
   for(int i=OrdersTotal()-1; i>=0; i--) // returns the number of current orders
      if(m_order.SelectByIndex(i))     // selects the pending order by index for further access to its properties
         if(m_order.Symbol()==m_symbol.Name() && m_order.Magic()==InpMagic)
           {
            if(m_order.OrderType()==ORDER_TYPE_BUY_LIMIT)
               count_buy_limits++;
            else
               if(m_order.OrderType()==ORDER_TYPE_SELL_LIMIT)
                  count_sell_limits++;
               else
                  if(m_order.OrderType()==ORDER_TYPE_BUY_STOP)
                     count_buy_stops++;
                  else
                     if(m_order.OrderType()==ORDER_TYPE_SELL_STOP)
                        count_sell_stops++;
           }
  }

Min Max for N Bars Martingale 2
Min Max for N Bars Martingale 2
  • www.mql5.com
Поиск Минимальных и Максимальных цен на заданном количестве баров. Выставление отложенных ордеров
 

下午好。

我想在时间过后关闭一个头寸,我这样做了,但没有效果。

if((TimeCurrent()-m_position.Time())>Time*3600)  {CloseOrders=true; ClosePositions(POSITION_TYPE_BUY); break;} //  если прошло много времени, закрываем !!!
               
 
Roman Kutemov:

下午好。

我想在时间过后平仓,我是这样做的,但由于某些原因,它没有发挥作用

谁是"ClosePositions"?

那么你如何选择职位呢?

 
Vladimir Karputov:

谁是"ClosePositions"?

那么你如何选择职位呢?

//| Close positions       по типу                                    |
//+------------------------------------------------------------------+
void ClosePositions(const ENUM_POSITION_TYPE pos_type)
  {
   for(int i=PositionsTotal()-1;i>=0;i--) // returns the number of current positions
      if(m_position.SelectByIndex(i))     // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==InpMagic)
            if(m_position.PositionType()==pos_type) // gets the position type
               m_trade.PositionClose(m_position.Ticket()); // close a position by the specified symbol
  }
 for(int i=PositionsTotal()-1;i>=0;i--)
      if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==InpMagic)
           {
            if(m_position.PositionType()==POSITION_TYPE_BUY)
              {
 
Roman Kutemov:

谁是"时间"?在发布命令前设置一个断点。检查一下你到底有没有碰到断点?

(是的:不要在一行中写多个语句)

 
Vladimir Karputov:

谁是"时间"?在发布命令前设置一个断点。检查一下你到底有没有碰到断点?

(是的:不要在一行中写多个语句)

时间 - 在外部设置中,时间以小时为单位。例如,在开仓7小时后,如果还没有在止损点或止盈点平仓,我想平仓。
 
Roman Kutemov:
时间 - 在外部设置中,时间以小时为单位。例如,在开仓7小时后,如果它没有在止损点平仓,我想平仓。

关于交易、自动交易系统和策略测试的论坛

初学者的常见问题 MQL5 MT5 MetaTrader 5

Vladimir Karputov, 2021.01.27 17:49

*** 在你发布命令之前,先放置一个断点。你有没有检查过你是否碰到了断点?

(是的:不要在一行中写多个运算符)


 
Vladimir Karputov:

是的,你没有。

纠正了。谢谢你。

 
Pythoon提供了什么R无法提供的东西?