IniziaInizia gratis

Plot a candlestick chart

A candlestick chart is a style of chart that packs multiple pieces of price information into one chart. It can provide you with a good sense of price action and visual aid for technical analysis.

You will plot a candlestick chart using the same data as the previous exercise, which has been preloaded as bitcoin_data. Also, plotly.graph_objects has been imported as go.

Questo esercizio fa parte del corso

Financial Trading in Python

Visualizza il corso

Istruzioni dell'esercizio

  • Define a candlestick object using columns from bitcoin_data.
  • Create a plot using the candlestick object defined in the previous step.
  • Display the candlestick chart.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Define the candlestick data
candlestick = ____(
    x=bitcoin_data.index,
    open=bitcoin_data['____'],
    high=bitcoin_data['____'],
    low=bitcoin_data['____'],
    close=bitcoin_data['____'])

# Create a candlestick figure   
fig = ____(data=[____])
fig.update_layout(title='Bitcoin prices')                        

# Show the plot
fig.____()
Modifica ed esegui il codice