PositionLong

class czsc.objects.PositionLong(symbol: str, hold_long_a: float = 0.5, hold_long_b: float = 0.8, hold_long_c: float = 1.0, long_min_interval: Optional[int] = None, cost: float = 0.003, T0: bool = False)[source]

Bases: object

Attributes Summary

pos

返回状态对应的仓位

Methods Summary

evaluate_operates()

评估操作表现

operates_to_pair(operates)

返回买卖交易对

update(dt, op, price, bid[, op_desc])

更新多头持仓状态

Attributes Documentation

pos

返回状态对应的仓位

Methods Documentation

evaluate_operates()[source]

评估操作表现

operates_to_pair(operates)[source]

返回买卖交易对

update(dt: datetime, op: Operate, price: float, bid: int, op_desc: str = '')[source]

更新多头持仓状态

Parameters:
  • dt – 最新时间

  • op – 操作动作

  • price – 最新价格

  • bid – 最新1分钟Bar ID

  • op_desc – 触发操作动作的事件描述

Returns:

None