I have a custom indicator that draws a device (either diamonds, dots or whatever the user wants) on the main panel of a chart at an appropriate place. It works like a champ. That's all it does - it doesn't draw anything else, not plots, not anything.
The first attached image is what the indicator is supposed to look like - it works when I use it like a regular indicator on a chart. (Ignore the text)
The second attached image is what I'm getting. It shows T or F where the bool Series shows what the values are. Where there is a "T" is where there should be a device.
However, when I call this indicator from a strategy, I can't get it to draw the devices. It's supposed to draw diamonds by default but if you set it to a different device, it won't draw those either.
I've stepped through the code in VS and I come to this method:
private static T ChartMarkerCore<T>(NinjaScriptBase owner, string tag, bool isAutoScale, int barsAgo, DateTime time, double yVal, Brush brush, bool isGlobal, string templateName) where T : ChartMarker { if (owner == null) throw new ArgumentException("owner"); if (time == Core.Globals.MinDate && time == Core.Globals.MinDate && barsAgo == int.MinValue) throw new ArgumentException("bad start/end date/time"); if (yVal.ApproxCompare(double.MinValue) == 0 || yVal.ApproxCompare(double.MaxValue) == 0) throw new ArgumentException("bad Y value"); if (isGlobal && tag[0] != GlobalDrawingToolManager.GlobalDrawingToolTagPrefix) tag = string.Format("{0}{1}", GlobalDrawingToolManager.GlobalDrawingToolTagPrefix, tag); T chartMarkerT = DrawingTool.GetByTagOrNew(owner, typeof(T), tag, templateName) as T; if (chartMarkerT == null) return default(T);
I have included my indicator and a test strategy if you want to try to reproduce this. I'm not sure if the problem is me or not but since the devices plot as expected if you use the indicator as a straight-out indicator and not when you call it in as simple a strategy as I can put together, I'm thinking it may not be me.
Thanks guys!
Comment