I like to get alerted 20 min before news, with indicator, that draws text on chart.
Here is what I have so far.
int news1 = 150000; string newsS1 = @"news"; if (news1>0 && ToTime(Time[0]) >= [B]"calculated time"[/B] && ToTime(Time[0]) <= news1) 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");
Because its a bit complicated it depends, what time one is subtracting the 20min from. If from full hour one has to subtract 6000, if from lower (like 17:59 one needs to subtract 2000 only, and when subtracting from 17:19 one has to use 6000 again. Tricky.
e.g. for
150000 news time "calculated time" has to be 144000 (difference 6000)
153000 news time "calculated time" has to be 151000 (difference 2000)
Thanks for replying
Thomas
Comment