FunctionRacerProblemsRace

Candles

HardmatplotlibPython

Draw a candlestick chart of a stock. Day i (0, 1, 2, ...) has an open, a close, a high and a low price.

Draw the wick and then the body of each day, with default bar width. Return the figure.

Checked: the lines, the bars and the bar colors.

Example 1

opens [10,12,11]
closes [12,11,11]
highs [13,12.5,12]
lows [9,10,10.5]
draws
The chart to draw in example 1 of Candles

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More matplotlib problems