本文整理汇总了Python中helper.Helper.cleanBeforeTrade方法的典型用法代码示例。如果您正苦于以下问题:Python Helper.cleanBeforeTrade方法的具体用法?Python Helper.cleanBeforeTrade怎么用?Python Helper.cleanBeforeTrade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper.Helper
的用法示例。
在下文中一共展示了Helper.cleanBeforeTrade方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from helper import Helper [as 别名]
# 或者: from helper.Helper import cleanBeforeTrade [as 别名]
class Main:
def __init__(self):
self.dateOfTrade = None
self.mockPredictionObject = None
self.mockTradingObject = None
self.helperObject = Helper()
def getDate(self):
dateEntered = raw_input('\nEnter date (dd-mm-yyyy) : ')
dateList = dateEntered.split('-')
dateList = [int(dateElement) for dateElement in dateList]
self.dateOfTrade = datetime.date(dateList[2], dateList[1], dateList[0])
def main(self):
print '\n1. Prediction \n2. Trading \n'
choice = raw_input('Enter your choice : ')
self.getDate()
if choice == '1':
self.helperObject.cleanBeforeTrade()
self.mockPredictionObject = PredictionModel(self.dateOfTrade)
self.mockPredictionObject.preConfigureModel()
goToTrade = raw_input('\n..Go to trading? (y/n): ')
if goToTrade == 'y':
runAllAtOnce = raw_input('\n..Run all at once? (y/n): ')
self.mockPredictionObject.tradeRun(runAllAtOnce)
else:
print 'Process aborted by user ..'
elif choice == '2':
self.mockTradingObject = TradingEngine(self.dateOfTrade, parameters.amountToBeInvested, parameters.keepTime)
self.mockTradingObject.getStockValuesForDay()
self.mockTradingObject.runTrade('newMethod')
print 'Return Value for trade :', self.mockTradingObject.returnValue
else:
pass