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

 
Seric29:

In general, since Artyom does not answer anything, and the man above gave the answer that functions work with structures that must be known and therefore must be declared globally, we conclude that the structure must be declared globally.

By its nature, a function that works with a structure can only accept the same static structures. It means that we cannot declare a structure locally so that it has a limited scope and pass it into a function.

Don't refer to me when you don't understand what I told. Carefully read what Artem said.

In his haste, he made some inaccuracies in the code. This does not mean that he was speaking incorrectly. A structure is a custom data type and is defined in the global scope. A variable of user type can be declared anywhere. And there can be any number of such variables declared.
 
Artyom Trishkin:
The statistics will not change from this.

By the way, it doesn't just not show me at 1 a.m. or 11 p.m., it shows me this.


The technical job.

Progress

Approval of the TOR
Demo
Transmission of work and payment


All these checkboxes are clicked. it says that in a week the payment will automatically go away. Except that only the demo file was received and there is a date restrictor sitting in it allowing work only last year. I guess he got bored and now he will wait a week for the pay file to change automatically?


It already happened.


The customer Zlaya_budka has confirmed the"Demo" step
2020.01.29 21:47

Transfer of work and payment

The Customer has accepted the Demo, now the Developer has to hand over the final result.

After acceptance of the work, payment will come automatically from the Customer's account (minus a commission). If the Customer does not reply to the submitted work within one week, the Order will automatically be deemed completed.

2020.01.29 21:47

Developer=========confirmed the step"Transfer of work and payment"


What is this supposed to mean? already had a lovely one from pipal where debit and word balance were swapped, already been waiting 3 weeks for servicedesk with payment. now this joy what does it mean?

Zlaya_budka
Zlaya_budka
  • www.mql5.com
Профиль трейдера
 
Alexey Viktorov:

Don't refer to me when you don't know what I'm talking about. Read carefully what Artem said.

In his haste, he made some inaccuracies in the code. It does not mean that he spoke incorrectly. A structure is a custom data type and is defined in the global scope. A variable of the user type can be declared anywhere. And there can be any number of such variables declared.

Well, I'm talking exactly about my case and exactly about structure, it's clear that it's also a custom variable type, but in particular I'm interested in local level. Maybe it could be done through a class. In principle, you may declare a private type through a class and that's it, but I don't understand it too well.

 
Colleagues - can you tell me if the init starts on every pass of the tester?
 
Seric29:

Well I'm talking exactly about my case and exactly about the structure and exactly like this, it's clear that it's also a custom variable type but in particular I'm interested in the local level. Maybe it could be done through a class. In principle, you may declare a private type through a class, but I don't understand it too well.

You define your structure on a global level - the entire program must know about it - it's a new type of variables that you created.

And you can define different variables with the type of this structure at any of the local levels - only in them (the local levels) will be visible the variables created in their scope.

 

Hello, everyone!

Help me attach

extern   ENUM_BASE_CORNER  InpCorner      =  CORNER_LEFT_UPPER;   // Угол привязки индикатора

to this object

//--- Clicking on the fifth rectangle
   if(id==CHARTEVENT_OBJECT_CLICK) 
     {
      string clickedChartObject=sparam;
      if(clickedChartObject==obj_name[5]) 
        {
         string name="name_"+IntegerToString(MathRand()+100,0,' ');

         y=100;x=5;
         ChartXYToTimePrice(0,x,y,window,dt_1,price_1);
         ChartXYToTimePrice(0,x+250,y,window,dt_2,price_2);
         ChartXYToTimePrice(0,x,y+20,window,dt_3,price_3);

         ChannelCreate(0,name,0,dt_1,price_1,dt_2,price_2,dt_3,price_3,1,clrRed,STYLE_SOLID,1,InpBackRect,true,false,false,InpHidden_OBJ,0);
        }
     }

bool

//+------------------------------------------------------------------+
//| Create an equidistant channel by the given coordinates           |
//+------------------------------------------------------------------+
bool ChannelCreate(const long             chart_ID=0,                   // chart's ID
                   const string           name="Channel",               // channel name
                   const int              sub_window=0,                 // subwindow index  
                   datetime               time1=0,                      // first point time
                   double                 price1=0,                     // first point price
                   datetime               time2=0,                      // second point time
                   double                 price2=0,                     // second point price
                   datetime               time3=0,                      // third point time
                   double                 price3=0,                     // third point price
                   const ENUM_BASE_CORNER corner = CORNER_RIGHT_UPPER,  // the angle of the graph for the binding
                   const color            clr=clrRed,                   // channel color
                   const ENUM_LINE_STYLE  style=STYLE_SOLID,            // style of channel lines
                   const int              width=1,                      // width of channel lines
                   const bool             back=false,                   // in the background
                   const bool             selection=true,               // highlight to move
                   const bool             ray_left = false,             // extend the line to the left
                   const bool             ray_right=false,              // channel's continuation to the right
                   const bool             hidden=true,                  // hidden in the object list
                   const long             z_order=0)                    // priority for mouse click
  {
//--- reset the error value
   ResetLastError();
//--- create a channel by the given coordinates
   if(!ObjectCreate(chart_ID,name,OBJ_CHANNEL,sub_window,time1,price1,time2,price2,time3,price3))
     {
      Print(__FUNCTION__,
            ": failed to create an equidistant channel! Error code = ",GetLastError());
      return(false);
     }
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
   ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style);
   ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width);
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_RAY_RIGHT,ray_right);
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
//--- 
   return(true);
  }
//+------------------------------------------------------------------+
//| Delete the channel                                               |
//+------------------------------------------------------------------+
bool ChannelDelete(const long   chart_ID=0,     // chart's ID
                   const string name="Channel") // channel name
  {
//--- reset the error value
   ResetLastError();
//--- delete the channel
   if(!ObjectDelete(chart_ID,name))
     {
      Print(__FUNCTION__,
            ": failed to delete the channel! Error code = ",GetLastError());
      return(false);
     }
//---
   return(true);
  }
//---
 

I understand that ChartXYToTimePrice calculates the coordinates from the top left corner by default as well.

How would ChartXYToTimePrice re-calculate from the corner I specified?

 
MakarFX:

I understand that ChartXYToTimePrice calculates the coordinates and defaults from the top left corner.

How would ChartXYToTimePrice be re-calculated from the angle I specified?

You can only change the mind of someone who has something to make decisions with. And if "it" only executes someone else's settings, then all dialogue in an attempt to convince you of something is just a waste of time.))

I don't quite understand the task, but pay attention not only to the binding angle ENUM_BASE_CORNER, but also to the binding point ENUM_ANCHOR_POINT

 

Alexey Viktorov:

I don't quite understand the task

indicator on call creates an object (OBJ_CHANNEL) in the upper left corner

how to set the condition to create an object in the other corner.

 
MakarFX:

indicator on call creates an object (OBJ_CHANNEL) in the upper left corner

how to set the condition to create an object in the other corner.

Read the manual carefully. OBJ_CHANNEL has nothing to do with the angle.

Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Способы привязки объектов
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Способы привязки объектов
  • www.mql5.com
Графические объекты Text, Label, Bitmap и Bitmap Label (OBJ_TEXT, OBJ_LABEL, OBJ_BITMAP и OBJ_BITMAP_LABEL) могут иметь один из 9 различных способов привязки своих координат, задаваемых свойством OBJPROP_ANCHOR. – объекты имеет ширину и высоту. Если указано "только для чтения", то это означает, что значения ширины и высоты...
Reason: