Hi, friend,
I got a problem, explained in following example.
For example, I attach an EA to EURUSD chart only, then use following codes to find USDJPY chart and re-draw it but not attach the same EA to USDJPY. The system replies error 4202, cannot find object.
Your help is appreciated.
if (ChartSymbol(chartID)== "EURUSD")
You are looking for "EURUSD" chart in your code
You are looking for "EURUSD" chart in your code
ha.. my fault. Thank you for pointing out. I extracted part of my coed to simplize my question.
It's not the issue. I updated my code in orignal question.
Thank you all the same.
I got a problem, explained in following example.
For example, I attach an EA to EURUSD chart only, then use following codes to add OBJ_ARROW_BUY to USDJPY chart. The EA is NOT attached to USDJPY. The system replies error 4202, cannot find object.
This is MQL4, right?
This line:
if (ObjectCreate(chartID,"TEST",OBJ_ARROW_BUY,0,TimeSeconds("2019-7-17 00:00:00"),108.00)) // price may need to be changed to reproduce the error
should change to (otherwise it'll draw the object at a time you cannot see):
if (ObjectCreate(chartID,"TEST",OBJ_ARROW_BUY,0,datetime(D'2019.7.17 00:00:00'),108.00)) // price may need to be changed to reproduce the error
And instead of using ObjectSet(), use ObjectSetInteger() so you can include ChartID as the first parameter.
This is MQL4, right?
This line:
should change to (otherwise it'll draw the object at a time you cannot see):
And instead of using ObjectSet(), use ObjectSetInteger() so you can include ChartID as the first parameter.
That's strange, because I don't normally suggest something without testing it myself (unless it's 5 plus in the morning...LOL).
Your result is amazing.... I don't know I ought to be happy or sad..... Let me check my codes....
***UPDATE***
I am using OANDA MT4 version 4.00, build 1170.
I located the error in this code, it can not find the obj_name.
ObjectSet("TEST",OBJPROP_ARROWCODE,233)
Any idea on this ?
Your result is amazing.... I don't know I ought to be happy or sad..... Let me check my codes....
***UPDATE***
I am using OANDA MT4 version 4.00, build 1170.
I located the error in this code, it can not find the obj_name.
Any idea on this ?
Now I get it... you missed this part in my earlier post: "instead of using ObjectSet(), use ObjectSetInteger() so you can include ChartID as the first parameter".
edit: should be chartID, not ChartID...Now I get it... you missed this part in my earlier post: "instead of using ObjectSet(), use ObjectSetInteger() so you can include ChartID as the first parameter".
edit: should be chartID, not ChartID...Thank you very much. Problem solved. I did not know there is such a good function.
- 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, friend,
I got a problem, explained in following example.
For example, I attach an EA to EURUSD chart only, then use following codes to add OBJ_ARROW_BUY to USDJPY chart. The EA is NOT attached to USDJPY. The system replies error 4202, cannot find object.
Your help is appreciated.
*** UPDATE : QUESTION SOLVED***
1) I tried to unattach EA from EURUSD, and then attach EA to USDJPY, run my codes. Everything works just fine to draw ARROWS to USDJPY chart.
2) codes in MQL4
3) I use OANDA MT4 version 4.00, build 1170. The error happens in this line of code. Thanks to Seng Joo Thio, it seems the code works fine on his platform.
*** PART OF MY CODE GENERATES ERROR MESSAGE ***
*** THE RIGHT CODE FOR ANYONE ****