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

Hey all,

Sorry total noob! If there is not an easy fix for this problem that is fine, just looking for explanation as to why I keep getting an error for context.init_stop_price on line 140 -- specifically:
price * context.initial_short_stop

Thanks!

2 responses

You need to tell Python somewhere that "context.init_stop_price" and "context.stop_price" are dictionaries. Putting the following into the "initialize" method is one way.

    context.init_stop_price = {}  
    context.stop_price = {}

Good luck.

Perfect Dan. Thanks!