Lines on high and low of range
-
In the above project is a simple EA where I am trying to place lines on the high, low, left and right of a range, the right and left work as expected but, the high and low do not sit in the correct place, can anyone see where I am going wrong or what I can do to correct. Thanks
-
@jstap Never mind, sorted what I did wrong.
-
I have been trying to draw lines when time crosses midnight but the lines are drawn in the wrong place.
In the link above I have tried to use variables to record different times separately, some times this works but sometimes it doesn't. Any ideas on how I can make this work? any help on this is appreciated.
-
@jstap I don't fully understand what you need. I see you selected lines to be redrawn. Are you sure you need them? Where are the vertical lines supposed to be exactly?
-
@l-andorrà The vertical lines are where they are suppose to be, on the start and end of a session.
I have made about 30 different versions of this, all with something different, some with lines redrawing some without, all I am trying to achieve is verticals at set times, horizontals at the high and low of the same time period, nothing needs to redraw as once a day I can delete and then draw.Is probably me missing something simple but, any advice would be good.
-
@jstap Probably the easiest solution is a custom indocator doing that job. You'll avoid all this headache for sure.
-
@l-andorrà Thank you
-
@jstap found a solution?
-
@vonmunchy No mate, looks like drawing lines over 00:00 time cant be done accurately.
-
@jstap what exactly is it that you need, explain in detail and il give it a try
-
I have made another version using a loop to find the candle ID but, like the others it is not correct. For some reason it works out the high candle ID as 1 or 8, it also works out the low candle ID as 1 or 8, they are never the same and each day the lines are drawn, the numbers may switch.
I doubt anyone knows why but any ideas on how to correct would be good.
-
@jstap what i meant was what are you trying to find or rather the logic. You said in your first post your trying to find a range. So range of what? Highs/lows/close/open?
-
@vonmunchy the high in a range and the low in the same range, the range is decided by a start and finish time, although candles could be used as there is always a set number in a range.
-
@jstap so you want it within a certain range and lines to be drawn at highs and lows of that range?
-
@vonmunchy Yes, I may use the logic in another EA but just lines at the moment, it is when the time starts at the end of one day and finishes the next that I seem to be struggling.
-
@jstap so your issue is the line not repainting on the start of the next day?
-
@vonmunchy No it repaints fine, it just often doesn't sit on the high and low.
-
@jstap so you want to permeant store the price of period. Than its doesnt become a range isnt it? Well this works fine for me with no issues when im using a range. Since its a range, its bound to chance when a new high/low is made.

-
@jstap im assuming this is what you wanna do. The highs and low are accurate this way.

-
@vonmunchy Think you for this but, when you change the start time to before 00:00 it stops working correctly.