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

 
Igor Makanu:

You read the wrong example.

I've read it (of course it's interesting to understand it), but again, I don't know what it's for. And you can't do this kind of ahhing with a counter here, but do you have to write such expressions?

{diff=86399; tf=0x0001|0x0002|0x0004|0x0008|0x0010|0x0020|0x0040;}
 

What does error 4024 mean as a result of ChartApplyTemplate()?

if(!ChartApplyTemplate(chart_id,TemplateName))
{
Print(__FUNCTION__+": chart apply template failed. Error: ",GetLastError());
}                          }

What is the Internal error?

And sometimes it works without error, sometimes 4024 and no template is applied. All the same - for the same template.

 

When I try to read a text file in MQL5 written from MQL4, I get a Chinese string.

Although everything is actually written in Latin characters.


The file and its output is shown on the screenshot:


Why is it so and how can it be fixed?

 
Seric29:

I've read the whole thing (it's interesting to understand it, of course), but again, I don't know what it's for. And you can't do this kind of ahhing with the counter here, but you have to write expressions like this, don't you?

Just write it that way:

{diff=86399; tf=0x007F;}

It'll be the same.

 
Sergey Likho:

When I try to read a text file in MQL5 written from MQL4, I get a Chinese string.

Although everything is actually written in Latin characters.


The file and its output is shown on the screenshot:


Why is it so and how can it be fixed?

apparently the file is written in unicode, experiment with the flags

there's even a whole article searchableat https://www.mql5.com/ru/articles/2720#z10

 
Hello! This is an off-topic question, but I don't know where to ask it in order to get a really competent answer. Google did not help. The question is: Today, the DAX30 index suddenly started trading not at 9:00 am, but at 2:15 am, why? Nowhere, including on the site of the Frankfurt Stock Exchange I have not found any explanation or warning. Maybe someone is more informed and can give me a hint where to find the information?
 

Hi @ Artyom Trishkin,

Tell me, please, how can I understand if it is a hedge account or a net account?

I know in MQL5:

bool IsHedgingAllowed()
{
  ENUM_ACCOUNT_MARGIN_MODE res = (ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE);
  return(res==ACCOUNT_MARGIN_MODE_RETAIL_HEDGING);
} 

But I do not know how to understand it in MQL4.

Please help me.

 
jaffer wilson :

Hi @ Artyom Trishkin,

Tell me, please, how can I understand if it is a hedge account or a net account?

I know in MQL5:

But I do not know how to understand it in MQL4.

Please help me.

In MQL4, the type of account is always a hedge.

 
Artyom Trishkin :

In MQL4, the type of account is always a hedge.

Ouch. I didn't know. I'm new to MT4. I tried MT5. Still learning. Thank you for your help.

 

Question on testing (see picture from the tester)

- we open a Sell order (green arrow in the picture), it has a Take Profit of 1.10439;

- we add a pending Sell Stop order (yellow arrow in the picture) with the price 1.10441;

Question, why was not take profit at 1.10439 and Sell stop (red arrow) at 1.10441 triggered?

Files:
no_tp.jpg  103 kb
Reason: