Errors, bugs, questions - page 648

 
sergeev:
Is the tester being debugged?
Yes, it is unloaded.
 
MoneyJinn:

Yes, you are mistaken. Multiple ChartGetInteger record forms are allowed.

But regardless of the ChartGetInteger record form,it is not possible to get the current value of theCHART_BRING_TO_TOP property.

Without an example, it is hard to say what and how. Please check documentation and build release.

If it doesn't work the way it should, write a request to CA + code with an example.

And the second variant should return the property anyway. where there are four parameters.

 

There is a prototype function

#import "kernel32.dll"
BOOL WriteFile(
HANDLE hFile, //file descriptor
LPCVOID lpBuffer, // data buffer
DWORD nNumberOfBytesToWrite, // number of bytes to write
LPDWORD lpNumberOfBytesWritten, // number of bytes written
LPOVERLAPPED lpOverlapped // asynchronous buffer

);

The function is called in the program

op_err=WriteFile(h1,buff,LenPos, Writing,NULL);

how do I correctly specify that buff and Writing are passed by reference?

Документация по MQL5: Основы языка / Функции
Документация по MQL5: Основы языка / Функции
  • www.mql5.com
Основы языка / Функции - Документация по MQL5
 
tor30515:

There is a prototype function


How do I specify correctly that buff and Writing are passed by reference?

buff - via array e.g. uchar &buff[]

written - you can also use an array or just one variable int &written

 
Yedelkin:

According to the Handbook, this property is simply not supported:

The error code says the same thing. The question as to why the chart property CHART_BRING_TO_TOP is not supported is at developer level... And if the property is actually supported, then the question is again at their level: why in that case ChartGetInteger function returns false?

Because setting the CHART_BRING_TO_TOP property to true gives the terminal an order to bring the given chart to the foreground at the moment. This is not a property in the usual sense, but a command. That's the explanation.
 

Rosh:
Потому что установка свойства CHART_BRING_TO_TOP в значение true дает терминалу приказ вывести данный чарт на передний план в данный момент. Это не свойство в обычном понимание, а команда. Вот такое объяснение.

It means that in our case the "property" command CHART_BRING_TO_TOP with reference to ChartGetInteger() function is simply not supported and ChartGetInteger() returns false correctly. This is the answer for MoneyJinn

 
Rosh:
Because setting CHART_BRING_TO_TOP property to "true" gives the terminal an order to bring this chart to the foreground at this moment. This is not a property in its usual understanding, but a command. That's the explanation.

The developers have left no way to determine whether or not the graph window is visible to the user and what the relative position of the windows is.

This is very bad. Again loss of control and new risks.

 

I want to point out right away that I am new to programming in MQL)

The essence of the problem: I want to implement drawing of levels (horizontal lines) by redoing the standard

indicator for fractals. That is to draw horizontal lines instead of arrows.

The question is therefore: is it possible within the framework of the indicator? After all it is necessary to specify

I do not knowthe number of lines in the indicator before calculation. Is it possible in the property

#property indicator_plots to specify a variable. Or it is impossible?

Below is the code of a slightly modified fractal. It draws two lines on top and bottom fractals.

But I need horizontal lines, one line per fractal.

May be, the horizontal lines can be created in the indicator through ObjectCreate?

#property copyright "2009, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
//---- indicator settings
#property indicator_chart_window 
//Для индикаторов расположение на графике цены (indicator_chart_window)
//или в отдельном окне (indicator_separate_window)
#property indicator_buffers 2
#property indicator_plots   2
#property indicator_type1   DRAW_LINE
#property indicator_type2   DRAW_LINE
#property indicator_color1  clrDeepPink
#property indicator_color2  clrRoyalBlue
#property indicator_label1  "Resistance lvl"
#property indicator_label2  "Support lvl"
#property indicator_style1  STYLE_SOLID
#property indicator_style2  STYLE_SOLID
#property indicator_width1  2
#property indicator_width2  2
//---- indicator buffers
double ExtUpperBuffer[];
double ExtLowerBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
//---- indicator buffers mapping
   SetIndexBuffer(0,ExtUpperBuffer,INDICATOR_DATA);
   SetIndexBuffer(1,ExtLowerBuffer,INDICATOR_DATA);
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);// точность индикатора равна точности графика
//---- sets first bar from what index will be drawn
//  PlotIndexSetInteger(0,PLOT_ARROW,217);
//  PlotIndexSetInteger(1,PLOT_ARROW,218);
//---- arrow shifts when drawing
//  PlotIndexSetInteger(0,PLOT_ARROW_SHIFT,ExtArrowShift);
//  PlotIndexSetInteger(1,PLOT_ARROW_SHIFT,-ExtArrowShift);
//---- sets drawing line empty value--
//  PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,EMPTY_VALUE);
// PlotIndexSetDouble(1,PLOT_EMPTY_VALUE,EMPTY_VALUE);
//---- initialization done
  }
//+------------------------------------------------------------------+
//|  Accelerator/Decelerator Oscillator                              |
//+------------------------------------------------------------------+
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 &TickVolume[],
                const long &Volume[],
                const int &Spread[])
  {
   int i,limit;
//---
   if(rates_total<5)
      return(0);
//---
   if(prev_calculated<7)
     {
      limit=2;
      //очистка буферов
      ArrayInitialize(ExtUpperBuffer,EMPTY_VALUE);
      ArrayInitialize(ExtLowerBuffer,EMPTY_VALUE);
     }
   else limit=rates_total-5;

   for(i=limit;i<rates_total-3 && !IsStopped();i++)//(?условие нач.цикла;усл.оконч.цикла;вычисление)
                                                   //i++ тоже самое что и i=i+1
     {
      //---- Upper Fractal
      if(High[i]>High[i+1] && High[i]>High[i+2] && High[i]>=High[i-1] && High[i]>=High[i-2])
         ExtUpperBuffer[i]=High[i];
      //else ExtBuffer[i]=EMPTY_VALUE;
      else ExtUpperBuffer[i]=ExtUpperBuffer[i-1];
      //else ExtUpperBuffer[i]=ExtUpperBuffer[1];

      //---- Lower Fractal
      if(Low[i]<Low[i+1] && Low[i]<Low[i+2] && Low[i]<=Low[i-1] && Low[i]<=Low[i-2])
         ExtLowerBuffer[i]=Low[i];
      //else ExtBuffer[i]=EMPTY_VALUE;
      else ExtLowerBuffer[i]=ExtLowerBuffer[i-1];
      //else ExtLowerBuffer[i]=ExtLowerBuffer[1];
      
     // ObjectCreate(0,Level_obj,OBJ_HLINE);

     }
//--- OnCalculate done. Return new prev_calculated.
   return(rates_total);
  }

//+------------------------------------------------------------------+
Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
  • www.mql5.com
Основы языка / Препроцессор / Свойства программ (#property) - Документация по MQL5
 
question on files. what is the limit on the size of the file to be opened in µl5
Документация по MQL5: Файловые операции / FileOpen
Документация по MQL5: Файловые операции / FileOpen
  • www.mql5.com
Файловые операции / FileOpen - Документация по MQL5
 
How can I get the ACCOUNT_BALANCE value in the history? When viewing the history of transactions, you need to know the change in balance.
Reason: