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

 
Ghabo:

It's a fetish.)

There, that should work.

Or am I putting it in the wrong place?

Theoretically yes, but in practice you can't let it go outside the tester. there are no error checks.
return what you deleted, I didn't add it for nothing )

 
Ilya Prozumentov:

Here, pure code for the marker. Runs after the Bid price even if it's the same, even if it's scrolling in the chart, even if it's after switching charts. Runs behind the crosshair and remembers the offset set in this way, continuing to navigate to the Bid afterwards.

PS even i have already changed hp recently as everything is starting to fail, some sites require browser update and it can't be updated on hp anymore,

limiting RAM to 3.7gb is annoying too

xp has no support for testing owls on all CPU cores


I actually have four markers so far: bid, spread, cursor position and max, min candles under the cursor :-)

I initially wanted to do the same with flags, but there is a simpler solution (this is a piece of old code, new one is not ready yet)

   if(sparam =="16")
      {
      ObjectCreate(0, xlabel, OBJ_LABEL,0, 0, 0);
      ObjectSetInteger(0, xlabel, OBJPROP_XDISTANCE, width-120);
      ObjectSetString(0, xlabel, OBJPROP_TEXT, DoubleToString(xprice, _Digits-1));
      }
      
      //Print("Координаты щелчка мышки на графике: x = ",lparam,"  y = ",dparam, " sparam = ", sparam); 
      
   if(sparam =="0" && ymouse < 50)
       
        ObjectSetInteger(0, xlabel, OBJPROP_YDISTANCE, dparam+1);
         else
            ObjectSetInteger(0, xlabel, OBJPROP_YDISTANCE, dparam-20);
 
  
   if(sparam =="1")
      ObjectDelete(0,xlabel);

Those mark appears when I click on wheel, moves as long as spram==0 and is removed by LC.

Now I want to learn how to calculate the size of objects, tried to do it on the marker

   Print("ysize = ", ObjectGetInteger(0,objname,OBJPROP_YSIZE,0));

I get zero values for both x and y. What is it related to?

=forxp there is no support for testing owls on all CPU cores

I'm manual, so the hardware requirements are minimal, the Maxton browser is faster than FF, Chrome and others, allowing me to open sites ignoring unreadable certificates.

As soon as I'll have more free time and make some trading money, I'll move to XP :-)

 
psyman:

I get zero values for both x and y. What does this have to do with?

Maybe the marker is not on the graph yet, at the time of requesting its size.

You can drop the creation of all labels in OnInit(), you will not have to think whether they are present or not, and then you can only move them and change the text in them, disappearance can be done simply by setting coordinates outside the screen.

 
Ilya Prozumentov:

Maybe the marker is just not on the chart yet, at the time of requesting its size.

You can drop the creation of all labels into OnInit(), you won't have to think whether they are there or not, and then you can only move them and change the text in them, disappearance can be done simply by setting coordinates outside the screen.

I display dimensions at the end of the function that Taras wrote after moving the marker


   ObjectMove(0,objname,0,label_time,label_price);
   ChartRedraw();

   Print("ysize = ", ObjectGetInteger(0,objname,OBJPROP_YSIZE,0));
 

How to display the image created inside the program on the chart?

I was able to save it to a file and output it later using OBJ_BITMAP_LABEL.

ResourceCreate("Pict", src, 256, 256, 0, 0, 0, COLOR_FORMAT_ARGB_RAW);
ResourceSave("Pict", "Pic.bmp");
ObjectCreate("BMP",OBJ_BITMAP_LABEL, 0, 0, 0);
ObjectSetInteger(0, "BMP", OBJPROP_XSIZE, 256);
ObjectSetInteger(0, "BMP", OBJPROP_YSIZE, 256);
ObjectSetString(0, "BMP", OBJPROP_BMPFILE, 0, "\\Files\\Pic.bmp");
ObjectSetString(0, "BMP", OBJPROP_BMPFILE, 1, "\\Files\\Pic.bmp");

Is it possible to output the image without using a file? Can named channels help here?

 
Ilya Prozumentov:

How to display the image created inside the program on the chart?

I was able to save it to a file and output it later using OBJ_BITMAP_LABEL.

Is it possible to output the image without using a file? Can named channels help here?

 
psyman:

I get zero values for both x and y. What does this have to do with?

Help says that you can only measure:

OBJPROP_YSIZE

Height of an object on the Y axis in pixels. It is specified for objects OBJ_LABEL (read only), OBJ_BUTTON, OBJ_CHART, OBJ_BITMAP, OBJ_BITMAP_LABEL, OBJ_EDIT, OBJ_RECTANGLE_LABEL.

int

 
Artyom Trishkin:

The array has already been created and filled with data inside the running program, it only needs to be somehow transferred toOBJ_BITMAP_LABEL
We managed to do it through a file, but it takes extra time and wastes the resource of the hard disk.

 
Taras Slobodyanik:

the help says that you can only measure

OBJPROP_YSIZE

Height of an object in Y axis in pixels. Specified for OBJ_LABEL (read only), OBJ_BUTTON, OBJ_CHART, OBJ_BITMAP, OBJ_BITMAP_LABEL, OBJ_EDIT, OBJ_RECTANGLE_LABEL.

int

What did it do?(ObjectGetInteger)

 
Hello! I read an article somewhere about mql4 or 5 offering encryption of Expert Advisor codes with their service ..... Can you tell me where to read about this and what kind of service?