You could use WindowBarsPerChart and WindowFirstVisibleBar to get the range that is currently visible and then use Low[iLowest(...)] to find the lowest price of all the currently visible candles and place your rectangles a bit below that.
Or you could simply place your indicator display in a separate indicator window without having to worry about this at all.
Or you could simply place your indicator display in a separate indicator window without having to worry about this at all.
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 want to draw a nice indicators of session opening times. I want to print them as rectangles at the bottom of the chart:
It would look something like this:
(candles above)
London : |||||||||||||||||||||___________________________________|||||||||||||||||||||||___________________________________
New York: __________________||||||||||||||||||||______________________________________|||||||||||||||||||||________________
Sydney : _______________________________________|||||||||||||||||||________________________________________||||||||||||||||
I got to the stage where I am drawing rectangles, but unfortunately they need to be anchored to Time and Price. I want only to use Time and I want to set fixed height for Price (in pixels from the bottom of the screen). For labels it is possible to use ObjectSet($object_name,OBJPROP_YDISTANCE,$y) but they don't get scrolled with the chart. I want my rectangles to move along with the candles.
How to use it in the way I did that here?