I cannot see any reason why 3 of your labels are not showing, are all the input parameters the same as in the code?
You have the datetime value for the label, so you could use iBarShift to find the bar shift, then High[shift] to find the high of that bar. You can then place the label a little above the high. That way the labels will be visible when you scroll back through the chart.
Hello forum, I put this indicator together to allow me to mark some local times on my charts that I have interest in.
Seems to work fine except for the labelling.
It works for me . . . sort of, it doesn't redraw the Objects when the timeframe is changed though.
Thank you, the problem was that I was updating a version of the code, but not the version the terminal was using.
I'm still a bit confused as to what is where (folder wise) since the last MT4 update.
May need to re-install for my sanity!
Thank you, the problem was that I was updating a version of the code, but not the version the terminal was using.
I'm still a bit confused as to what is where (folder wise) since the last MT4 update.
May need to re-install for my sanity!
If in doubt where Indicators, scripts and EAs go . . . File>Open Data Folder
Add this to your deinit()
Bar1Time = 0;
I cannot see any reason why 3 of your labels are not showing, are all the input parameters the same as in the code?
You have the datetime value for the label, so you could use iBarShift to find the bar shift, then High[shift] to find the high of that bar. You can then place the label a little above the high. That way the labels will be visible when you scroll back through the chart.
Thanks GumRai, I will try your suggestion.
As per my response to RaptorUK, I was attaching a version of the code that was different to the updated compiled version. MY APOLOGIES !!!
IndicatorShortName("CloseLine"); IndicatorShortName("CloseLine2"); IndicatorShortName("CloseLine3"); IndicatorShortName("CloseLine4"); IndicatorShortName("CloseLine5"); IndicatorShortName("CloseLine6");
Indicator has only one namestring objectname = "CloseLine"+i; if (ObjectFind (objectname) == -1) ObjectCreate (objectname, OBJ_VLINE, 0, CloseTime, 0);
You create Closeline1 .. Closeline6. the next bar you try to create Closeline1..6 but they already exist and you do nothing. Make your object names unique: "CloseLine"+Time[i]
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello forum, I put this indicator together to allow me to mark some local times on my charts that I have interest in.
Seems to work fine except for the labelling.
The lines draw where they should, but only 3 of the 6 labels work the way I hoped and I can't see the error or difference between working and non working code.
Hope someone not as close to this as me, will point out the error.
Also I set the label height as the current Ask price.
I am wondering if someone might suggest a better approach such that the labels always appear visible on the screen when price moves away from the Ask (previous charts)
thanks in advance!