kernc

Results 458 comments of kernc

Could be https://github.com/kernc/backtesting.py/issues/1002, but your data and the chart say UTC. 🤷 This is strange. I don't think plotting should change OHLC values. 🤔 Assuming it's indeed some offset issue,...

Finalizing open trades on the last bar was made optional in https://github.com/kernc/backtesting.py/pull/393 (to be released shortly). After a backtest run, you can always access open trades via the strategy instance:...

Have you seen [`backtesting.lib.FractionalBacktest`](https://kernc.github.io/backtesting.py/doc/backtesting/lib.html#backtesting.lib.FractionalBacktest)?

We maintain it reasonably simple and convenient to compute many custom stats on your own, e.g.: ```py def long_trades(stats): return (stats._trades.Size > 0).sum() def long_short_ratio(stats): is_long = stats._trades.Size > 0...

Ok ... But why add it when you can compute it so easily yourself? 😳

The code is assuming length of data will be greater than the number of indicators returned. I 'd say this needs a bit stricter condition check.

Does this mean changing the condition heuristic to something like: ```py # Assuming no more than 10 indicator lines are computed at once if is_arraylike and np.argmax(value.shape) == 0 and...

Can you also make the source code suggestion? 😅 Trying both ways of having it configurable is imho the only good solution, because some heavy deps can be hidden exactly...