Salt Lake City, UT
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387
|
I am creating an indicator that is DOM like which displays on the right side of a chart
I am using graphics.DrawRectangle and graphics.DrawString to accomplish the display
But as time goes on the number of items to draw will increase
I am concerned it will start to consume far too much CPU
Is there a way to use these draw methods to instantly draw on the screen, not just on a refresh? This way only the newest graphics is rendered, instead of the needing to run through the my entire display graphics entity list again.
For example at price Y draw a box with the price in it at x = xlocation
when price changes to Y + 1 tick, draw another box above the previous box (at new price level )but still at x = xlocation
As my code is today, I need to draw 2 boxes when price changes.
I want to draw just 1 to reduce CPU impact
I would only draw 2 if a full refresh occurs (such as when F5 is pressed)
|