MCPcopy Create free account
hub / github.com/QuantFans/quantdigger / position

Method position

quantdigger/kernel/engine/strategy.py:243–255  ·  view source on GitHub ↗

当前仓位。 :param str contract: 字符串合约,默认为None表示主合约。 :return: 该合约的持仓数目。 :rtype: int

(self, contract=None)

Source from the content-addressed store, hash-verified

241 ))
242
243 def position(self, contract=None):
244 """ 当前仓位。
245
246 :param str contract: 字符串合约,默认为None表示主合约。
247 :return: 该合约的持仓数目。
248 :rtype: int
249 """
250 try:
251 if not contract:
252 contract = self._main_contract
253 return self.blotter.current_positions[contract].total
254 except KeyError:
255 return 0
256
257 def cash(self):
258 """ 现金。 """

Callers 4

jquery.min.jsFile · 0.80
jquery.min.jsFile · 0.80
on_barMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected