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

 
Alekseu Fedotov:


Pondering,

on the subject of deletion.

   long Chart_ID = ChartID();
   int i=0,limit=100;
   while(i<limit)
     {
    if(ChartNext(Chart_ID)<0) break;
      ChartClose(ChartNext(Chart_ID));
      i++;
     }


Good luck with that. You'll be thanked later by the user for having your program nailed down a chart with a working EA. Are you writing without reading what you are talking about?
 
Artyom Trishkin:
Well good luck. You'll be thanked later by the user for having your program nailed the chart with the running EA. You are writing without reading what we are talking about?


No way,

and will not delete the chart from which these lines are run,

I'm reading.

 
Alekseu Fedotov:


No problem,

and will not delete the chart from which these lines are run,

reading.

Then one more time:

Forum on trading, automated trading systems and trading strategy testing

Any questions from newbies on MQL4, help and discussion on algorithms and codes

DVlad, 2017.03.05 06:31

Hello.

I am on linux. I have several currency pairs open in MT4 - up to 10. How can I use MQL4 to arrange the chart tabs in a certain sequence?

Working with profiles, studying 1_MQL4.pdf and the Internet has not shown any results.

Regards, Vladimir


 
Good evening! I want to embed the function of the indicator to work from a certain date or for a certain period of time (a certain number of days) to the present, please tell me the code how to spell it. I want to write the code and thank you.
 
Artyom Trishkin:

Even on Windows, the tabs cannot be sorted using mql4.

You can only open the charts in the order you want and set the desired templates on them.

Thank you. Far from being the first bug in MT4, I don't think MT5 is any better.
 
Can you please tell me how to place a graphical object in the centre of the screen, but without OBJPROP_XDISTANCE pixel mapping?
 
Andrei:
Can you please tell me how to place a graphical object in the centre of the screen but without OBJPROP_XDISTANCE pixel binding ?

Objects are mapped to either screen pixels or bar time. If to screen coordinates, the object stays in place as you scroll through the graph, if to bar time, the object moves behind that bar as you scroll through the screen.

Choose one of the two.

 
Artyom Trishkin:

Objects are mapped to either screen pixels or bar time. If to screen coordinates, the object stays in place as you scroll through the graph, if to bar time, the object moves behind that bar as you scroll through the screen.

Choose one of the two.

Is it possible to calculate which pixel will be in the middle of the screen for OBJPROP_XDISTANCE?
 
Andrei:
Can I calculate which pixel will be in the middle of the screen for OBJPROP_XDISTANCE?


ChartGetInteger(ChartID(),CHART_WIDTH_IN_PIXELS)/2;

This will be the coordinate in the centre of the screen.

For an object to be exactly centered, its anchor point OBJPROP_ANCHOR must also be centered: ANCHOR_CENTER (centre of object) ANCHOR_BOTTOM (centre of bottom edge of object) ANCHOR_TOP (centre of top edge of object)

 

Friends, I've been working too hard...

Here's the question: There is an array of, say, four numbers. We need to find out the number of equal numbers in the array.

1,2,3,4 - no identical numbers
1,1,2,3 - two same numbers.
1,1,2,2 - also two identical numbers.
1,2,1,2 - there are two similar ones
1,1,1,2 - three alike
1,1,1,1,1 - four of them are the same.

It doesn't seem complicated, but I can't think of anything...

HOW?

Reason: