Reputation: 1190
for symbol in symbols:
data = con.get_candles(symbol, period='D1', start = start, end = end)
data1 = con.get_candles('USOil', period='D1', start = start1, end = end)
ax = data['bidclose'].plot()
data1['bidclose'].plot(ax=ax)
I have used the code above in the hope that it will plot symbol
and usoil
in 1 chart and then produce another chart with the next in line symbol
and usoil
until all the symbol list has been exhaused. However evertything is getting plotted in the same chart.
How can i use the for-loop where 1 symbol in the list of symbols and usoil get plotted? Thus there will be n numbers of plots where n is the number of symbol in symbols.
Upvotes: 0
Views: 331
Reputation: 1143
Just put plt.show()
in your routine:
for symbol in symbols:
data = con.get_candles(symbol, period='D1', start = start, end = end)
data1 = con.get_candles('USOil', period='D1', start = start1, end = end)
ax = data['bidclose'].plot()
data1['bidclose'].plot(ax=ax)
plt.show()
Upvotes: 1