During the backtesting, when there is no cash left to proceed entry signals. They are abandoned at that bar. Next bar will proceed the new signals occur on thay bar only.
If I want to keep the abadoned entry signal , and consider it for the next bar whether they are better than the new signals. Do I need custom backtesting ?
To be more clarity, I want to keep all unexecuted entry signals (due to insuffifcient cash) until some criterias are met.
Moderator comment: topic subjects should be informative and reflect post content. Your “is custom backtest needed” wasn’t. I changed it to reflect actual content of the question.
You do NOT need custom backtester. For 99% of uses (especially by newbies) you DO NOT need custom backtester.
To keep signals you have to have them IN STATE form as opposed to Signal (Pulse) form.
State_Form = Close > MA( Close, 10 ); // state form keeps 'true' for many bars
Signal_Form = Cross( Close, MA( Close, 10 ) ); // signal (pulse) form - one bar only
To convert from signal to state you can use Flip() function.
Thanks for asking this question! And Thanks to Tomasz for the clear answer, for whatever reasons the concept of signal v/state is a light bulb moment for me.
How do we reset the state form for a new day as it would happen in real life when we restart the code. The backtest carries forward the form from previous day which leads to deviation in test results