HolderTradingRecorder

class zvt.recorders.eastmoney.trading.eastmoney_holder_trading_recorder.HolderTradingRecorder(force_update=False, sleeping_time=5, exchanges=None, entity_id=None, entity_ids=None, code=None, codes=None, day_data=False, entity_filters=None, ignore_failed=True, real_time=False, fix_duplicate_way='add', start_timestamp=None, end_timestamp=None, return_unfinished=False)

Bases: zvt.recorders.eastmoney.common.EastmoneyMoreDataRecorder

__init__(force_update=False, sleeping_time=5, exchanges=None, entity_id=None, entity_ids=None, code=None, codes=None, day_data=False, entity_filters=None, ignore_failed=True, real_time=False, fix_duplicate_way='add', start_timestamp=None, end_timestamp=None, return_unfinished=False) None
data_schema

alias of zvt.domain.fundamental.trading.HolderTrading

get_data_map()

{‘original_field’:(‘domain_field’,transform_func)}

generate_domain_id(entity, original_data)

generate domain id from the entity and original data,the default id meaning:entity + event happen time

Parameters
  • entity

  • original_data

  • time_fmt

Returns

Return type

clear_state_data(entity_id=None)

clear state of the entity

Parameters

entity_id – entity id

decode_state(state: str)

decode state

Parameters

state

Returns

encode_state(state: object)

encode state

Parameters

state

Returns

entity_schema

alias of zvt.domain.meta.stock_meta.StockDetail

generate_domain(entity, original_data)

generate the data_schema instance using entity and original_data,the original_data is from record result

Parameters
  • entity

  • original_data

get_evaluated_time_field()

the timestamp field for evaluating time range of recorder,used in get_latest_saved_record

init_entities()

init the entities which we would record data for

persist(entity, domain_list)

persist the domain list to db

Parameters
  • entity

  • domain_list

record(entity_item, start, end, size, timestamps)

implement the recording logic in this method, should return json or domain list

Parameters
  • entity

  • start

  • end

  • size

  • timestamps

state_schema

alias of zvt.contract.zvt_info.RecorderState

exchanges

setup the entities you want to record

entity_ids

set entity_ids or (entity_type,exchanges,codes)

session

using to do db operations