SimAccountService

class zvt.trader.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.account.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) zvt.domain.trader_info.Position

get current position to decide whether order could make

Parameters

entity_id (str) –

Returns

Return type

None

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

  • current_position (Position) –

  • order_amount

  • current_price

  • order_type

order(entity_id, current_price, current_timestamp, order_amount=0, order_pct=1.0, order_price=0, order_type='order_long', order_money=0)
Parameters
  • entity_id

  • current_price

  • current_timestamp

  • order_amount

  • order_pct

  • order_price

  • order_type

  • order_money

Returns