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
Hi all,
I need help as follows:
1) There are numerous Objects in the chart, I am interested to get value of the object on a specific bar of the chart.
2) Object with the names, as an example, "XYZ04", "XYZ110", "XYZ005" appear on the chart, therefore I know the prefix, but I do not know the suffix which could be 112, 198, 110,13, etc.
The methodology could be:
1) Determine all the objects with suffix "XYZ" in the chart.
2) Check which one is on the specific bar and get its value.
I went through various ObjectGet, ObjectFind functions but could not put them together to get my desired result.
Appreciate help to resolve the problem
Thanks
int total=ObjectsTotal(); string obj_name="";string a1,a2; for(int i=0;i<total;i++) { obj_name=ObjectName(i); a1=StringSubstr(obj_name,0,3); // XYX a2=StringSubstr(obj_name,3,StringLen(obj_name)-3); // 04 Print(a1," ",a2," ",ObjectDescription(obj_name)); // value XYZ04 if (obj_name=="XYZ04") Print(ObjectDescription(obj_name)); }Amazing!! With the help of the codes and comments posted by all of you, I could come up with the required code.
Attaching a file that has the required code. If I key in the Prefix and the bar to look at, I get the value of the object if an object with the prefix is found on the specified bar.
I need the code to execute at the beginning of a new bar, after we are into the new bar for a specified time. (minutes/seconds as a variable). Some helpful code is available here, but beyond my understanding. https://www.mql5.com/en/forum/245598 - execute every minute.
Appreciate a second round of help from all of you.
Thanks
Amazing!! With the help of the codes and comments posted by all of you, I could come up with the required code.
Attaching a file that has the required code. If I key in the Prefix and the bar to look at, I get the value of the object if an object with the prefix is found on the specified bar.
I need the code to execute at the beginning of a new bar, after we are into the new bar for a specified time. (minutes/seconds as a variable). Some helpful code is available here, but beyond my understanding. https://www.mql5.com/en/forum/245598 - execute every minute.
Appreciate a second round of help from all of you.
Thanks