-
That is not the problem. You did delete them.
-
if(!TextCreate(0,"IBS_"+(string)i,0
You can't use an as-series index in object names as they are not unique. As soon as a new bar starts, you will be trying to create a new name (e.g. "name0"), same, existing, previous, name (e.g. “name0” now on bar one.)
Use time (as int) or a non-series index:
#define SERIES(I) (Bars - 1 - I) // As-series to non-series or back.
-
-
That is not the problem. You did delete them.
-
You can't use an as-series index in object names as they are not unique. As soon as a new bar starts, you will be trying to create a new name (e.g. "name0"), same, existing, previous, name (e.g. “name0” now on bar one.)
Use time (as int) or a non-series index:
-
William:
Thank you, I do get object names as a series, like IBS_01, IBS_02, but I guess something prevents it from being deleted when switching TFs, however, it seems most of them are being deleted. However, I think you probably know more than I do, how would you replace my current code then because I'm not quite following how to fix the code with what you suggested.
Regards,
Chris
What part of “that is not the problem. You did delete them” was unclear?
What part of “that is not the problem. You did delete them” was unclear?
I re-read your thing and I understand that I'm successfully removing the objects, however, that candle 0 and 1 will always cause issues and now I'm trying to figure out how to do a non-series index or time, I'm still new at this code (mql) so I'm still learning. I'll figure it out, thx for your help.
/Chris
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I created an indicator that measures the IBS (internal bar strength), I used part of the function listed in MQL docs but I do have a problem when I switch time frames, it doesn't seem to run the OnDeinit to clear up already created objects before it starts creating new objects based on the new timeframe, which I thought it was supposed to do. The result is that I get Error Code 4200 because the object name already exist because it wasn't removed correctly. I'm going blind trying to figure out what I'm missing but cannot figure it out (yet). Enclosed is the code, I would appreciate any assistance in resolving it.