Errors, bugs, questions - page 2906

 
The site search doesn't work for a second day.
 

Stops and takes do not work when testing. On the screenshot an example of a triggered Sell Limit with set SL and TP, but the stop (and take) does not trigger wherever the price went. Where to dig?

Files:
Screenshot_1.jpg  177 kb
 

For positions, there is the POSITION_TIME_UPDATE property - the time of the last position change.

There is no such property for orders in the terminal. But there is one on the server?


Do I understand correctly that the modification of a Limit order on an exchange is a reissue of the Limit order: delete the old one and set a new one?

If so, then modification should change ORDER_TIME_SETUP. However, this is not happening.

 

Indicator charts disappearing

Quite often, after a few hours of work, the indicator charts disappear.

To restore the data and minimize the calculation of the indicator, I use the stages of data loading and calculation.

When I install the indicator on the chart all of the stages work normally.

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnCalculate (const int rates_total,  
                 const int prev_calculated, 
                 const datetime& time[], 
                 const double& open[], 
                 const double& high[], 
                 const double& low[], 
                 const double& close[], 
                 const long& tick_volume[], 
                 const long& volume[],
                 const int& spread[]  
)
{
  if(prev_calculated == 0)
  {
    switch (mar_data.stage)
    {
      case LOAD_TICKS:
        if(LoadTicks(time) == true)
        {
          //--- 
          mar_data.stage = READ_PRIM_TICKS;
        }
        return(0);
      break;
      case READ_PRIM_TICKS:
        if(ReadPrimTicks() == true)
        {
          //---
          mar_data.stage = READ_SEC_TICKS;
        }  
        return(0);
      break;
      case READ_SEC_TICKS:
        if(ReadSecTicks() == true)
        {
          //---
          mar_data.stage = FILL_DATA;
        }  
        return(0);
      break;
      case FILL_DATA:
        //---
        FillData();
        mar_data.stage = LOAD_TICKS;
      break;
    }
  } 
  else
  {
    //--- Live data ---
  }
  return(rates_total);
}

In the last stage the first stage is assigned, so the indicator (when it's key) can reload the data

mar_data.stage = LOAD_TICKS;

But, when the indicator is reset, the data will not be restored

The function

//+------------------------------------------------------------------+
//| Custom indicator Load ticks function                             |
//+------------------------------------------------------------------+
bool LoadTicks(const datetime &a_times[])
{
  int result = CopyTime(Symbol(), PERIOD_M1, start_time, end_time, mar_data.time_array);
  if(result > 0)
  {
    if(mar_data.time_array[result - 1] == a_times[ArraySize(a_times) - 1])
    {
      mar_data.b_cnt = result;
      result = CopyTicksRange(Symbol(), mar_data.pr_ticks, COPY_TICKS_INFO, ulong(start_time) * 1000, ulong(end_time) * 1000);
      if(result > 0)
      {
        if(mar_data.pr_ticks[result-1].time >= mar_data.time_array[ArraySize(mar_data.time_array) - 1]) 
        {
          mar_data.pr_cnt = result;
          datetime sec_time_array[];
          result = CopyTime(sec_symbol, PERIOD_M1, start_time, end_time, sec_time_array);
          if(result > 0)
          {
            result = CopyTicksRange(sec_symbol, mar_data.sec_ticks, COPY_TICKS_INFO, ulong(start_time) * 1000, ulong(end_time) * 1000);
            if(result > 0)
            {
              if(mar_data.sec_ticks[result-1].time >= sec_time_array[ArraySize(sec_time_array) - 1])
              {
                mar_data.sec_cnt = result;
                return(true);
              } else Print("Не хватает тиков ", sec_symbol, "!");
            } else Print("Не получены тики по символу ", sec_symbol, "!");
          } else Print("Не скопировано время баров по символу ", sec_symbol, "!");
        } else Print("Не хватает тиков ", Symbol(), "!"); 
      } else Print("Не получены тики по символу ", Symbol(), "!");
    } else Print("Не хватает баров по символу ", Symbol(), "!");
  } else Print("Не скопировано время баров по символу ", Symbol(), "!");
  return(false);
}

Outputs only this

"The BR-1.21 bar time was not copied!".

But nothing happens further.

Because there is a call of LoadTicks(), therefore all steps must be repeated, like when loading the indicator.

Dear developers, why does the indicator stop working?

Документация по MQL5: Программы MQL5 / Выполнение программ
Документация по MQL5: Программы MQL5 / Выполнение программ
  • www.mql5.com
Каждый скрипт, сервис и эксперт работает в собственном отдельном потоке. Все индикаторы, рассчитываемые на одном символе, даже если они запущены на разных графиках, работают в одном потоке. Таким образом, все индикаторы на одном символе делят между собой ресурсы одного потока. В одном потоке с индикаторами также последовательно выполняются...
 
fxsaber:
It's the second day that the site search doesn't work.

The search base has narrowed a lot. A lot of things are not being found.

 
How do I know when the position/order was last modified?
 
fxsaber:
How do I know when I last modified my position/order?

POSITION_TIME_UPDATE

 
Igor_Gagarin:

POSITION_TIME_UPDATE

This is the time of the last volume change. Echo Netting.

 
fxsaber:

This is the time of the last volume change. Echoes Netting.

The opening time of the position is giving out. What were you asking about?

Reason: