{ This bar counter works for all time zones. It works for all chart types such as range, volume, intraday. It works for all intraday minutes such as 5, 10, 15, 30, etc. It does not work for non-intraday timeframes such as daily, weekly, etc. It only displays counts for every other bar. It seemed too cluttered to show the count on each bar. It shows counts on 2 rows. You can set the colors to "hide" either row. Input values are: InTextLocation sets the location of the bar count numbers text. Default value is L for Low which will give you jagged text. You can get a horizontal row if you set InTextLocation to a specific value such as 100.00. Use can also do a calculation such as L-0.10. row1text_color is the color of the text for row 1 bar count number. row1dot_color is the color of the dots for row 1. If you set this color to your window background (such as white), you will not the the dotted line. row2text_color and row2dot_color apply to row 2. If you make these the same as window background then you will not see them. DotOffset is how much to adjust the dots beneath the bar. A large value will start the dots far beneath its bar. TextOffset is how much to adjust the bar count text beneath the InTextLocation. Only useful if InTextLocation is L. dottedline_spacing is how much gap should be between the vertical dot bar. alldays is set to true to put the bar count text on all days. Useful for weekends. alldays should be set to false to put the bar count text only on the current day. No bar count will be shown on weekends. Once you get the input values set to what you want them to be, you can use the Default button to permanently set your default values. } input: InTextLocation(L), row1text_color(black), row1dot_color(darkgray), row2text_color(darkgray), row2dot_color(darkgray), DotOffset(0.25), TextOffset(0.25), dottedline_spacing(0.05), alldays(true); variables: text_count(-1),text_line(-1); variable: barcount(0); if (Date <> Date[1] ) then begin barcount=1; end else begin barcount = barcount+1; end; { an alternate way -- not used but kept just to show another way } variable: barcount2(0); variable: barcount3(0); if (Date <> Date[1] ) then begin barcount2=BarNumber; barcount3=1; end else begin barcount3 = CurrentBar-barcount2; end; If Date = currentdate or alldays then begin variable: TextLocation(0); variables: dotted_line_loc(0),stop_dotted_line(0); if Mod(barcount,4) = 0 then begin { row 2 number bar } TextLocation = (InTextLocation - (TextOffset)); dotted_line_loc = L - DotOffset; stop_dotted_line = TextLocation+(dottedline_spacing*2); text_count = Text_New(Date, time, TextLocation, NumToStr(barcount,0)); Text_SetStyle(text_count,2,2); { center the text } Text_SetColor(text_count, row2text_color); while ( dotted_line_loc > stop_dotted_line ) begin text_line = Text_New(Date, time, dotted_line_loc, "."); Text_SetStyle(text_line,2,2); Text_SetColor(text_line, row2dot_color); dotted_line_loc = dotted_line_loc - dottedline_spacing; end; end else if Mod(barcount,2) = 0 then begin { row 1 number bar } dotted_line_loc = L - DotOffset; TextLocation = (InTextLocation - (TextOffset/2)); stop_dotted_line = TextLocation+(dottedline_spacing*2); text_count = Text_New(Date, time, TextLocation, NumToStr(barcount,0)); Text_SetStyle(text_count,2,2); { center the text } Text_SetColor(text_count, row1text_color); while ( dotted_line_loc > stop_dotted_line ) begin text_line = Text_New(Date, time, dotted_line_loc, "."); Text_SetStyle(text_line,2,2); Text_SetColor(text_line, row1dot_color); dotted_line_loc = dotted_line_loc - dottedline_spacing; end; end; end;