Are trades based on signals lagged? #541
-
My forecasted price and my open price are both in the same dataframe. When I run the backtest, it doesn't buy when the buy condition (forecasted price > open price) is fulfilled, yet it buys the next day despite the sell condition being fulfilled (forecasted price < open price) I've repeatedly checked my code and checked the csv the dataframe is reading, and nothing is suggesting that I formatted the data incorrectly. If someone could follow up with this I'd be grateful. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Just tested it on another ticker, and yes, trade signals are lagged. This is incredibly confusing, especially compounded with the fact that the backtesting model always sells on the last candle... |
Beta Was this translation helpful? Give feedback.
-
IIUC, have you tried with |
Beta Was this translation helpful? Give feedback.
IIUC, have you tried with
trade_on_close=True
?