Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
data.history(context.my_stock, "price", bar_count=30, frequency="1d")

Hi People,

I'm trying to put in and int variable for bar_count and keep getting the following error.
Can somebody give me some advise on this?
eg.
When I key in bar_count= 10, the code run fine

when I key in bar_count = day, i have the following error
ValueError: Shape of passed values is (2, 1), indices imply (2, 0)

1 response

Hi see-choon oo,

Are you trying to access the price of the most recent bar for your stock?