コード例 #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
コード例 #2
0
 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
ファイル: datastruct.py プロジェクト: oxmcvusd/quantdigger
 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
ファイル: datastruct.py プロジェクト: oxmcvusd/quantdigger
 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
ファイル: datastruct.py プロジェクト: oxmcvusd/quantdigger
 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