Hi,
I can insert the arrow fine in the M1 EUR/USD in which the EA runs. I run the ea to generate a .HST file containing the ticks and show that information in an offline chart. When I tell it to show the arrow object in the current window it shows fine. When I tell it to create the object in the offline window then I get an error 4051 (Invalid function parameter value).
I retrieve the window handle of the offline chart correctly to use is to refresh the offline chart after rewriting the tick file after each tick. When I use that same window handle in ObjectCreate apparently it is not valid. The actual handle value at the moment was 657762 (if that matters).
So I guess the question is whether I can use a window handle other than 0 in the ObjectCreate function, and if so is there a formatting issue or something that I might be missing? The conundrum is object create works if I use the live chart.
<CODE REMOVED>
Please read some other posts before posting . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
RaptorUK
What I understand from your reply are the following:
1. Do my homework
2. It should not be too hard if I do my homework.
3. I am not trying to insert the arrow in the offline chart in a completely stupid way (or you would have mentioned that as well)
4. Someone else has already posted about this or something like it (and you have no idea how I missed it)
I've spent a couple of hours wrapping my head around objectcreate--I'm not the most instinctive programmer, and of course I will continue reviewing other posts etc.
Regards,
N
RaptorUK
What I understand from your reply are the following:
1. Do my homework
2. It should not be too hard if I do my homework.
3. I am not trying to insert the arrow in the offline chart in a completely stupid way (or you would have mentioned that as well)
4. Someone else has already posted about this or something like it (and you have no idea how I missed it)
I've spent a couple of hours wrapping my head around objectcreate--I'm not the most instinctive programmer, and of course I will continue reviewing other posts etc.
Regards,
N
I see it now.
string name = "Signal" + BAS_INDEX; BAS_INDEX++; int win_handle = WindowHandle(Symbol() + "x" , 2); Alert("Win Handle ", win_handle); if (!ObjectCreate(name, OBJ_ARROW, win_handle, TimeCurrent(), Ticks[1][LastItem] + 20 * Point)) { Alert("Error creating object: ",GetLastError()); return(0); } ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID); ObjectSet(name, OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN); ObjectSet(name, OBJPROP_COLOR, White); ObjectSet(name, OBJPROP_TIMEFRAMES, OBJ_ALL_PERIODS); return(1);
- What was so hard about his request? Why didn't you EDIT your original post as requested instead of replying.
int win_handle = WindowHandle(Symbol() + "x" , 2); if (!ObjectCreate(name, OBJ_ARROW, win_handle,
Have you read the manual? The third argument is an integer 0=main window 1=first subwindow... I doubt you have 650,000 subwindows on one chart.
- What was so hard about his request? Why didn't you EDIT your original post as requested instead of replying.
- Have you read the manual? The third argument is an integer 0=main window 1=first subwindow... I doubt you have 650,000 subwindows on one chart
1. Clearly my bad. It was not my intent to not show proper etiquette.
2. Clearly not well enough.
So then my code will operate on a valid window in the current chart, specifically the chart that the EA is functioning in? That clarifies things quite a bit,
Thanks,
N
- If you want to put the object on the main window of the chart you must use zero
#define WINDOW_MAIN 0 if (!ObjectCreate(name, OBJ_ARROW, WINDOW_MAIN
- If you want to put the object on a sub-window you must find it.
int win_idx=WindowFind("MACD(12,26,9)"); if (!ObjectCreate(name, OBJ_ARROW, win_idx
- WindowHandle is only useful in specific DLL calls, never in mql4 functions like create.
- 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,
I can insert the arrow fine in the M1 EUR/USD in which the EA runs. I run the ea to generate a .HST file containing the ticks and show that information in an offline chart. When I tell it to show the arrow object in the current window it shows fine. When I tell it to create the object in the offline window then I get an error 4051 (Invalid function parameter value).
I retrieve the window handle of the offline chart correctly to use is to refresh the offline chart after rewriting the tick file after each tick. When I use that same window handle in ObjectCreate apparently it is not valid. The actual handle value at the moment was 657762 (if that matters).
So I guess the question is whether I can use a window handle other than 0 in the ObjectCreate function, and if so is there a formatting issue or something that I might be missing? The conundrum is object create works if I use the live chart.
Any perspective would be greatly appreciated.
Thanks,
N
<CODE REMOVED>