Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1037

 
Artyom Trishkin:

Check. PLOT_SHOW_DATA

Thank you very much!

 
Can you suggest an analogue for MQL5 of SetIndexDrawBegin() function from MQL4.
 
The_Sheikh:
Please suggest an analog for MQL5 function SetIndexDrawBegin() from MQL4.

https://www.mql5.com/ru/articles/81

void SetIndexDrawBegin(int index,
                       int begin)
bool PlotIndexSetInteger(index,PLOT_DRAW_BEGIN,begin)
SetIndexDrawBegin
Set the serial number of the bar from the beginning of the data, from which the drawing of the indicated indicator line should start.
PlotIndexSetInteger
Переход с MQL4 на MQL5
Переход с MQL4 на MQL5
  • www.mql5.com
Данная статья, построенная в форме справочника по функциям MQL4, призвана помочь переходу с MQL4 на MQL5. Для каждой функции языка MQL4 приведено описание и представлен способ ее реализации на MQL5, что позволит вам значительно ускорить перевод своих программ с MQL4 на MQL5. Для удобства функции разбиты на группы, как в документации по MQL4.
 
Is it possible to disable strategy tester logs in MT5? I don't have any spare Print, but I have 20Gb overnight, VPS is jammed. I have strategy running on 7 pairs and up to 10 trades a day on each...
 
Evgeny Dyuka:
Is it possible to disable strategy tester logs in MT5? I don't have any spare Print, but I have 20Gb overnight, VPS is jammed. I have strategy running on 7 pairs and up to 10 trades a day on each...

Is there a multi-currency EA running on VPS? For what period was the test set? Or are there 7 testers running?

 
Alexey Viktorov:

Is there a multi-currency EA running on the VPS? For what period is the test delivered? Or are there 7 testers running?

One multicurrency EA running on 7 pairs, 70-80 trades per day, put it for one year, after 5 hours of test the log was over 20GB, VDS died. The problem with logs is constant, sometimes bot plumed depo doesn't stop the test, but keeps showing depo load 150% and if I don't stop it, it keeps on writing logs till VDS hangs. I solved this problem programmatically - when "Sedstva" is less than 10% of the starting depo, the tester stops, but it's a crutch. But I don't know what to do with multicurrency one.

 

Changing the data type breaks the normalisation:


      V=NormalizeDouble(size,2);
      closePrice=NormalizeDouble(partPrice,_Digits);

      Print("V = ",V, "","  closePrice = ",closePrice);
      Print("V = ",DoubleToString(V), "","  closePrice = ",DoubleToString(closePrice));


2019.05.05 20:04:29.483 _part_close (EURUSD,D1) V = 0.01 closePrice = 1.13456

2019.05.05 20:04:29.483 _part_close (EURUSD,D1) V = 0.01000000 closePrice = 1.13456000


Is this normal?

 
psyman:

Changing the data type breaks the normalisation:

Is this normal?

There are no type conversions in your code, you just used the functionhttps://www.mql5.com/ru/docs/convert/doubletostring.

with the default parameter, so you got 8 characters in Print()

Документация по MQL5: Преобразование данных / DoubleToString
Документация по MQL5: Преобразование данных / DoubleToString
  • www.mql5.com
[in]  Формат точности. Если значение digits лежит в диапазоне от 0 до 16, то будет получено строковое представление числа с указанным количество знаков после запятой. Если значение digits лежит в диапазоне от -1 до -16, то...
 

Hello!

I can't figure out what the error is. I need to get all ticks for the current candle.

When checking, the size of the array of ticks does not change, and is not equal to the current number of ticks of the candle.

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[])
  {
   ArraySetAsSeries(time,true);
   _R=__TIK__(time,0);
   return(rates_total);
  }
//+------------------------------------------------------------------+
bool __TIK__(const datetime &time[],int _i)
  {
   MqlTick tick_array[];   // массив для приема тиков 
   MqlTick lasttick;       // для получения данных последнего тика 

   ulong    from_msc=time[_i]*1000;  
   ulong    to_msc=time[_i+1]*1000;              

   CopyTicksRange(Symbol(),tick_array,COPY_TICKS_ALL,from_msc,to_msc);
   int __ArraySize=ArraySize(tick_array);
   Print((string)__ArraySize+"  "+(string)time[_i]+"  "+(string)time[_i+1]);


   return ( false );
  }
 

How do I change the colour of an order line or an open position?

Right now they are all the same green, which causes confusion, and I can't find them by brute force

   int obj_total=ObjectsTotal(0,0,-1);
   string name;
   for(int i=0;i<obj_total;i++)
    {
     name = ObjectName(0,i,-1,-1);
     Print(i," - объект ",name);
    }

Only the objects that have been created by the user are available.

Reason: