MCPcopy Create free account
hub / github.com/plotly/plotly.py / make_increasing_ohlc

Function make_increasing_ohlc

plotly/figure_factory/_ohlc.py:58–100  ·  view source on GitHub ↗

Makes increasing ohlc sticks _make_increasing_ohlc() and _make_decreasing_ohlc separate the increasing trace from the decreasing trace so kwargs (such as color) can be passed separately to increasing or decreasing traces when direction is set to 'increasing' or 'decreasing' in

(open, high, low, close, dates, **kwargs)

Source from the content-addressed store, hash-verified

56
57
58def make_increasing_ohlc(open, high, low, close, dates, **kwargs):
59 """
60 Makes increasing ohlc sticks
61
62 _make_increasing_ohlc() and _make_decreasing_ohlc separate the
63 increasing trace from the decreasing trace so kwargs (such as
64 color) can be passed separately to increasing or decreasing traces
65 when direction is set to 'increasing' or 'decreasing' in
66 FigureFactory.create_candlestick()
67
68 :param (list) open: opening values
69 :param (list) high: high values
70 :param (list) low: low values
71 :param (list) close: closing values
72 :param (list) dates: list of datetime objects. Default: None
73 :param kwargs: kwargs to be passed to increasing trace via
74 plotly.graph_objs.Scatter.
75
76 :rtype (trace) ohlc_incr_data: Scatter trace of all increasing ohlc
77 sticks.
78 """
79 (flat_increase_x, flat_increase_y, text_increase) = _OHLC(
80 open, high, low, close, dates
81 ).get_increase()
82
83 if "name" in kwargs:
84 showlegend = True
85 else:
86 kwargs.setdefault("name", "Increasing")
87 showlegend = False
88
89 kwargs.setdefault("line", dict(color=_DEFAULT_INCREASING_COLOR, width=1))
90 kwargs.setdefault("text", text_increase)
91
92 ohlc_incr = dict(
93 type="scatter",
94 x=flat_increase_x,
95 y=flat_increase_y,
96 mode="lines",
97 showlegend=showlegend,
98 **kwargs,
99 )
100 return ohlc_incr
101
102
103def make_decreasing_ohlc(open, high, low, close, dates, **kwargs):

Callers 1

create_ohlcFunction · 0.85

Calls 2

_OHLCClass · 0.85
get_increaseMethod · 0.80

Tested by

no test coverage detected