I have an indicator that write some number near a specially pattern found. (it is a 123 joe ross indicator). when using this indicator alone it works with no problem.
When I call this indicator in a strategy I found problem with DrawObjects.
for example: (this is a part of the indicator with problem)
// recolor markers if its failed target
if (upMarkers[pos].lock123 == 2)
{
Text text;
//Print("before");
text = (Text)DrawObjects["123Up1," +upMarkers[pos].dateTime[0]];
if ( text == null) Print("text null 123Up1 upMarkers[pos].dateTime[0] =" +upMarkers[pos].dateTime[0]);
text.TextBrush = failUpColor;
...
text is always null in strategy.
this is another part using DrawObjects:
IDrawingTool drawObject;
int pos;
DateTime obTime = DateTime.Parse(obName.Substring(7));
pos = CurrentBar - Bars.GetBar(obTime);
if (obInSet(obName, "B"))
{
/// move markers in bottom pos
yp = Low[pos] - textOffset;
tstr = "123Dp2," + obName.Substring(7);
drawObject = DrawObjects[tstr];
i]f (drawObject != null && drawObject is DrawingTools.Text)[/B]
{
Text text = (Text)drawObject;
text.YPixelOffset = (int)yp;
yp -= textOffset;
}
How can I resolve?
Thanks.
Comment