Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Bollinger Bands

Hello All,

This is what I had in mind but I don't know why it works. (The Upper and Lower labels are reversed.)

Regards,

Peter

1 response

def handle_data(context, data):
if str(data['CMG'].datetime.year) == "2011":
record(CMG=data['CMG'].price)
record(Upper=data['CMG']['LOWER_BB'])
record(MA20=data['CMG']['MA20'])
record(Lower=data['CMG']['UPPER_BB'])

Your setting "Upper" as "LOWER_BB" and "Lower" as "UPPER_BB"