MCPcopy Create free account
hub / github.com/kernc/backtesting.py / dummy_stats

Function dummy_stats

backtesting/_stats.py:203–212  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

201
202
203def dummy_stats():
204 from .backtesting import Trade, _Broker
205 index = pd.DatetimeIndex(['2025'])
206 data = pd.DataFrame({col: [np.nan] for col in ('Close',)}, index=index)
207 trade = Trade(_Broker(data=data, cash=10000, spread=.01, commission=.01, margin=.1,
208 trade_on_close=True, hedging=True, exclusive_orders=False, index=index),
209 1, 1, 0, None)
210 trade._replace(exit_price=1, exit_bar=0)
211 trade._commissions = np.nan
212 return compute_stats([trade], np.r_[[np.nan]], data, None, 0)

Callers 1

optimizeMethod · 0.85

Calls 4

_replaceMethod · 0.95
TradeClass · 0.85
_BrokerClass · 0.85
compute_statsFunction · 0.70

Tested by 1

optimizeMethod · 0.68