Forex Factory (https://www.forexfactory.com/forum.php)
-   Platform Tech (https://www.forexfactory.com/forumdisplay.php?f=69)
-   -   [MT4] Changing the visible timeframes of multiple objects? (https://www.forexfactory.com/showthread.php?t=907317)

bippo Apr 9, 2019 9:27am | Post# 1

[MT4] Changing the visible timeframes of multiple objects?
 
1 Attachment(s)
Hi everyone,

Does anyone know if there's a script which would allow me to select multiple objects such as trendlines, rectangles, etc and change on which timeframe they're visible on?

Because the way MT4 currently is, you have to manually change every single object:
Name:  Screenshot1.png
Views: 1915
Size:  40 KB

Nothocestrum Jan 28, 2020 9:10pm | Post# 2

That is a good question bippo.

As far as I can tell, such a function is not possible. But, I really do not know for sure.
That would be really useful.

I found your post because I have a similar query.
I am trying to find out if it is possible to duplicate multiple shapes at once, and then move them as a group in unison.

I use three rectangles to analyze my charts each morning, and it would be so much easier if I could copy all three as a set, and slide that new set to the next day.

I think in both these questions, the core is: does MT4 have a function which combines objects to be managed as one unit.
So far, in using mt4 and experimenting with every possibility I can think of, I've not yet found a way.

If anyone else knows one way or the other?...

emmzett Jan 29, 2020 3:09am | Post# 3

Hi everyone, Does anyone know if there's a script which would allow me to select multiple objects such as trendlines, rectangles, etc and change on which timeframe they're visible on? Because the way MT4 currently is, you have to manually change every single object: {image}
Standard MQL:
Inserted Code
bool ObjectSet(string label, OBJPROP_TIMEFRAMES, int periodFlags);

with periodFlags being any combination of:
Inserted Code
OBJ_PERIOD_M1      0x0001  Object is shown on 1 minute charts
OBJ_PERIOD_M5      0x0002  Object is shown on 5 minute charts
OBJ_PERIOD_M15     0x0004  Object is shown on 15 minute charts
OBJ_PERIOD_M30     0x0008  Object is shown on 30 minute charts
OBJ_PERIOD_H1      0x0010  Object is shown on 1 hour charts
OBJ_PERIOD_H4      0x0020  Object is shown on 4 hour charts
OBJ_PERIOD_D1      0x0040  Object is shown on daily charts
OBJ_PERIOD_W1      0x0080  Object is shown on weekly charts
OBJ_PERIOD_MN1     0x0100  Object is shown on monthly charts
OBJ_PERIODS_ALL    0x01FF  Object is shown on all timeframes
NULL               0       Object is shown on all timeframes
OBJ_PERIODS_NONE  -1       Object is hidden on all timeframes

Jagg Jan 29, 2020 3:33am | Post# 4

2 Attachment(s)
Don't know if it's from any interest but here is my "Drawing Toolbox" with many options.

I also use rectangles a lot (see red and blue rectangle objects on the chart) - when you click with the mouse one rectangle objects in the panel (marked yellow) a rectangle object is added to the chart "somewhere". I've included input options so you can set hotkeys for any object from the panel - so I've set letter "A" to a rectangle (red) as hotkey shortcut for example and letter "B" to the 2nd rectangle object and now I simply hover the mouse over the chart region I want to place the rectangle and press "A" and the rectangle is drawn on that place. When "Extend" option is set to yes this rectangle extends automatically when a new bar is printed.

Same with Fibo - I hover the mouse over the bar in the chart where the low/high is and click "F" hotkey shortcut and a fibo object is drawn - my tool finds the low/high automatically.

All the objects you draw from this panel or via hotkey automatically get these periodFlags which emmzett mentioned above.
That means when you draw a rectangle, fibo, trendline,... on a M5 chart - this object is only visible from M5 and below (means you can see it in a M5 and M1 chart only). Do you place an object on a H1 chart it's visible on H1, M30, M15, M5 and M1 - think you get it....

I add my indicator here "as it is now" - there are definitely still some inconsistencies/bugs in there - but for me it's really useful like it is at this stage....
Click to Enlarge

Name: Drawing Toolbox.png
Size: 67 KB
Drawing Toolbox.ex4

Jagg Feb 7, 2020 4:08am | Post# 5

2 Attachment(s)
v1.02 has now an extra input for every object where you can decide on which timeframes this object should be visible (3 options available)
Click to Enlarge

Name: Drawing_Toolbox_v1.02_objects_on.png
Size: 11 KB
Drawing Toolbox.ex4

kvak Feb 10, 2020 12:31pm | Post# 6

1 Attachment(s)
Hi Mr. Jagg. I like your indicators and I thank you for it. I want kindly ask you if is possible to add lines shift for prices to this indicator? Sorry for offtopic to this thread.
Thank you.
Click to Enlarge

Name: EU15.png
Size: 123 KB

Jagg Feb 11, 2020 3:41am | Post# 7

2 Attachment(s)
Hi Mr. Jagg. I like your indicators and I thank you for it. I want kindly ask you if is possible to add lines shift for prices to this indicator? Sorry for offtopic to this thread. Thank you. {image}
try new version...
Click to Enlarge

Name: PrevClosePercentages_v1.04j.png
Size: 9 KB
PrevClosePercentages_v1.04j.ex4

kvak Feb 11, 2020 3:47am | Post# 8

{quote} try new version... {image} {file}
Thank you

thisara1 Feb 13, 2020 9:18am | Post# 9

1 Attachment(s)
{quote} try new version... {image} {file}
Jagg can you can you added Pencil or Pen Tool this indicator?
example
Click to Enlarge

Name: Screenshot_65.png
Size: 93 KB

Jagg Feb 13, 2020 12:43pm | Post# 10

{quote} Jagg can you can you added Pencil or Pen Tool this indicator? example {image}
...sent pm - I think clarified for this thread here.

(in my drawing toolbox indicator I don't think I'll implement a 'freehand drawing pencil')

thisara1 Feb 13, 2020 12:54pm | Post# 11

{quote} ...sent pm - I think clarified for this thread here. (in my drawing toolbox indicator I don't think I'll implement a 'freehand drawing pencil')
yes thank you friends

aweawe Feb 19, 2020 12:37am | Post# 12

1 Attachment(s)
Don't know if it's from any interest but here is my "Drawing Toolbox" with many options. I also use rectangles a lot (see red and blue rectangle objects on the chart) - when you click with the mouse one rectangle objects in the panel (marked yellow) a rectangle object is added to the chart "somewhere". I've included input options so you can set hotkeys for any object from the panel - so I've set letter "A" to a rectangle (red) as hotkey shortcut for example and letter "B" to the 2nd rectangle object and now I simply hover the mouse over the chart...

hi mister jagg, hope you are doing good there.
I know its off topic, i edited the code for adding few rectangles, but now i need an equidistant channel.
Since I don't have any programming background, the compiler didn't show any error but my channel icon doesn't appear on panel box.
Name:  Capture6.PNG
Views: 1367
Size:  3 KB

Jagg Feb 20, 2020 2:30am | Post# 13

{quote} hi mister jagg, hope you are doing good there. I know its off topic, i edited the code for adding few rectangles, but now i need an equidistant channel. Since I don't have any programming background, the compiler didn't show any error but my channel icon doesn't appear on panel box. {image}
...without posting your code/indicator no one can help

aweawe Feb 20, 2020 1:39pm | Post# 14

1 Attachment(s)
{quote} ...without posting your code/indicator no one can help
As your request
Color Levels Custom.mq4

Jagg Feb 20, 2020 7:30pm | Post# 15

1 Attachment(s)
{quote} As your request {file}
...only tested when placing the panel left lower/upper - when placing the panel at the right side it's cutted because of the amount of your objects (I haven't the time to digg deeper into that issue sorry)
Color Levels Custom.mq4

aweawe Feb 21, 2020 10:05pm | Post# 16

{quote} ...only tested when placing the panel left lower/upper - when placing the panel at the right side it's cutted because of the amount of your objects (I haven't the time to digg deeper into that issue sorry) {file}

Don't need to be sorry for that mr. jagg, it was my lack of knowledge how to convert ideas into code, so I put many objects on current timeframe and couldnt filter out which object have to be appeared on certain TF. I just realized its damn long like a bill of monthly groceries.

I'm grateful for this mr. jagg.
Thank you very much

thisara1 Feb 29, 2020 4:08pm | Post# 17

1 Attachment(s)
{quote} ...only tested when placing the panel left lower/upper - when placing the panel at the right side it's cutted because of the amount of your objects (I haven't the time to digg deeper into that issue sorry) {file}
Jagg can you code this position change any place move on chart?
timeframe_zoom_per_chart.mq4

Jagg Mar 4, 2020 4:35am | Post# 18

2 Attachment(s)
{quote} Jagg can you code this position change any place move on chart? {file}
You can now choose the corner (and optionally set X-/Yshift values to position wherever you like)
Click to Enlarge

Name: timeframe_zoom_per_chart_v1.0j.png
Size: 30 KB
timeframe_zoom_per_chart_v1.0j.mq4

thisara1 Mar 4, 2020 4:49am | Post# 19

1 Attachment(s)
{quote} You can now choose the corner (and optionally set X-/Yshift values to position wherever you like) {image} {file}
awesome work thank your frineds lite mp indicator added time chart change very show any reason friends,,same other symbol change indicator
Click to Enlarge

Name: Screenshot_51.jpg
Size: 304 KB

Jagg Mar 4, 2020 7:43am | Post# 20

2 Attachment(s)
lite mp indicator added time chart change very show any reason friends,,same other symbol change indicator
^^^don't understand this - everything ok or not ?

Here is v1.1 - added a few more optional parameters

(1) is the look when border color is set to NONE
(2) is the look when border color is set to the same color as the chart background
Click to Enlarge

Name: timeframe_zoom_per_chart_v1.1j.png
Size: 48 KB
timeframe_zoom_per_chart_v1.1j.mq4


© Forex Factory