class CLOSUREOPT(INVTRAN, SECID): optaction = OneOf('EXERCISE', 'ASSIGN', 'EXPIRE') units = Decimal(required=True) shperctrct = Integer(required=True) subacctsec = OneOf(*INVSUBACCTS, required=True) relfitid = String(255) gain = Decimal()
class OPTINFO(SECINFO): opttype = OneOf('CALL', 'PUT', required=True) strikeprice = Decimal(required=True) dtexpire = DateTime(required=True) shperctrct = Integer(required=True) assetclass = OneOf(*ASSETCLASSES) fiassetclass = String(32) def __init__(self, elem): """ Strip SECID of underlying so it doesn't overwrite SECID of option during _flatten() """ # Do all XPath searches before removing nodes from the tree # which seems to mess up the DOM in Python3 and throw an # AttributeError on subsequent searches. secid = elem.find('./SECID') if secid is not None: # A <SECID> aggregate referring to the security underlying the # option is, in general, *not* going to be contained in <SECLIST> # (because you don't necessarily have a position in the underlying). # Since the <SECID> for the underlying only gives us fields for # (uniqueidtype, uniqueid) we can't really go ahead and use this # information to create a corresponding SECINFO instance (since we # lack information about the security subclass). It's unclear that # the SECID of the underlying is really needed for anything, so we # disregard it. elem.remove(secid) super(OPTINFO, self).__init__(elem)
class OPTINFO(SECINFO): opttype = OneOf('CALL', 'PUT', required=True) strikeprice = Decimal(required=True) dtexpire = DateTime(required=True) shperctrct = Integer(required=True) assetclass = OneOf(*ASSETCLASSES) fiassetclass = String(32)
class STMTTRN(TRAN, ORIGCURRENCY): trntype = OneOf('CREDIT', 'DEBIT', 'INT', 'DIV', 'FEE', 'SRVCHG', 'DEP', 'ATM', 'POS', 'XFER', 'CHECK', 'PAYMENT', 'CASH', 'DIRECTDEP', 'DIRECTDEBIT', 'REPEATPMT', 'OTHER', required=True) dtposted = DateTime(required=True) dtuser = DateTime() dtavail = DateTime() trnamt = Decimal(required=True) correctfitid = Decimal() correctaction = OneOf('REPLACE', 'DELETE') checknum = String(12) refnum = String(32) sic = Integer() payeeid = String(12) name = String(32) memo = String(255) inv401ksource = OneOf(*INV401KSOURCES) payee = None bankacctto = None ccacctto = None
class STATUS(Aggregate): code = Integer(6, required=True) severity = OneOf('INFO', 'WARN', 'ERROR', required=True) message = String(255)
class SELLOPT(INVSELL): optselltype = OneOf('SELLTOCLOSE', 'SELLTOOPEN', required=True) shperctrct = Integer(required=True) relfitid = String(255) reltype = OneOf('SPREAD', 'STRADDLE', 'NONE', 'OTHER') secured = OneOf('NAKED', 'COVERED')
class BUYOPT(INVBUY): optbuytype = OneOf('BUYTOOPEN', 'BUYTOCLOSE', required=True) shperctrct = Integer(required=True)