I want to dynamically draw/show support/resistance lines using some drawing object/technique (rectangle/region/line/plot). I will calculate and draw them dynamically but the "levels/prices" could change thru the chart as the prices change through the session. I don't know how many different 'lines/prices' I will draw for a session in advance. Some prices may be in place the entire session and others may come and go. I want the drawing objects to remain displayed in history on the chart so I can review them for analysis later.
Question:
What is my most efficient method of drawing to show these dynamic "prices/levels" as the price moves? If I draw rectangles I will need to redraw each object name on each bar close as the rectangle gets longer as it remains in effect. Then if the price comes back into effect I need to assign a new name so I don't remove history by redrawing the same name. I restart my calculations with each new session, If the chart goes back many days I could end up with quite a few drawing objects and was concerned about a performance impact. I was thinking draw a rectangle initially to the end of the session then redraw it shorter ending only if it the "line/price" goes out of effect to reduce the drawing overhead if the price is no longer in effect. Longer code path but more efficient on resources. Thought of using plots (which I consider efficient) but I would be forced to create a fix number of plots in advance. My indicator allows you to select the closest SR prices within "X" ticks of the last close price so the "lines" can change frequently but might not. I also considered the use of regions and data series but an again need to allocate a fixed number in advance,
I use an added time frame for a timing trigger on when to recalculate the "lines" as they are a pig. (aka resource intensive). In this way you can be on a 15 minute chart but recalculate/redraw the dynamic "lines" more frequently.
Great wizards of NinjaScript knowledge I seek wisdom and direction.
Cheers
Comment