open and close of the first day of the month

amcno03

New member
Hi, like the title says: Is it possible to plot a line showing the open and other showing the close of the first candle of the month?
And also going long enough till the last day of the month. (like the one showed in the picture)

thanks in advance,


ps: English is not my mother tongue; please excuse any errors on my part.

2024-08-01_1818.png
 
Solution
Hi, like the title says: Is it possible to plot a line showing the open and other showing the close of the first candle of the month?
And also going long enough till the last day of the month. (like the one showed in the picture)

thanks in advance,


ps: English is not my mother tongue; please excuse any errors on my part.

Screenshot 2024-08-18 165601.png
View attachment 22508

Just input the desired month and year to plot the open/close of the 1st day of the month.
This uses bubbles to show the line labels and amounts in your image

Screenshot 2024-08-18 165601.png
Code:
#_1st_dayofMonth_Open_Close
input month = 7;
input year  = 2024;

def mon       = if GetYear() == year or month == 1 then GetMonth() else Double.NaN;
def mon_day_1 = if month == 1 then mon[1] == 12 and mon ==...
Hi, like the title says: Is it possible to plot a line showing the open and other showing the close of the first candle of the month?
And also going long enough till the last day of the month. (like the one showed in the picture)

thanks in advance,


ps: English is not my mother tongue; please excuse any errors on my part.

Screenshot 2024-08-18 165601.png
View attachment 22508

Just input the desired month and year to plot the open/close of the 1st day of the month.
This uses bubbles to show the line labels and amounts in your image

Screenshot 2024-08-18 165601.png
Code:
#_1st_dayofMonth_Open_Close
input month = 7;
input year  = 2024;

def mon       = if GetYear() == year or month == 1 then GetMonth() else Double.NaN;
def mon_day_1 = if month == 1 then mon[1] == 12 and mon == month else mon[1] == month - 1 and mon == month;

def monthday1_open  = if mon_day_1 then open else monthday1_open[1];
plot open_day_1     = if mon == month then  monthday1_open else Double.NaN;
open_day_1.SetStyle(Curve.SHORT_DASH);
open_day_1.SetDefaultColor(Color.CYAN);

def monthday1_close = if mon_day_1 then close else monthday1_close[1];
plot close_day_1    = if mon == month then  monthday1_close else Double.NaN;
close_day_1.SetStyle(Curve.SHORT_DASH);
close_day_1.SetDefaultColor(Color.CYAN);

AddChartBubble(mon == month and mon[-1] == month + 1, open_day_1, open_day_1, Color.CYAN, if close_day_1 <= open_day_1 then yes else no);
AddChartBubble(mon_day_1, open_day_1, "open_day_1" , Color.CYAN, if close_day_1 <= open_day_1 then yes else no);

AddChartBubble(mon == month and mon[-1] == month + 1, close_day_1, close_day_1, Color.CYAN, if close_day_1 >= open_day_1 then yes else no);
AddChartBubble(mon_day_1, close_day_1, "close_day_1" , Color.CYAN, if close_day_1 >= open_day_1 then yes else no);

#
 
Solution

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
375 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