I've been trying to modify the simple example provided and make it randomly trade as long as it stays within it's notional limits. When running I get the following error:
Something went wrong on our end and we've been notified about it. Sorry for the inconvenience.
OSError:
File test_algorithm_sycheck.py:6, in initialize
File random.py:111, in seed
Am I doing something wrong, is this an actual problem with Quantopian?
import random
def initialize(context):
context.aapl = sid(24)
random.seed(None)
context.max_notional = 1000000.1
context.min_notional = -1000000.0
def handle_data(context, data):
price = data[context.aapl].price
notional = context.portfolio.positions[context.aapl].amount * price
if random.randrange(0,1) == 0 and notional > context.min_notional:
order(context.aapl,-100)
elif notional < context.max_notional:
order(context.aapl,+100)