RegionHighlightX myReg = null ;
foreach (DrawingTool drawTool in DrawObjects)
{
if(drawTool.GetType().Name.ToString() == "RegionHighlightX")
{
myReg = (RegionHighlightX)drawTool ;
[COLOR="Purple"]myReg.OutlineStroke = new Stroke(Brushes.White, 1) [/COLOR];// *** this line throws fatal error
myReg.AreaBrush = Brushes.White ;// ok
myReg.AreaOpacity = 5 ;// ok
myReg.ZOrder = -1 ; // ok
myReg = null ; // ok
}
}
if (myReg != null) myReg.Dispose() ;// all done
- Add an indicator with the above code in OnBarUpdate to a TickReplay chart
- Press Shift+F1 and draw a Region Highlight X
- Press F5 to attempt a NinjaScript Reload

Comment