MockBroker#

Constructor#

MockBroker(clock, position_provider[, ...])

백테스팅을 위한 가상의 브로커 클래스입니다.

Attributes#

clock

백테스팅 시간 제어를 위한 가상 시계

cash

현재 보유 현금

trading_history

거래 이력

position_provider

초기 포지션 정보 제공자

time_unit

거래 시간 단위 ("minutes" 또는 "days")

Methods#

set_initial_cash(cash)

초기 자본금을 설정합니다.

get_daily_price(code[, from_date, end_date])

특정 기간 동안의 일별 가격 데이터를 조회합니다.

get_minute_price(code)

self.clock 기준 오늘 정규장 시작부터 현재 시각 (이전) 까지의 분봉 데이터를 조회합니다.

get_price(code)

특정 종목의 현재 가격을 조회합니다.

get_pending_orders()

미체결된 모든 주문을 조회합니다.

get_positions()

모든 종목의 현재 포지션을 조회합니다.

create_order(asset_code, side, quantity[, ...])

새로운 주문을 생성합니다.

update_order(org_order_no, order_type, price)

기존 주문을 수정합니다.

cancel_order(order_no[, quantity])

주문을 취소합니다.

show_trading_history_report([make_file, ...])

거래 이력 보고서를 생성하고 표시합니다.

show_positions([sort])

현재 보유 중인 포지션 현황을 표시합니다.