示例#1
0
 def long_margin_ratio(cls, strcontract):
     try:
         ## @todo 确保CONTRACTS.csv里面没有重复的项,否则有可能返回数组.
         return cls.info.ix[strcontract.upper(), 'long_margin_ratio']
     except KeyError:
         logger.warn("Can't not find contract: %s" % strcontract)
         return 1
 def short_margin_ratio(cls, strcontract):
     try:
         return cls._get_info().loc[strcontract.upper(),
                                    'short_margin_ratio']
     except KeyError:
         logger.warn("Can't not find contract: %s" % strcontract)
         return 1
示例#3
0
 def long_margin_ratio(cls, strcontract):
     try:
         ## @todo 确保CONTRACTS.csv里面没有重复的项,否则有可能返回数组.
         return cls.info.ix[strcontract.upper(), 'long_margin_ratio']
     except KeyError:
         logger.warn("Can't not find contract: %s" % strcontract)
         return 1
示例#4
0
 def volume_multiple(cls, strcontract):
     try:
         return cls.info.ix[strcontract.upper(), 'volume_multiple']
     except KeyError:
         logger.warn("Can't not find contract: %s" % strcontract)
         return 1
示例#5
0
 def volume_multiple(cls, strcontract):
     try:
         return cls.info.ix[strcontract.upper(), 'volume_multiple']
     except KeyError:
         logger.warn("Can't not find contract: %s" % strcontract)
         return 1
示例#6
0
 def short_margin_ratio(cls, strcontract):
     try:
         return cls.info.ix[strcontract.upper(), 'short_margin_ratio']
     except KeyError:
         logger.warn("Can't not find contract: %s" % strcontract)
         return 1