Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1375

 
int symbols=0;

and there is no need for a comma after Manual

 

Good afternoon.

When the script runs, it writes toFILE_BIN. While debugging, I want to check what is written to it.

What program can I use to open such a file?

 
sable57fx #:

What software can be used to open such a file?

Make a script that reads this file and writes in the terminal logs
 
Aleksei Stepanenko #:
Make a script which reads this file and writes to the terminal logs
This will certainly be done, but the purpose is to visually verify that the recording is correct.
 
sable57fx #:

A separate script will help you see what is in the bin. Second option: write a csv file in parallel, especially for viewing.

 
sable57fx #:

Good afternoon.

When the script runs, it writes toFILE_BIN. While debugging, I want to check what is written to it.

What program can I use to open such a file?

Before you write to the file, put what you want to write to a variable and place it in the observation. The step-by-step execution will allow you to see what will be written...

 
Thank you. I will.
 
Aleksei Stepanenko #:

and there is no need for a comma after Manual

Thank you

 

Geez, I can't figure it out.


In general, my task is as follows.

Calculate the price (H+L)/2 with conditions that the price array will grow according to the appearance of new bars

- Considering that the chart is limited to 3000 bars

   int start= this.m_rt - this.m_pc;//this.m_rt;
   datetime arr_time[];
   double arr_high[],arr_low[];
//--- устанавливает новый размер в первом измерении массива
   ArrayResize(this.m_pr_hl2,this.m_rt);
   ArrayResize(this.m_tim_pr_hl2,this.m_rt);
   ArrayResize(this.m_high,this.m_rt);
   ArrayResize(this.m_low,this.m_rt);
//--- функция получает в массив
   CopyTime(this.m_symbol, this.m_timeframe, this.m_rt-start, start, arr_time);
   CopyHigh(this.m_symbol, this.m_timeframe, this.m_rt-start, start, arr_high);
   CopyLow(this.m_symbol, this.m_timeframe, this.m_rt-start, start, arr_low);
//--- цена для расчета средних
// start= start>ArraySize(arr_high) ? ArraySize(arr_high) : start;
   for(int b= this.m_rt-start; b < this.m_rt; b++)
      this.m_pr_hl2[b]= (arr_high[b] + arr_low[b]) / 2;
//--- производит копирование одного массива в другой.
   ArrayCopy(this.m_tim_pr_hl2, arr_time, this.m_rt-start, this.m_rt-start);
   ArrayCopy(this.m_high, arr_high, this.m_rt-start, this.m_rt-start);
   ArrayCopy(this.m_low, arr_low, this.m_rt-start, this.m_rt-start);

Four days of spinning and it's not working!!! HELP

 
Mikhail Toptunov #:

Geez, I can't figure it out.


In general, my task is as follows.

Calculate the price (H+L)/2 with conditions that the price array will grow according to the appearance of new bars

- Considering that the chart is limited to 3000 bars

Four days of spinning and it's not working!!! HELP

SBI seems to get it done.

void CNewBar::PriceHL2()
  {
   int start= this.m_rt - this.m_pc;//this.m_rt;
   datetime arr_time[];
   double arr_high[],arr_low[];
//--- устанавливает новый размер в первом измерении массива
   ArrayResize(this.m_pr_hl2,this.m_rt);
   ArrayResize(this.m_tim_pr_hl2,this.m_rt);
   ArrayResize(this.m_high,this.m_rt);
   ArrayResize(this.m_low,this.m_rt);
//--- флаг элементов массива будет производиться как в таймсериях.
   ArraySetAsSeries(arr_time,true);
   ArraySetAsSeries(arr_high,true);
   ArraySetAsSeries(arr_low,true);
//--- функция получает в массив
   CopyTime(this.m_symbol, this.m_timeframe, 0, start, arr_time);
   CopyHigh(this.m_symbol, this.m_timeframe, 0, start, arr_high);
   CopyLow(this.m_symbol, this.m_timeframe, 0, start, arr_low);
//--- цена для расчета средних
   for(int b= 1; b < start; b++)
      this.m_pr_hl2[this.m_rt-b]= (arr_high[b] + arr_low[b]) / 2;
//--- производит копирование одного массива в другой.
   ArrayCopy(this.m_tim_pr_hl2, arr_time, this.m_rt-start, 0, start);
   ArrayCopy(this.m_high, arr_high, this.m_rt-start, 0, start);
   ArrayCopy(this.m_low, arr_low, this.m_rt-start, 0, start);
  }
Reason: