Пример #1
0
 def underlyer(self):
     underlyer = Contract()
     underlyer.symbol = self.statData.buyWrite["underlyer"]["@tickerSymbol"]
     underlyer.avPrice = self.statData.inistkprice
     underlyer.secType = "STK"
     underlyer.exchange = "SMART"
     underlyer.currency = "USD"
     return underlyer
Пример #2
0
    def option(self):
        option = Contract()
        option.symbol = self.statData.buyWrite["underlyer"]["@tickerSymbol"]
        option.avPrice = self.statData.inioptprice
        option.secType = "OPT"
        option.exchange = "SMART"
        option.currency = "USD"
        option.lastTradeDateOrContractMonth = self.statData.expiry
        option.strike = self.statData.strike
        option.right = "Call"
        option.multiplier = "100"

        return option
Пример #3
0
    def getRolledOption(self, r):
        option = Contract()
        option.symbol = self.statData.buyWrite["underlyer"]["@tickerSymbol"]
        option.avPrice = r["sellprice"]
        option.secType = "OPT"
        option.exchange = "SMART"
        option.currency = "USD"
        option.lastTradeDateOrContractMonth = r['to']
        option.strike = r['strike']
        option.right = "Call"
        option.multiplier = "100"

        return option