Example #1
0
 def do_backtest(self, arg):
     paramFlag = input('Use current parameters? ([y]/n): ')
     if paramFlag is 'n':
     #   Change parameters here
         bbFunctions.choose_parameters()
     numLinesLog = bbFunctions.file_len(bbCfg.logFileName) 
     bbCfg.logFileNameBT = bbFunctions.getLogFileNameBT()
     try:
         numLinesLogBT = bbFunctions.file_len(bbCfg.logFileNameBT)
     except:
         numLinesLogBT = 0
     if numLinesLogBT != numLinesLog:
         bitbot.main('-b')
     d,r=bbPerformance.getReturns(bbCfg.logFileNameBT, None, '2014-01-08', None)
     bbPerformance.printSummary(r)
Example #2
0
 def do_performance(self, arg):
     startDate = input('Initial Date (YYYY-MM-DD): ')
     if len(startDate) is not 10:
         startDate = '2014-01-08'
     endDate   = input('End Date (YYYY-MM-DD): ')
     if len(endDate) is not 10:
         endDate = None
     chooseBT = input('Calculate performance for backtest? y/[n]: ')
     if chooseBT == 'y':
         bbCfg.logFileNameBT = bbFunctions.getLogFileNameBT() 
         d,r=bbPerformance.getReturns(bbCfg.logFileNameBT, None,
                                      startDate, endDate)
     else:
         d,r=bbPerformance.getReturns(bbCfg.logFileName, bbCfg.fundFileName,
                                      startDate, endDate)
     bbPerformance.printReturns(d, r)
     print('')
     bbPerformance.printSummary(r)