catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Question: Daily timeframe backtesting

Open lamres opened this issue 5 years ago • 2 comments

Hi, everyone! I got a question about backtesting. My strategy sends a signal once a day, e.g. at the end of the day. I want that the executed price would be closer to the open price of the next day. I can achieve that when I use a minute timeframe, but this is very slow. Daily timeframe allows to increase the speed, but the price has been gone far.

How can I get a precision of price that very close of the next open bar saving the backtesting speed of daily timeframe?

lamres avatar Feb 25 '19 22:02 lamres

you have to define a custom slippage function that has the trade execute at the open of the next bar instead of the close of the next bar, as the default slippage does. Otherwise, yeah, daily backtesting is basically useless.

SOGorman35 avatar Apr 16 '19 10:04 SOGorman35

@SOGorman35 Thanks for your answer! Have you got the example of function redefining? It will be very useful.

lamres avatar Apr 16 '19 18:04 lamres