Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
x = 0
y = len(self.dates)
newAr = []
while x < y:
appendLine = self.dates[x], self.opens[x], self.closes[x], self.highs[x], self.lows[x], self.volumes[x]
newAr.append(appendLine)
x += 1
# Fix this
SP = len(self.dates[200-1:])
fig = plt.figure(facecolor='#07000d')
ax1 = plt.subplot2grid(
(6, 4), (1, 0), rowspan=4, colspan=4, facecolor='#07000d')
candlestick_ohlc(ax1, newAr[-SP:], width=.6,
colorup='#53c156', colordown='#ff1717')
for MA in movingAverageArr:
computedSMA = self.SMA(MA, self.closes)
# Used to generate random hex color to put on graph
def r(): return random.randint(0, 255)
randomColor = '#%02X%02X%02X' % (r(), r(), r())
maLabel = str(MA) + ' SMA'
ax1.plot(self.dates[-SP:], computedSMA[-SP:], randomColor,
label=maLabel, linewidth=1.5)
ax1.grid(False, color='w')
ax1.xaxis.set_major_locator(mticker.MaxNLocator(10))