I am looking at the 1-minute chart. I would like to change the color of my price bar depending on its time.
E.g. each first bar in a 5 minute time frame should be colored and therefore easily visible: 9:01 bar, 9:06 bar, 9:11 bar, 9:16 bar, etc.
Ideally I can change the settings easily to show other time frames (e.g. 3 bar in 15 minute time frame): 9:03 bar, 9:18 bar, 9:33 bar, etc.
The code below marks me the 9:06 bar red, but how can I do this every 5minutes? It seems I cannot loop the TimeSpan to increase by 5 each time... Is there a better way? It seems complicated to me...
private TimeSpan start = new TimeSpan(09,01,00);
private TimeSpan timeperiod = new TimeSpan(00,05,00);
if (Times[0][0].TimeOfDay == start.Add(timeperiod))
{
BarBrush = Brushes.Red;
}
Thanks for any guidance!
pennywise
Comment