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

Method get_candle_increase

plotly/figure_factory/_candlestick.py:231–253  ·  view source on GitHub ↗

Separate increasing data from decreasing data. The data is increasing when close value > open value and decreasing when the close value <= open value.

(self)

Source from the content-addressed store, hash-verified

229 self.get_candle_increase()
230
231 def get_candle_increase(self):
232 """
233 Separate increasing data from decreasing data.
234
235 The data is increasing when close value > open value
236 and decreasing when the close value <= open value.
237 """
238 increase_y = []
239 increase_x = []
240 for index in range(len(self.open)):
241 if self.close[index] > self.open[index]:
242 increase_y.append(self.low[index])
243 increase_y.append(self.open[index])
244 increase_y.append(self.close[index])
245 increase_y.append(self.close[index])
246 increase_y.append(self.close[index])
247 increase_y.append(self.high[index])
248 increase_x.append(self.x[index])
249
250 increase_x = [[x, x, x, x, x, x] for x in increase_x]
251 increase_x = utils.flatten(increase_x)
252
253 return increase_x, increase_y
254
255 def get_candle_decrease(self):
256 """

Callers 2

__init__Method · 0.95
make_increasing_candleFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected