About Backtesting Marubozu

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

Hello, why here compare yesterday's entry with current position?

https://i.imgur.com/OYn8x8R.png

Why we don't compare data["entry_signal"].iloc[index] instead of iloc[index-1]?

Hi Daniel,



We have set the entry_signal as 1 when pattern_signal is 100. As explained in the previous notebook (Section 3 Unit 1), pattern_signal of 100 indicates a bullish marubozu formation. 



This means, the entry_signal is set to 1 wherever there’s a bullish marubozu formation.



The entry condition is as follows:

We will enter the trade at the Open of the current candle if the previous candle is a bullish marubozu. This means, if yesterday's candle is a bullish marubozu we will enter at today's Open.



Therefore, we are simply checking if the previous candle is a bullish marubozu and that there are no current positions. After checking this we can enter a trade.



Hope this helps!



Thanks

Rushda

Yes, very clear! Thanks Rushda!