I'm writing a strategy that will look at drawing objects on a chart and I would like to compare the color of the drawing object to my options in the strategy to see if they match.
Even when the colors are the same, my code is saying they do not match.
e.g.
foreach (DrawingTool draw in DrawObjects.ToList()) { if (draw is DrawingTools.ArrowDown) { DrawingTools.ArrowDown myArrowDown = draw as DrawingTools.ArrowDown; if (matchColorBuy && enterBuy) { if (myArrowDown.AreaBrush == colourFormBuy) { enterBuy = true; if (showInfo) Print(Time[0] + " " + Instrument.FullName + " Color of drawing object: " + myArrowDown.AreaBrush + " does match Buy Form Color: " + colourFormBuy); } else { enterBuy = false; if (showInfo) Print(Time[0] + " " + Instrument.FullName + " Color of drawing object: " + myArrowDown.AreaBrush + " does NOT match Buy Form Color: " + colourFormBuy); } } }
Any ideas?
Many thanks
Tim
Comment