def run_example():
    stocks = set_universe('000300.zicn')
    futures = ['if15%02d' % i for i in range(4, 13)]

    universes = stocks + futures

    strategyRunner(userStrategy=MovingAverageCrossStrategy,
                   symbolList=universes,
                   startDate=dt.datetime(2015, 4, 22),
                   endDate=dt.datetime(2015, 11, 30),
                   benchmark='000300.zicn')
def run_example():
    universe = set_universe('000300.zicn')[:20]
    startDate = dt.datetime(2006, 1, 1)
    endDate = dt.datetime(2015, 10, 1)

    strategyRunner(userStrategy=MovingAverageCrossStrategy,
                   symbolList=universe,
                   startDate=startDate,
                   endDate=endDate,
                   dataSource=DataSource.DataYes,
                   benchmark='000300.zicn',
                   logLevel='info',
                   saveFile=True,
                   plot=True)
Beispiel #3
0
def run_example():
    universe = set_universe('000300.zicn')
    initialCapital = 100000.0
    startDate = dt.datetime(2006, 1, 1)
    endDate = dt.datetime(2015, 10, 1)

    strategyRunner(userStrategy=MovingAverageCrossStrategy,
                   initialCapital=initialCapital,
                   symbolList=universe,
                   startDate=startDate,
                   endDate=endDate,
                   dataSource=DataSource.DataYes,
                   freq=0,
                   benchmark='000300.zicn',
                   saveFile=False,
                   plot=True)