Exemple #1
0
def initialize(context):
    context.asset = symbol('AAPL')

    # Explicitly set the commission to the "old" value until we can
    # rebuild example data.
    # github.com/quantopian/gateway/blob/master/tests/resources/
    # rebuild_example_data#L105
    context.set_commission(commission.PerShare(cost=.0075, min_trade_cost=1.0))
Exemple #2
0
def initialize(context):
    context.stocks = stocks
    context.symbols = [symbol(s) for s in stocks]
    context.sn = 0

    log.info("totoal symbols/stocks {}".format(context.symbols))
    log.info("list of symbols/stockes : {}".format(context.symbols)) \

    log.info("context.data exists : %r" % hasattr(context, "data"))
    log.info("context.watchlists exists : %r" % hasattr(context, "watchlists"))

    log.info("create data object and watchlist objecrt within context")
    context.data = create_data(context.symbols)
    context.watchlists = create_watchlists(context.symbols)

    log.info("done")
    pass
Exemple #3
0
def initialize(context):
    context.symbols = [symbol(s) for s in stocks]
    context.sn = 0
    pass
Exemple #4
0
def handle_data(context, data):
    if not context.has_ordered:
        for stock in context.stocks:
            order(symbol(stock), 100)
        context.has_ordered = True