728x90
Broker Simulator
더보기
Supported order types - the params are not controlled by the user
- Market : open price 에 거래 설정
- Close : close price 에 거래 설정
- Limit : given limit price 에 거래 설정
- Stop : given stop price 에 거래 설정
- StopLimit : given stop price 에 limit 거래 설정
Params
더보기
- cash (default: 10000) - starting cash
- commission (default: CommInfoBase(percabs=True)) - base commission scheme
- checksubmit (default: True) - check margin/cash before order
- eosbar (default: False)
- filler (default: None) - A callable with signature: callable(order, price, ago)
- order : the order in execution
- price : the price at which the order is going to be executed
- ago : index for ohlcv
- slip_perc (default: 0.0) - slip prices Percentage in absolute termns
- 0.01 is 1%
- 0.001 is 0.1%
- slip_fixed (default: 0.0) - slip prices Percentage in units
- slip_open (default: False) - slip prices for order execution used the opening price of the next bar
- slip_match (default: True)
- True - broker will offer a match by capping slippage at high/low prices
- False - broker will not match the order with the current prices
- slip_limit (default: True) - given the exact match price requested & if slip_match is False.
- True - Limit orders will be matched by capping prices to the limit / high/low
- False - False and slippage exceeds the cap, then there will be no match
- slip_out (default: False) - Provide slippage even if the price falls outside the high - low range.
- coc (default: False) - Cheat-On-Close Setting this to True with set_coc enables
- int2pnl (default: True) - 현금에 대한 이자 부여
- shortcash (default: True)
- True - 공매도할때 현금증가
- False - 현금에서 운용비용 빼기
- fundstartval (default: 100.0) - 순자산 가치 자산 측정 조절 -> 펀드의 가치 측정 가능
- fundmode (default: False)
- True - TimeReturn can automatically calculate returns based on the fund value
Function
더보기
- set_cash(cash)
- get_cash()
- get_value(datas=None, mkt=False, lever=False)
- set_eosbar(eosbar)
- set_checksubmit(checksubmit)
- set_filler(filler)
- set_coc(coc)
- set_int2pnl(int2pnl)
- set_fundstartval(fundstartval)
- set_slippage_perc(perc, slip_open=True, slip_limit=True, slip_match=True, slip_out=False)
- set_slippage_fixed(fixed, slip_open=True, slip_limit=True, slip_match=True, slip_out=False)
- get_orders_open(safe=False)
- getcommissioninfo(data)
- setcommission(commission=0.0, margin=None, mult=1.0, commtype=None, percabs=True, stocklike=False, interest=0.0, interest_long=False, leverage=1.0, automargin=False, name=None)
- addcommissioninfo(comminfo, name=None)
- getposition(data)
- get_fundshares()
- get_fundvalue()
- add_cash(cash)
'금융공학 > BackTrader 공부' 카테고리의 다른 글
BackTrader 6 : Orders (0) | 2021.12.30 |
---|---|
BackTrader 5 : Indicators (0) | 2021.12.29 |
BackTrader 1 : Concepts (0) | 2021.12.24 |
BackTrader 4 : Strategy (0) | 2021.12.23 |
BackTrader 3 : DataFeed (0) | 2021.12.21 |