- www.mql5.com
Thank you Jox90.
It is not exactly that one buch are quite identically.
But with that in mind, is it there a way to find if the price is inside that object? The buffers here are empty most of the time and nothing can be automated with that.
Regards,
Ciprian
Look in the Object List to find the Object Name and then you can read it's value with ObjectGetDouble() function, and then you can compare this against price.
Thank you Marco.
For who is interested I made somethig like this:
bool checkSR() { double srZoneNow = iCustom(Symbol(), 0, "name...", ...); int AllObjects = ObjectsTotal(OBJ_RECTANGLE); for(int i=0; i<AllObjects; i++) { string ObjName = ObjectName(i); double ObjValue = ObjectGetDouble(0, ObjName, OBJPROP_PRICE); // BUY if (Ask <= ObjValue + 5 * Point || Ask <= ObjValue - 5 * Point) { return true; } // SELL if (Bid >= ObjValue + 5 * Point || Bid >= ObjValue - 5 * Point) { return true; } } return false; }
I'm not too happy but that is what I had in mind.
Regards,
Ciprian
That doesn't look bad at all.
If it does the job without bugs your good to go.
It depends on the object name and how many objects there are.
If there are more and they aren't numbered then this can bring problems.
So you can also throw in:
OBJPROP_CREATETIME
Then you can just filter for the latest objects.
I wanted to write some examples but i have too little info to go with.
Do you know the exact object name ?
Are they numbered with a pre or post fix or a time stamp ?
- www.mql5.com
That doesn't look bad at all.
If it does the job without bugs your good to go.
It depends on the object name and how many objects there are.
If there are more and they aren't numbered then this can bring problems.
So you can also throw in:
Then you can just filter for the latest objects.
I wanted to write some examples but i have too little info to go with.
Do you know the exact object name ?
Are they numbered with a pre or post fix or a time stamp ?
Thanks. I like the idea of `OBJPROP_CREATETIME`
They are numbered like SRE#1, SRE#2 but I think if I can get them by the time then perfect.
Anyway ... there are @40 so not mandatory to change the code.
Thank you again and have a great weekend.
Okay so if you know the exact name and they are numbered then you can also use:
int cnt=1; if(ObjectFind(0,"SRE#"+IntergerToString(cnt))<0) { // This object does not exist... } if(ObjectFind(0,"SRE#"+IntergerToString(cnt))>=0) { // This object does exist... } cnt++; // you can increment the counter and try again to see if the next object exists or not.
- www.mql5.com
Okay so if you know the exact name and they are numbered then you can also use:
Thank you Marco.
Regards,
Ciprian
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there,
I have a custom indicator that is drawing objects on the chart (support and resistance) but there are not helpfull buffers and I don't have the mq4 code for it (only ex4).
My question is if there is a way to find if the price is inside an object from the chart.
I'm adding a picture as it is worth more than my 1000 words.
Regards,
Ciprian