Errors, bugs, questions - page 2300

 
SuhanovDM94:
Maybe MT5 has an open API and you can do this with it? Can you at least tell me which direction to dig?

Second link

 
Andrey Khatimlianskii:

Second link

by the way the server is down:

Service Unavailable.


HTTP Error 503. The service is unavailable.

 
Andrey Khatimlianskii:

Second link

Andrey, hello. Your link leads to MQL5.com search engine. I would be very grateful if you could specify what you mean.

 
SuhanovDM94:

Andrey, hello. Your link leads to MQL5.com search engine. I would be very grateful to you if you could specify what you mean.

I meant to use the search engine:


 
Nikolai Semko:

I'm asking for help from knowledgeable people to understand the issue of pointers to class instances. I do not understand it.

Here is an example of the script:

When executing it we have, as expected:


if an instance of a class is declared as:

then on execution we have:

i.e. the destructor is not even started and therefore memory is not freed.


But if an instance of a class is declared as:

the constructor is launched twice, the destructor - once, but memory is not freed and we have thePOINTER_AUTOMATIC object pointer type, although it was intended to bePOINTER_DYNAMIC


How to get the destructor to always execute and delete correctly

What a mess.

 
TheXpert All combinations are taken over by the template, so for 9 parameters you need 10 function overloads.

Thank you, fellow countryman, God give you karma pluses)

 
Andrey Khatimlianskii:

I meant to use the search engine:


This guide seems to have what you need. I'll keep digging in that direction. Thank you!

 

From a working EA, please explain what's wrong?

Tying the numbers to the tops of the ZigZag

Data output and binding to the chart (by "reference" price coordinate Low) is done as follows:

1) necessary variables are defined

extern string font_name = "Arial"; extern int font_size = 8; extern color HighColor=Orange, LowColor=PaleGreen;

int kBtT,DtT; //number of bars, current trend length and bool tvT,tnT; //current trend is ascending/descending

2) function

void ORT(int n, double Y1, string l, color c) {

string Obj = TimeToStr(Time[n], TIME_DATE|TIME_MINUTES);

ObjectCreate (Obj, OBJ_TEXT, 0, Time[n], Y1;)

ObjectSetText(Obj, l, font_size, font_name);

ObjectSet(Obj, OBJPROP_COLOR, c); }

3) after the command

if(tvT) ORT(kBtT,Low[kBtT],DtT,LowColor); else ORT(kBtT,High[kBtT]+6*_Point,DtT,HighColor);

On the chart of any currency pair with the ZigZag indicator set, its tops and bottoms are displayed with the corresponding values.

However, subsequently the values at the ZigZag LOWs remain unchanged, but at changes of the window SIZE the ZigZag TAGS begin to shift up or down a few pixels for some reason.

What is the reason and what can be done to fix this "problem"?

 
aleger:

From a working EA, please explain what's wrong?

Data output and binding to the chart (by "reference" price coordinate Low) is done as follows:

1) necessary variables are defined

extern string font_name = "Arial"; extern int font_size = 8; extern color HighColor=Orange, LowColor=PaleGreen;

int kBtT,DtT; //number of bars, current trend length and bool tvT,tnT; //current trend is ascending/descending

2) function

void ORT(int n, double Y1, string l, color c) {

string Obj = TimeToStr(Time[n], TIME_DATE|TIME_MINUTES);

ObjectCreate (Obj, OBJ_TEXT, 0, Time[n], Y1;)

ObjectSetText(Obj, l, font_size, font_name);

ObjectSet(Obj, OBJPROP_COLOR, c); }

3) after the command

if(tvT) ORT(kBtT,Low[kBtT],DtT,LowColor); else ORT(kBtT,High[kBtT]+6*_Point,DtT,HighColor);

On the chart of any currency pair with the installed indicator ZigZag WBLE, its tops and bottoms were displayed with the corresponding values.

However, subsequently the values at the ZigZag LOWs remain unchanged, but at changes of the window SIZE the ZigZag TAGS begin to shift up or down a few pixels for some reason.

What is the reason and what can be done to fix this "problem"?

For a text object positioned on High[], the anchor point (OBJPROP_ANCHOR property) should be set to ANCHOR_LOWER (anchor point at the bottom centre).

For a text object that is located on Low[], the anchor point (OBJPROP_ANCHOR property) must be set to ANCHOR_UPPER (anchor point at top centre).

Or ANCHOR_CENTER for both locations - centre anchor point.

Try it.

 
Artyom Trishkin:

For a text object located on High[], the anchor point (OBJPROP_ANCHOR property) must be set to ANCHOR_LOWER (anchor point at bottom centre).

For a text object that is located on Low[], the anchor point (OBJPROP_ANCHOR property) must be set to ANCHOR_UPPER (anchor point at the top centre).

Or ANCHOR_CENTER for both locations, the anchor point is centered.

Try.

Thank you. I'll start early in the morning (so as not to get too upset or too noisy now). Have a good night!

Reason: