We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi guys, Am i missing something or trade.entry_time does not exists? 'Trade' object has no attribute 'entry_time'
'Trade' object has no attribute 'entry_time'
I would like to know when did i "open" my position. I was using the position.open_time in 0.1.8.
In 0.1.8, this is working :
if self.position: [....] if next_marketday(self.position.open_time, 35) <= self.data.index[-1]:
In 0.2.0, this is not working :
if self.position: [....] if next_marketday(self.trades[-1].entry_time, 35) <= self.data.index[-1]:
In backtesting.py line 502 looks like there is no property entry_time...
class Trade: """ When an `Order` is filled, it results in an active `Trade`. Find active trades in `Strategy.trades` and closed, settled trades in `Strategy.closed_trades`. """ def __init__(self, broker: '_Broker', size: int, entry_price: float, entry_bar): self.__broker = broker self.__size = size self.__entry_price = entry_price self.__entry_bar = entry_bar self.__exit_price = None self.__exit_bar = None self.__sl_order = None # type: Optional[Order] self.__tp_order = None # type: Optional[Order]
EDIT : Is this the good way ? self.data.index[self.trades[-1].entry_bar] to get the entry date?
self.data.index[self.trades[-1].entry_bar]
The text was updated successfully, but these errors were encountered:
0363e88
ENH: Add Trade.entry_time/.exit_time
Trade.entry_time/.exit_time
3cc33b8
Refs: #47 (comment) Fixes: #117
Thanks for the report! Trade.{entry,exit}_time added in 3cc33b8; be in a patch release shortly. Yours was the correct alternative. 👍
Trade.{entry,exit}_time
Sorry, something went wrong.
66842f0
Refs: kernc/backtesting.py#47 (comment) Fixes: kernc/backtesting.py#117
No branches or pull requests
Hi guys,
Am i missing something or trade.entry_time does not exists?
'Trade' object has no attribute 'entry_time'
Expected Behavior
I would like to know when did i "open" my position. I was using the position.open_time in 0.1.8.
Actual Behavior
In 0.1.8, this is working :
In 0.2.0, this is not working :
In backtesting.py line 502 looks like there is no property entry_time...
EDIT :
Is this the good way ?
self.data.index[self.trades[-1].entry_bar]
to get the entry date?
The text was updated successfully, but these errors were encountered: