The attached drawing object is a copy of the 'Ruler.cs' which has several modifications. The lines which keep failing are original code lines that were not modified which makes the problem stranger. It is not easy to replicate, it seems to me that as the number of Altline objects increases and the number of bars on the chart accumulate the quicker the error will appear. So in faster markets when there are more Altline objects on the chart the error will happen quicker.
The example below is the most common point of error but there are others but always on a rendertarget statement. The other strange thing is that I could not replicate the problem if in debug mode with visual studio. I believe the line in the example below is 386.
Using Ninja 8.0.22.2 x64
Trace error:
2020-10-28 20:37:24:881 ChartObject.Render.ERROR: Render exception on non finalized chart object 'NinjaTrader.NinjaScript.DrawingTools.Customized.A ltRuler' System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at SharpDX.Direct2D1.RenderTarget.DrawRectangle(Recta ngleF rect, Brush brush, Single strokeWidth, StrokeStyle strokeStyle)
at NinjaTrader.NinjaScript.DrawingTools.Customized.Al tRuler.OnRender(ChartControl chartControl, ChartScale chartScale)
at NinjaTrader.Gui.Chart.ChartObject.Render(RenderTar get renderTarget, ChartControl chartControl, ChartScale chartScale)
2020-10-28 20:37:24:883 ERROR: Indicator '': Error on calling 'OnRender' method on bar 3410483: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
2020-10-28 20:39:58:869 ERROR: Connection lost to the NinjaTrader Historical Data Server: hds-us-nt-001.ninjatrader.com
2020-10-28 20:40:40:886 Server.HdsClient.Connect: type=HDS server='hds-us-nt-003.ninjatrader.com' port=31655 system='' useSsl=True
AltRuler.cs
trace.txt
Comment