Timestamp "study"

linced

New member
Hi guys,
I'd like to add a timestamp on a multi-intraday-chart.

Since I look at multiple timeframes of a ticker (four charts in one window), if I do it with text it's going to show on the other charts. (which I don't want).

Is there a way to create a study for the explicit chart I want and have the DATE, e.g. DDMMYY up/down in a corner?
 
Solution
Hi guys,
I'd like to add a timestamp on a multi-intraday-chart.

Since I look at multiple timeframes of a ticker (four charts in one window), if I do it with text it's going to show on the other charts. (which I don't want).

Is there a way to create a study for the explicit chart I want and have the DATE, e.g. DDMMYY up/down in a corner?

Put this in a separate study only on the chart you want it to display in your grid.

Screenshot-2022-10-31-071706.png
Ruby:
def year  = GetYear() - (Round(GetYYYYMMDD() / 1000000, 0) * 100);
def Month = GetMonth();
def Day   = GetDayOfMonth(GetYYYYMMDD());

AddLabel(yes, (if Month < 10 then "0" else "") + Month + "" + (if Day < 10 then "0" else "") + Day + "" + year, Color.YELLOW);
Hi guys,
I'd like to add a timestamp on a multi-intraday-chart.

Since I look at multiple timeframes of a ticker (four charts in one window), if I do it with text it's going to show on the other charts. (which I don't want).

Is there a way to create a study for the explicit chart I want and have the DATE, e.g. DDMMYY up/down in a corner?

Put this in a separate study only on the chart you want it to display in your grid.

Screenshot-2022-10-31-071706.png
Ruby:
def year  = GetYear() - (Round(GetYYYYMMDD() / 1000000, 0) * 100);
def Month = GetMonth();
def Day   = GetDayOfMonth(GetYYYYMMDD());

AddLabel(yes, (if Month < 10 then "0" else "") + Month + "" + (if Day < 10 then "0" else "") + Day + "" + year, Color.YELLOW);
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Thank you so much SleepyZ!!! I'm an absolute ****** when it gets to coding...

Is it possible to get this for the multiple past days, e.g. when I'm looking at the one hour chart over 10 days?
 
Thank you so much SleepyZ!!! I'm an absolute ****** when it gets to coding...

Is it possible to get this for the multiple past days, e.g. when I'm looking at the one hour chart over 10 days?

Yes.

To do that this code uses the addchartbubble function as a label is oriented to the upper left corner and is not related to different days on the chart

To ensure that the bubbles are visible:
The study uses declare lower and requires you to manually move the study to the upper panel.
Click the left axis to turn check box off
Lines are plotted at 105,100 and 0 to orient the bubble placement near the top of the chart. These are defaulted to black to hide them. Change the color to match your chart background

Here is the code and how it will look on your chart. You have an option to show the day of the week as well as the date
Screenshot-2022-11-01-045957.png


Ruby:
declare lower;

def d = GetDayOfWeek(GetYYYYMMDD());
def year  = GetYear() - (Round(GetYYYYMMDD() / 1000000, 0) * 100);
def Month = GetMonth();
def Day   = GetDayOfMonth(GetYYYYMMDD());

input showdayofweek = yes;
def rthstart = GetTime() crosses above RegularTradingStart(GetYYYYMMDD());
def bubble   = if rthstart then BarNumber() else bubble[1];

AddChartBubble( BarNumber() == bubble, 100,
if showdayofweek
then (if d == 1 then "Monday"
      else if d == 2 then "Tuesday"
      else if d == 3 then "Wednesday" 
      else if d == 4 then "Thursday" 
      else if d == 5 then "Friday"     
      else if d == 6 then "Saturday"
      else "Sunday")
      + "\n" + (if Month < 10 then "0" else "") + Month + "" + (if Day < 10 then "0" else "") + Day + "" + year
      
else (if Month < 10 then "0" else "") + Month + "" + (if Day < 10 then "0" else "") + Day + "" + year,
if close(period = AggregationPeriod.DAY) > open(period = AggregationPeriod.DAY)
then Color.GREEN
else Color.RED);

plot line105 = 105;
plot line100 = 100;
plot line0 = 0;
line105.SetDefaultColor(Color.BLACK);
line100.SetDefaultColor(Color.BLACK);
line0.SetDefaultColor(Color.BLACK);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
255 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top