Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 924

 
Elena Baranova:

Unfortunately, this method doesn't work in MQL4. The PlotIndexSetInteger(0,PLOT_ARROW_SHIFT,ExtArrowShift) function is absent in MQL4, as far as I know.

I do not know how this shift can be implemented in MQL4 and I haven't found the MQL4 code either :(

Maybe you have a similar link for MQL4?


I haven't done it if it's not needed, but you may still try to shift the price into ChartTimePriceToXY pixels and shift it back to the price by adding or subtracting a few pixels of Y coordinate.

ChartTimePriceToXY - Операции с графиками - Справочник MQL4
ChartTimePriceToXY - Операции с графиками - Справочник MQL4
  • docs.mql4.com
[out]  Переменная, в которую будет получено преобразование времени в координату X. Начало координат находится в левом верхнем углу главного окна графика. [out]  Переменная...
 
Alexey Viktorov:

I didn't do it when I wasn't needed, but try converting the price into ChartTimePriceToXY pixels and adding or subtracting a few pixels from the Y coordinate to convert it back into a price.

Thanks ) I'll have to give it a try.

 
Elena Baranova:

Unfortunately, this method doesn't work in MQL4. The PlotIndexSetInteger(0,PLOT_ARROW_SHIFT,ExtArrowShift) function is absent in MQL4, as far as I know.

I do not know how this shift can be implemented in MQL4 and I haven't found the MQL4 code either :(

Maybe you have a similar link for MQL4?


It doesn't work in MQL4. I searched a couple of times in this thread and found the answer to this question - how to shift indicator's icons from the chart scale... can't find it

but search rules!

 chart_heigth_pix=(int)ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS,0);
   chart_price_min=ChartGetDouble(0,CHART_PRICE_MIN,0);
   chart_price_max=ChartGetDouble(0,CHART_PRICE_MAX,0);

   //pips in one pixel
   pips_in_pix=((chart_price_max-chart_price_min)) / chart_heigth_pix;

https://www.mql5.com/en/forum/203336#comment_5241756

 
Igor Makanu:

It doesn't work in MQL4, I searched the topic a couple of times to find the answer to this question - how to move indicator icons from the chart scale... can't find it

but search rules!

https://www.mql5.com/en/forum/203336#comment_5241756

I'm trying something similar at the moment but so far it hasn't worked.

I just need to encircle the icons of a standard Fractals indicator ) I need the circle to be at a fixed distance from max/min candle.

 
Hi all, could you please tell me how to work with string array while interacting with dll(C++)?(pass in parameters and return from function) String, numbers...all sorted out, and number array works fine too. But string array...will soon hit the table with my head(( and for future reference - is it possible to pass/return objects from dll? Have a good day everyone.
 
Вероника Сорокина:
Hi, could you please tell me how to work with an array of strings while interacting with dll (C++)? String, numbers... everything is sorted out, and an array of numbers works fine too. But string array...will soon hit the table with my head(( and for future reference - is it possible to pass/return objects from dll? Have a good day everyone.

I had the same problem, I used C# to write a dll for MT5 and failed to solve it. I tried to send one line per loop, added lines to the array in dll, and then I used an array of lines by calling another function


In general, try the author of any of the articles on writing a dll on this forum, or open a separate thread, there are coding professionals, probably right away will answer

 

Good afternoon! Need some help! I've been trying to load data from a file for a few days now. Either I get zeros or wrong values.

The data is stored in a .csv file.

Format, starting with the first line:

0.2618997595368323

0.07214522501190132

-0.2603473993323489

-0.04593721334324589

-0.2869231449596886

-0.2540028686351263

-0.2068354101477481

0.09216412872632165

0.168661965521865

-0.2002489414504531

0.2022479343848878

Example taken from https://book.mql4.com/ru/functions/files, put it into int OnInit() function:

int handle;

handle = FileOpen(FileName1, FILE_BIN|FILE_READ);

if(handle>0)

{  

   FileReadArray(handle, w, 0, ((vhodyClose+vhodyOpen+vhodyHigh+vhodyLow+vhodyVolume)*neiro));

   int size=ArraySize(w);

      //--- распечатаем данные из массива

      for(int ii2=0;ii2<size;ii2++)

        {

        Print("w = ",w[ii2]);

        }

      Print("Total data = ",size);

      //--- закрываем файл   

   FileClose(handle);

}

The output is a value greater than 1, which shouldn't be the case.

Please help me to correct the code. I need your help to fix the code.

Файловые операции - Стандартные функции - Учебник по MQL4
Файловые операции - Стандартные функции - Учебник по MQL4
  • book.mql4.com
В MQL4 предусмотрена возможность работы с файлами, содержащими некоторый набор информации. Необходимость записи информации в файл, а также считывания информации из файла может возникнуть по нескольким причинам. Файл может применяться как средство передачи данных в другую программу. В этом случае файл может быть создан прикладной программой и...
 
Mt5 code: There is an array of colour
#property indicator_color1  clrGray,clrBlue,clrRed,clrYellow,clrForestGreen,clrRosyBrown,clrSienna,clrSteelBlue,clrAqua,clrMagenta,clrBlack

If it is possible to use this array without creating a new one

 

Has anyone encountered anything like this?

2 13:54:52.558 VR   EURUSD,M15: modify #0 buy 0.00  at 0.00000 sl: 0.00000 tp: 0.00000 ok

2 13:54:55.651 VR   EURUSD,M15: modify #0 buy 0.00  at 0.00000 sl: 0.00000 tp: 0.00000 ok

Strange orders are being sent out by the broker.

 
BillionerClub:
Mt5 code: There is an array of colour

If it is possible to use this array without creating a new one

Used as a normal array. There is no need to create a new one.

Reason: