Second day trying to learn Python. Just trying to copy the Sample Algorithm for a Basic Strategy 1. Why am I getting an invalid syntax on line 27(bar_count=5)? Any help is much appreciated.
Second day trying to learn Python. Just trying to copy the Sample Algorithm for a Basic Strategy 1. Why am I getting an invalid syntax on line 27(bar_count=5)? Any help is much appreciated.
try bar_count = 5
with a space before and after the =
if not we may need to see lines 26,27,28 from your code
space before and after did not work.
lines 24-30:
price_history = data.history(
context.security,
fields='price'
bar_count = 5
frequency = '1d')
Try putting a "," after the line fields='price' - and also after bar_count = 5.
These are parameters to a function and need to be separated by a comma:
price_history = data.history(
context.security,
fields='price',
bar_count = 5,
frequency = '1d')
Thank you Dirk.
Any insight into this:
https://www.quantopian.com/posts/how-to-calculate-the-cash-available