Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1073

 
Сергей Таболин:

And for some reason I thought the output went like this:

And if you write it like this.

then nothing but ZigZag will be displayed....

No. The indicator \Indicators\Examples\MACD.mq5

//--- name for Dindicator subwindow label
   IndicatorSetString(INDICATOR_SHORTNAME,"MACD("+string(InpFastEMA)+","+string(InpSlowEMA)+","+string(InpSignalSMA)+")");

outputs


but if we leave only "MACD" for INDICATOR_SHORTNAME

//--- name for Dindicator subwindow label
   IndicatorSetString(INDICATOR_SHORTNAME,"MACD");

it will be


 
Vladimir Karputov:

No. Using the \Indicators\Examples\MACD.mq5 indicator as an example

gives


If we leave only "MACD" for INDICATOR_SHORTNAME

it will.


Right. Stupid. Sorry.

 
Comments not related to this topic have been moved to "Questions from MQL4 MT4 MetaTrader 4 beginners".
 

Good day everyone! Got a question... Sorry if it's off-topic...

What is the right way to make the object display on the "parent" TF andall that are smaller, but not on those that are older than the "parent ".

I.e. how to programmatically set several flags to the object?

If to use

ObjectSetInteger ( ch_id , name , OBJPROP_TIMEFRAMES , flag ); 

the object is displayed only on that TF which corresponds to the flag, however in properties of the object, manually it is possible to choose some...

tf

 
Anzhela Sityaeva:

Good day everyone! Got a question... Sorry if it's off-topic...

What is the right way to make the object display on the "parent" TF andall that are smaller, but not on those older than the "parent ".

I.e. how to programmatically set several flags to the object?

If to use

the object is displayed only on that TF which corresponds to the flag, however in properties of the object, manually it is possible to choose some...


ObjectSetInteger(ch_id, name, OBJPROP_TIMEFRAMES, OBJ_PERIOD_H1 | OBJ_PERIOD_H2); 

As pictured - 1 hour and 2 hours

 
Artyom Trishkin:

As pictured - 1 hour and 2 hours

Let's say an object is created on the clock, it should be displayed on everything from M1 to H1. Anything above H1 it should not be visible...

I.e. have to list everything?

UPD: Seems to be the case. Thanks for the reply!

 
Artyom Trishkin:

As pictured - 1 hour and 2 hours.

But there are also all the minutes in the picture. And to list them as in that poem

A fighter's arm is tired of stabbing.

I'd like to see what I can make of it:

ObjectSetInteger(ch_id, name, OBJPROP_TIMEFRAMES, OBJ_PERIOD_H3-1);

I did. I got it.

 
Alexey Viktorov:

But there are also all the minutes in the picture. And to list them as in that poem

A fighter's arm is tired of stabbing.

I'd like to see what I can make of it:

I did. Got it.

That's great. Is that without the cycle?
 
Anzhela Sityaeva:
That's great. Is that without a cycle?
Of course it is. Just one short line. Just have to determine which is the oldest TF in the list of flags.
 
Alexey Viktorov:

But there are also all the minutes in the picture. And to list them as in that poem

A fighter's arm is tired of stabbing.

I'd check it out:

I did. Got it.

And you print out the numerical values of the flags. The common flag must contain all values of the flags you need. What does OBJ_PERIOD_H3-1 equal? If the sum of all flags before it, then yes, but if not, then there's a bug somewhere.

And if you don't need all the flags before OBJ_PERIOD_H3-1, then what?