-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Term Entry] Python Plotly- graph_objects .Candlestick() #5819
Conversation
@SaviDahegaonkar please add the output image as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @SaviDahegaonkar , thank you for contributing to Codecademy Docs, the entry is nicely written! 😄
I've suggested a few changes, could you please review and modify those at your earliest convenience? Thank you! 😃
content/plotly/concepts/graph-objects/terms/candlestick/candlestick.md
Outdated
Show resolved
Hide resolved
content/plotly/concepts/graph-objects/terms/candlestick/candlestick.md
Outdated
Show resolved
Hide resolved
The **`.Candlestick()`** method in the `graph_objects` module in Plotly is used to create candlestick charts widely for visualizing financial data. A candlestick chart displays four key data points for a specific period: | ||
|
||
1. **Open** - The starting value of the asset. | ||
2. **High** - The highest value achieved within the time period. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of within, let us use "The highest value achieved during the time period. and ":" instead of "-"
|
||
1. **Open** - The starting value of the asset. | ||
2. **High** - The highest value achieved within the time period. | ||
3. **Low** - The smallest value during the period. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of smallest, let us use - "The lowest value during the period."
content/plotly/concepts/graph-objects/terms/candlestick/candlestick.md
Outdated
Show resolved
Hide resolved
import plotly.graph_objects as go | ||
|
||
fig = go.Figure(data=[go.Candlestick( | ||
x=df['date'], # Time or date data | ||
open=df['open'], # Opening prices | ||
high=df['high'], # Highest prices | ||
low=df['low'], # Lowest prices | ||
close=df['close'] # Closing prices | ||
)]) | ||
|
||
fig.show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refer to this and correct the parameters and their values - https://plotly.github.io/plotly.py-docs/generated/plotly.graph_objects.Candlestick.html
x=dates, | ||
open=open_prices, | ||
high=high_prices, | ||
low=low_prices, | ||
close=close_prices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add comments here, like # Opening prices for each date, # highest prices for each date
|
||
## Example | ||
|
||
The following example showcases the use of the `.candlestick()` method: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe the code example in a line or two
…stick.md Co-authored-by: Mamta Wardhani <[email protected]>
…stick.md Co-authored-by: Mamta Wardhani <[email protected]>
…stick.md Co-authored-by: Mamta Wardhani <[email protected]>
Hey @mamtawardhani , Thanks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change the syntax
```pseudo | ||
import plotly.graph_objects as go | ||
|
||
fig = go.Figure(data=[go.Candlestick( | ||
x=df['date'], # Time or date data | ||
open=df['open'], # Opening prices | ||
high=df['high'], # Highest prices | ||
low=df['low'], # Lowest prices | ||
close=df['close'], # Closing prices | ||
increasing_line_color='green', # Color for increasing candlesticks | ||
decreasing_line_color='red', # Color for decreasing candlesticks | ||
increasing_fillcolor='rgba(0, 255, 0, 0.3)', # Fill color for increasing candlesticks | ||
decreasing_fillcolor='rgba(255, 0, 0, 0.3)' # Fill color for decreasing candlesticks | ||
)]) | ||
|
||
fig.update_layout( | ||
title='Candlestick Chart', # Title for the chart | ||
xaxis_title='Date', # X-axis label | ||
yaxis_title='Price', # Y-axis label | ||
xaxis_rangeslider_visible=False # Disables the range slider under the candlestick chart | ||
) | ||
|
||
fig.show() | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refer to this and correct the parameters and their values - https://plotly.github.io/plotly.py-docs/generated/plotly.graph_objects.Candlestick.html
Will do it now.
…On Fri, 20 Dec 2024 at 3:53 PM, Mamta Wardhani ***@***.***> wrote:
***@***.**** commented on this pull request.
please change the syntax
------------------------------
In content/plotly/concepts/graph-objects/terms/candlestick/candlestick.md
<#5819 (comment)>:
> +```pseudo
+import plotly.graph_objects as go
+
+fig = go.Figure(data=[go.Candlestick(
+ x=df['date'], # Time or date data
+ open=df['open'], # Opening prices
+ high=df['high'], # Highest prices
+ low=df['low'], # Lowest prices
+ close=df['close'], # Closing prices
+ increasing_line_color='green', # Color for increasing candlesticks
+ decreasing_line_color='red', # Color for decreasing candlesticks
+ increasing_fillcolor='rgba(0, 255, 0, 0.3)', # Fill color for increasing candlesticks
+ decreasing_fillcolor='rgba(255, 0, 0, 0.3)' # Fill color for decreasing candlesticks
+)])
+
+fig.update_layout(
+ title='Candlestick Chart', # Title for the chart
+ xaxis_title='Date', # X-axis label
+ yaxis_title='Price', # Y-axis label
+ xaxis_rangeslider_visible=False # Disables the range slider under the candlestick chart
+)
+
+fig.show()
+```
Please refer to this and correct the parameters and their values -
https://plotly.github.io/plotly.py-docs/generated/plotly.graph_objects.Candlestick.html
—
Reply to this email directly, view it on GitHub
<#5819 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5UD3MTTNA3R77IATOGZNKD2GPV2FAVCNFSM6AAAAABTTRN6AWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMJXGIZTKOJRG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hello @mamtawardhani , Thanks, |
fixed syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entry looks good to be merged! 🚀
👋 @SaviDahegaonkar 🎉 Your contribution(s) can be seen here: https://www.codecademy.com/resources/docs/plotly/graph-objects/candlestick Please note it may take a little while for changes to become visible. |
Description
Created a new term entry on the .Candlestick() method of the graph_objects module in Plotly, Python.
Issue Solved
#5177
Type of Change
Checklist
main
branch.Issues Solved
section.