I thought this would be easy task. But not so. I like to draw a text object on chart a certain time before news report.
I'd do it by hand, but you can't draw objects, e.g. vertical lines on tick charts ahead of time, like on time based charts.
int news1 = 143000; string newsS1 = @"news 1"; int news2 = 150000; string newsS2 = @"news 2"; int news3 = 160000; string newsS3 = @"news 3"; if (ToTime(Time[0]) >= news1-2000 && ToTime(Time[0]) <= news1) BackColorSeries[0] = Color.Gainsboro; // DrawText("News1", false, newsS1, -4, Close[0]-0*TickSize, 0, Color.Orange, new Font ("Arial", 8), StringAlignment.Center, Color.Empty, Color.Empty, 0); //else RemoveDrawObject("News1"); if (ToTime(Time[0]) >= news2-2000 && ToTime(Time[0]) <= news2) BackColorSeries[0] = Color.Gainsboro; // DrawText("News2", false, newsS2, -4, Close[0]-0*TickSize, 0, Color.Orange, new Font ("Arial", 8), StringAlignment.Center, Color.Empty, Color.Empty, 0); //else RemoveDrawObject("News2"); if (ToTime(Time[0]) >= news3-2000 && ToTime(Time[0]) <= news3) BackColorSeries[0] = Color.Gainsboro; // DrawText("News3", false, newsS3, -4, Close[0]-0*TickSize, 0, Color.Orange, new Font ("Arial", 8), StringAlignment.Center, Color.Empty, Color.Empty, 0); //else RemoveDrawObject("News3");
1st news drawn ok, 2nd completely disappeared, 3rd only one bar in advance
Am I missing something?
This is June ES 2000t chart
Cheers
Thomas
Comment