Display formated date in a chart label


Category:
0
0

Seeing if you can help me correct the date in my label. The label is in the volume box in red next to the white “highest volume” label at the bottom.  Driving me crazy. The year displays as 2,021. Cant figure out where the comma is coming from. Here is the code and a pic of what I am talking about. TIA

def highestVolume = HighestAll(volume);
def targetBar = volume == highestVolume;
rec counter = if targetBar then 1 else counter[1] + 1;
plot data = Double.NaN;
AddLabel(yes, Concat(“Highest Volume: “, highestVolume), Color.WHITE);
AddLabel(yes, Concat(GetValue(GetMonth(), counter – 1), Concat(“/”, Concat(GetValue(GetDayOfMonth(GetYyyyMmDd()), counter – 1), Concat(“/”, GetValue(GetYear(), counter – 1))))))

Attachments:
Marked as spam
Posted by (Questions: 2, Answers: 1)
Asked on March 3, 2021 7:12 pm
69 views
0
Private answer

This question has already been posted in the forum.

https://www.hahn-tech.com/ans/formatting-dates-in-chart-labels/

Please take the time to search for existing solutions before posting a new question. Almost all of the most commonly asked questions have already been posted.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 4, 2021 8:54 am