Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 16:31:32 +0000



Display Date and Day of the week on the Chart

View Count: 1995

[2022-05-31 00:08:29]
raheemrazzak - Posts: 41
Is there any way to display the day and date of the week on the chart itself, This is for the purpose of documentation. Currently, I write the date and day on the chart via the type text and then take a copy chart image and save it. Wanted to check if I can use any study to display it at the start of the day.

If not this, is there any way to add the day of the week to the chart header?

Thank You
[2022-05-31 18:16:07]
John - SC Support - Posts: 36322
There is not an automated way to do this, particularly for the day of the week.

The Chart Header does have an option to display the Date and Time, but it does not have an option for the Day. Refer to the following:
Global Settings Menu: Customize Chart Header - Standard (Global Settings menu)

You can also display the Day of the Week in the Time Scale. Refer to the following:
Chart Settings: Display Day of Week with Dates on Intraday Chart Time Scale (Chart >> Chart Settings >> Scale menu)

Otherwise, just keep doing what you are doing by using the Text drawing options, or you could create a custom study. Refer to the following:
Advanced Custom Study Interface and Language (ACSIL): Introduction
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-06-01 17:50:33]
raheemrazzak - Posts: 41
Thank You for giving the idea of creating a custom study indicator. This seems to be an excellent small project for me to work on with my novice coding skills.

Is there any sierra chart study that changes the text value displayed on chart as we scroll the chart/candle. I can use it as a starting point.
[2022-06-01 21:21:43]
John - SC Support - Posts: 36322
I honestly do not know. You would have to look through the source code and see.

But to help you along, the following is probably the main variable you will want to work with, which gives you the Index of the last visible bar in the chart, from which you can then get the Date/Time of that bar and then update your drawing as necessary:
ACSIL Interface Members - Variables and Arrays: sc.IndexOfLastVisibleBar
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-06-02 04:54:52]
raheemrazzak - Posts: 41
Thank You, I'll dig more on this...
[2023-07-07 12:39:57]
j4ytr4der_ - Posts: 938
@raheemrazzak did you ever get anywhere with this? I'm looking for the same thing. I have had past experience building custom flavors of text label studies just starting from the Text Display For Study study, the source code isn't super complex (I'm not a coder either). I'll try making this myself if I don't hear back from you but thought I'd see if you'd already done this rather than reinvent the wheel so to speak.
[2023-07-09 06:18:12]
raheemrazzak - Posts: 41
Hey @j4ytr4der_, I couldn't get this to work using the text display study. I don't remember what issue I ran into, but I think it had something to do with date showing in the text format or something. Based on the ideas provided by SC, I went on to use the text display for other stuff, but never came back to this to give another attempt. The display of date and day on the time scale was an easier work around for me. Do let me know if you get some success with this, best luck!!
[2023-07-09 21:08:30]
j4ytr4der_ - Posts: 938
I haven't tried this yet but I'm wondering if it might be possible to expose the date via a spreadsheet, then use the text display study to show it. Might need to convert its formatting with an intermediate Spreadsheet Formula study, I'm not sure but I may give this a go and see what I get.
[2023-07-29 15:33:58]
raheemrazzak - Posts: 41
@j4ytr4der_ were you able to get this to work?
[2023-07-29 16:25:12]
j4ytr4der_ - Posts: 938
I haven't gotten to trying it yet but I'll see if I can give it a shot this weekend.
[2023-07-29 16:33:55]
j4ytr4der_ - Posts: 938
OK I just tried this real quick, and the answer is no it doesn't work at all. And it's quite obvious how it couldn't work.

1. Studies can only format numbers in mathematical-type numeric forms. So while it supports Time, it does not support Date. Therefore you can't format anything as date in a Spreadsheet Formula study.
2. Exposing the date in a Spreadsheet System doesn't help, because while you can expose the date number and bring it into a Text Display study, you will just get a number, as formatting it as date in the spreadsheet has nothing to do with the data that is actually puled in by the Text Display study, which is simply the number of the date.

So you can get the date as a number, but not as a date. Someone would need to make a custom study to do this (which would probably be extremely simple for someone with the ACSIL skills... I might be able to figure it out but this isn't important enough to me to devote the time to it).
[2023-07-29 18:47:29]
raheemrazzak - Posts: 41
Thanks for looking into it.
[2023-07-29 19:46:45]
j4ytr4der_ - Posts: 938
I stand corrected, I got it to work.

1. Add a Spreadsheet Study to your chart.
2. In cell O2 (the column name), put this formula:
=CONCATENATE(MONTH(J41),"/",DAY(J41),"/",YEAR(J41))
3. In the subgraphs, set subgraph O to Drawstyle Hidden
4. Add a Text Display for Study to your chart
5. For the Study and Subgraph to Display, select subgraph O (SG5) as the subgraph to display
6. Set Display Subgraph Name to Yes
7. Set Use Text for Non-Zero Value to Yes

Now you will have the current date displayed as a text object you can style and move anywhere you want. The date will have a colon after it, but that's a minor annoyance.

Enjoy!
Date Time Of Last Edit: 2023-07-29 19:59:15
[2023-07-29 19:48:01]
j4ytr4der_ - Posts: 938
Oh note also that it will display the date that is in J41, so this will work on replay, but will not update on the weekend since the market is not open. It requires market data to be flowing, in order to update. So right now for instance, it's showing Friday as the date since it is Saturday as I write this.
[2023-07-30 00:32:44]
raheemrazzak - Posts: 41
Thanks so much , I'll try to replicate this tonight. Appreciate your help!!
[2023-07-30 01:34:51]
j4ytr4der_ - Posts: 938
Here is a study collection that will do the trick as well. If you add this to a chart with studies already on it, then you may need to point the Text Display study to the Spreadsheet Study.
attachmentDate Text Label.zip - Attached On 2023-07-30 01:34:31 UTC - Size: 1.08 KB - 239 views

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account