Wrong codes for calculating strategy returns

Course Name: Candlestick Patterns based Automated Trading, Section No: 4, Unit No: 7, Unit type: Notebook

For the equity curve section,

Calculate strategy returns

data[‘Strategy_Returns’] = data.trade_signal.shift(1) * data.Close.pct_change()

Since the strategy performs buy at Open (trade signal 1 for the row) and exit at Close (trade signal 0 for the row), the code seems incorrect as it assumes buy at previous close.

Thank you Herish, for bringing this to light. We are working on this.