[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 397
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good afternoon. Question about OBJPROP_TIMEFRAMES property identifier of graphical objects... I wrote this script to create a Horizontal Line graphical object (see below).
Question: Why, although the ObjectSet(object_name,OBJPROP_TIMEFRAMES,PERIOD_H1) function explicitly states that the object should display ONLY on timeframe H1, the created object also displays on timeframes (at least) H4, M30, M15.
https://docs.mql4.com/ru/constants/objects/visible
Another constant is OBJ_PERIOD_H1
Yes, thank you it helped... But I'd like to understand why ObjectSet(object_name,OBJPROP_TIMEFRAMES,PERIOD_H1) option doesn't work (as it should)? Is it glitches in the language itself?
i.e. while the current bar[0] is being built the previous one is being defined
As an option:
Yes, thanks helped... But I want to understand why ObjectSet(object_name,OBJPROP_TIMEFRAMES,PERIOD_H1) doesn't work (like it should)? Is it glitches in the language itself?
De facto both PERIOD_H1 and OBJ_PERIOD_H1 are just an alpha substitution of some numeric value.
OBJ_PERIOD_H1 = 0x0010 (for current build) = 0001 0000 (binary)
PERIOD_H1 = 60 (for this build) = 0011 1100 (binary)
As it is easy to replace, you accidentally put 4 timeframes instead of one - H4, H1, M30 and M15
And instead of calling ObjectSet(object_name,OBJPROP_TIMEFRAMES,0x0010) (which you wanted to do) you have called
ObjectSet(object_name,OBJPROP_TIMEFRAMES,0x3C).
what is Time[0] and how does it affect 1 time plus ?! just a little confused...
what is Time[0] and how does it affect 1 time plus ?! just a little confused...
Time[0] is the opening time of the most recent (current) bar. As soon as a new bar comes, it changes.
Type Time in MetaEditor and press F1 for details
Time[0] is the opening time of the most recent (current) bar. As soon as a new bar comes, it changes.
Type Time in MetaEditor and press F1 for details
I'll read it now! Thank you very much!
Then don't forget to look at iTime()
how do I make it add up every time???
how do I make it add every time???