kernc

Results 397 comments of kernc

> This worked pretty good ! Great, so we can change it in the source and hopefully fix similar issues for everyone. Thanks! > What's this for ? > >...

https://github.com/kernc/backtesting.py/blob/65f54f6819cac5f36fd94ebf0377644c62b4ee3d/backtesting/backtesting.py#L1147-L1150 Your "ema" has length 200, so the line-enabled backtest skips the first 199 candles where the indicator is undefined. Maybe that should be indicated somehow. :thinking:

Afaik, there were no prior efforts of getting real, live trading in. I guess `_Broker` is certainly to be overridden. Just please do base your findings upon #47 as I...

I envision live trading by way of a separate class, in Python type notation, say: ```py from typing import Type, Union, Literal, NoReturn LiveTrade(strategy: Type[Strategy], period: str, broker: Union[Literal["ib", "oanda",...

Data acquisition can surely be handled by the chosen broker (i.e. `Broker`)? Broker implementations should take their configuration parameters from `**kwargs`.

I've actually been meaning to but just didn't come round to trying it out and seeing what happens when positions are indeed sized as Kelly Criterion recommends. Say I run...

Related issue: https://github.com/kernc/backtesting.py/issues/115 I'm not too sure how the expanded complexity would fit into the existing framework ...

[`Trade.value`](https://kernc.github.io/backtesting.py/doc/backtesting/backtesting.html#backtesting.backtesting.Trade.value) observes the _current_ price, not entry price ... https://github.com/kernc/backtesting.py/blob/65f54f6819cac5f36fd94ebf0377644c62b4ee3d/backtesting/backtesting.py#L615-L619

Maybe [`Strategy.equity`](https://kernc.github.io/backtesting.py/doc/backtesting/backtesting.html#backtesting.backtesting.Strategy.equity&gsc.tab=0), e.g. ```py cash = self.equity - sum(t.value for t in self.trades)

My formula, I believe, gives _cash on hand_. `Trade.value` assumed the current asset price, but so does [`Strategy.equity`](https://kernc.github.io/backtesting.py/doc/backtesting/backtesting.html#backtesting.backtesting.Strategy.equity)! Then again, `Strategy.equity` adds [**`Trade.pl`**](https://kernc.github.io/backtesting.py/doc/backtesting/backtesting.html#backtesting.backtesting.Trade.pl) values ... https://github.com/kernc/backtesting.py/blob/65f54f6819cac5f36fd94ebf0377644c62b4ee3d/backtesting/backtesting.py#L754-L755 I'm not quite certain...