Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 20:35:38 +0000



Post From: Renko Chart Bar Based Backtesting Flattening Issue

[2024-02-15 14:26:07]
gtaranti - Posts: 68
I'm using an automated trading system with an ASCIL study in a 3-tick Renko chart for Eurostoxx 50 and all in all it's quite nice and performant, compared to the Spreadsheet approach.

It's an intraday strategy, so at the end of the day (22:00 CET) the position (if any) must be flatten.
So, I've set a flatten rule using sc.BaseDataEndDateTime[sc.Index] and after convert it to time I'm comparing with the time 21:00, in which I want every position flattened. Also I set a debug message in Message log to see if it works correctly.

Overall it's working OK and I see messages like :
2024-02-15 12:57:03.021 | Chart: Bar Backtest: FESXH24-EUREX [CBV][M] Renko 3t #1 | Study: VWAP Pullback | Flattening... Time: 21:22:25

But here is the issue:
Many times where the Renko bar closes AFTER 22:00, (due to low volume or anything) the position is kept open beyond the EUREX Exchange close and ofcourse the trade backtest statistics are off.

I've tried also to use the sc.CurrentDateTimeForReplay variable to check for the close position time but without success.

My questions are :

1. Is this problem due to the Renko charts (or any other non-time-based charts)?
2. Can we do something to remedy it while continue using Bar Based Backtesting?
3. Would it be the same if I did a full Replay Backtest?
Date Time Of Last Edit: 2024-02-15 14:27:21