def testStrategy():
    strat = thrSMA
    instrument = '600288'
    market = 'SH'
    fromDate = '20150101'
    toDate = '20150601'
    frequency = bar.Frequency.MINUTE
    plot = True
    paras = [2, 20, 60, 10]
    feeds = tushare.build_feed([instrument], 2016, 2017, 'histdata/tushare')
    strat = strat(feeds, instrument, *paras)
    retAnalyzer = returns.Returns()
    strat.attachAnalyzer(retAnalyzer)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)
    drawDownAnalyzer = drawdown.DrawDown()
    strat.attachAnalyzer(drawDownAnalyzer)
    tradesAnalyzer = trades.Trades()
    strat.attachAnalyzer(tradesAnalyzer)
    strat.run()
    sharp = sharpeRatioAnalyzer.getSharpeRatio(0.05)
    maxdd = drawDownAnalyzer.getMaxDrawDown()
    return_ = retAnalyzer.getCumulativeReturns()[(- 1)]
    return_list = []
    for item in retAnalyzer.getCumulativeReturns():
        return_list.append(item)
def testStrategy():
    strat = thrSMA
    instrument = '600288'
    market = 'SH'
    fromDate = '20150101'
    toDate = '20150601'
    frequency = bar.Frequency.MINUTE
    plot = True
    paras = [2, 20, 60, 10]
    feeds = tushare.build_feed([instrument], 2016, 2017, 'histdata/tushare')
    strat = strat(feeds, instrument, *paras)
    retAnalyzer = returns.Returns()
    strat.attachAnalyzer(retAnalyzer)
    sharpeRatioAnalyzer = sharpe.SharpeRatio()
    strat.attachAnalyzer(sharpeRatioAnalyzer)
    drawDownAnalyzer = drawdown.DrawDown()
    strat.attachAnalyzer(drawDownAnalyzer)
    tradesAnalyzer = trades.Trades()
    strat.attachAnalyzer(tradesAnalyzer)
    strat.run()
    sharp = sharpeRatioAnalyzer.getSharpeRatio(0.05)
    maxdd = drawDownAnalyzer.getMaxDrawDown()
    return_ = retAnalyzer.getCumulativeReturns()[(- 1)]
    return_list = []
    for item in retAnalyzer.getCumulativeReturns():
        return_list.append(item)