Login Page - Create Account

Support Board


Date/Time: Thu, 02 Jan 2025 23:44:16 +0000



Backtest getting stuck and not testing all my data

View Count: 205

[2024-10-31 10:44:06]
User813832 - Posts: 11
Hi,

I am fairly new to Sierra Charts. I created a new 'spreadsheet system for trading' - it only has one sell condition and I am using the 'Simple Bracket' TPSL that is set up via the trade window. However when I run a backtest, as you can see in the screenshots, it only tests a few dozens days before getting stuck in a position and not testing the rest of the data. Please see attached screen. I have a year of data in the chart but as you can see about 2 weeks in it gets stuck in a position that doesn't close and then it gets stuck there and doesn't take anymore trades for the rest of the 200+ days. For clarity, I have 01/10/23-01/10/24 data loaded in and it gets stuck 03/11/23.

I changed some settings (such as turning reset conditions on new bar and reducing max number of positions) and as you can see in the second screenshot, it got further, but it did not fix the issue.

What is going wrong here? From the two images, I can see that both trades got stuck when the backtest was in a trade when the market gapped up/down due to the fact I have the day session set up. Could that be the problem?

EDIT: It was something to do with the gaps, I fixed the problem by including a sell exit condition (buy to cover) that if the bar number = 81 (the 5min ES session is 81 bars) then exit. This has fixed the issue. However it feels like a "fix" not really a solution. Is there a better way to solve this out there?

Thank you for your help
Date Time Of Last Edit: 2024-10-31 12:22:14
imageSCstucktest.png / V - Attached On 2024-10-31 10:41:06 UTC - Size: 128.69 KB - 45 views
imageSCstuck2re.png / V - Attached On 2024-10-31 11:05:37 UTC - Size: 149.25 KB - 37 views
[2024-10-31 14:29:11]
John - SC Support - Posts: 36966
We really do not have enough information, but it sounds like you did not have an Exit condition setup, and you must have had the Input for "Allow Multiple Entries in Same Direction" set to "No" (the default). In this case, you would not get any additional orders once a position was opened, as that position was never closed.

You have solved this by setting an exit condition, which is what we think you needed.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-10-31 15:41:00]
User813832 - Posts: 11
I agree with you - I think my question is why did those positions never close?

I was under the impression that I did not need to set an exit condition though and could rely on using whatever attached order I had configured? The attached orders work because I have been using them to change the TPSL. I was under the impression that the attached orders are sufficient for fixed values. But the exit conditions are for, obviously, an exit based on a condition. So how come I needed to set an exit condition? I was under the impression that most strategies should work without an exit condition and just the attached orders.
Date Time Of Last Edit: 2024-10-31 15:42:36
[2024-10-31 16:29:05]
John - SC Support - Posts: 36966
Yes, you are correct, the attached orders should take care of closing the position if they are hit. So you would not need an Exit condition in this case.

The only thing we can think of are the following:
- The Target/Stop were never hit, therefore the position was not closed and hence you never got another order.
- The Target/Stop were removed due to the Time in Force setting for them, prior to being hit, therefore the position was never closed.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-10-31 16:57:59]
User813832 - Posts: 11
Hi, I think its the first one of them. Because it only happened when the market gapped - so it must be that the market gapped and never triggered the order and so the trade just never closed. I guess I will always need to include a condition to solve that. Thanks for your help.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account