SimAccountService

class zvt.trader.sim_account.SimAccountService(entity_schema: zvt.contract.schema.TradableEntity, trader_name, timestamp, provider=None, level=IntervalLevel.LEVEL_1DAY, base_capital=1000000, buy_cost=0.001, sell_cost=0.001, slippage=0.001, rich_mode=True, adjust_type: Optional[zvt.contract.AdjustType] = None, keep_history=False, real_time=False, kdata_use_begin_time=False)

Bases: zvt.trader.AccountService

__init__(entity_schema: zvt.contract.schema.TradableEntity, trader_name, timestamp, provider=None, level=IntervalLevel.LEVEL_1DAY, base_capital=1000000, buy_cost=0.001, sell_cost=0.001, slippage=0.001, rich_mode=True, adjust_type: Optional[zvt.contract.AdjustType] = None, keep_history=False, real_time=False, kdata_use_begin_time=False)
get_current_position(entity_id, create_if_not_exist=False) Optional[zvt.domain.trader_info.Position]

get position for entity_id

Parameters
  • entity_id – the entity id

  • create_if_not_exist – create an empty position if not exist in current account

Returns

update_position(current_position, order_amount, current_price, order_type, timestamp)
Parameters
  • timestamp

  • current_position (Position) –

  • order_amount

  • current_price

  • order_type