You have hard-coded your "sub-window" parameter when creating the graphical objects.
ObjectCreate(chart_id, name, OBJ_TEXT, 1, time, price);
Use the following to find out which sub-window the Indicator is using ...
Returns the number of a subwindow where an indicator is drawn
Basically ...
ObjectCreate(chart_id, name, OBJ_TEXT, ChartWindowFind(), time, price);
But that is not good programming. It is just an example so you understand the idea.

Documentation on MQL5: Chart Operations / ChartWindowFind
- www.mql5.com
The function returns the number of a subwindow where an indicator is drawn. There are 2 variants of the function. 1. The function searches in the...
Thanks

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I wanted to create a text object to measure the "power" on the last histogram bar for the bears power and bulls power indicators. It seems that there are no issues with the placement of the text object if I load one single indicator on the chart (either bulls or bears).
Chart with only bears indicator:
Chart with only bulls indicator:
now when I load both the bulls indicator and bears indicator on the same chart, the two distinct text objects stick inside the same indicator window:
I'm not sure why. I'm attaching the code files