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

 
White Rabbit:

Greetings.

MT5 platform.

Please refer to the docks or forum threads where this issue may have been discussed.

What is the question, how to display a changed indicator in an Expert Advisor instead of a standard one, that is passed through a handle?

For example, we have two MAs from which we obtain a linear regression using the moving sum method - this is what we need to display in visual testing.

Make a template with the required indicators and name it tester.tpl or according to the name of the advisor, such as sovetnik.tpl

 

Can you tell me if there is a way to programmatically install a specific indicator on a chart?

There are 24 open charts, and it is a bit cumbersome to manually set each one. I know how to programmatically delete the ones I don't need, but I do not know how to install the right one.

The template option is not suitable.

 
Vitaly Muzichenko:

Can you tell me if there is a way to programmatically install a specific indicator on a chart?

There are 24 open charts, and it is a bit cumbersome to manually install them on each one. I know how to programmatically delete the ones I don't need, but I do not know how to install the right one.

I have no idea how to use a template.

No way

 
Vladimir Pastushak:

no way

Sad :(

 
Hello, could you please tell me how to write Moving Average superimposed on Momentum in the code?
 
pvba:
Hello, could you please tell me how to write Moving Average superimposed on Momentum in the code?
iMAOnArray()
 
Thank you
 

Good day to all. I need help, since I'm just learning, please help who can.

The essence: I have an indicator (parameters are not important)

double ENV_02_1 = iEnvelopes(Symbol(),0,18,MODE_SMMA,0,PRICE_CLOSE,0.12,1,1);

double ENV_02_2 = iEnvelopes(Symbol(),0,18,MODE_SMMA,0,PRICE_CLOSE,0.12,1,0);

Will this line of code be correct?

if (Close[1]<ENV_02_1 && Bid>ENV_02_2)

{then open trade}

The problem is that I want to open a trade when the previous candle closed below the indicator and as soon as the price exceeds the indicator a trade opens. But in the tester, he fucks up a deal for me, no matter below or above the price of the indicator, as if I do not see the code....What am I doing wrong? Please do not send me to read a textbook, I've read too much.

 

Can you give me a hint? To get the GMT time in the owl, what do I have to do, given the possibility that the computer's time and time zone are wrong?

The TimeGMT function

Returns GMT GMT calculated with summer or winter time from the local time on the computer where the client terminal is running. There are 2 versions of this function.

I.e. as I understand it, this function takes local time and time zone and use it to calculate Greenwich Mean Time. If the time is wrong, the result is wrong, right?

Or I got it wrong and only flag of daylight saving time is calculated with local computer time? No, it's the difference where it's coming from.

The TimeDaylightSavings function just takes information from local computer settings, doesn't it?


Then it turns out that the correct GMT can only be obtained if the computer is properly configured, andthe server can not get it?

And in the tester it turns out that GMT can be obtained only by manually prescribing the time shift for the broker that uses quotes?

 

Two statements:

 

PrintFormat ("%. 2lf", 22.33445);  

Print: 22.33

И

 PrintFormat ( "%.*lf" , 22.33445 , 2 );

Print: 2.00000

Why are there different outputs? In C/C+ the above statement works fine.

Reason: