Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 06:27:34 +0000



Study output becomes incorrect when backtest is started

View Count: 267

[2023-09-12 03:43:33]
User635871 - Posts: 6
Hi,
in my study, I use the function sc.Highest to calculate the highest high of the trading day (inraday). I use sc.GetFirstIndexForDate to get the index of the first bar of the trading day and use it to calculate the length needed for sc.Highest. Everything works well until I start the Backtest. With the first day of the backtest period, my highest high calculation gets messed up completely. I checked the bar and study data several times, and the miscalculations start exactly with the backtest period. What is a possible reason for that?
[2023-09-12 13:13:47]
Sierra_Chart Engineering - Posts: 17190
Does the custom study reference other charts, or only the chart which contains it?

When a back test is starting, make sure there are more bars in the chart than the study functions are referencing. Or solve the problem in the study so it is able to handle condition where there is less data available than it needs.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-09-12 14:31:56]
User635871 - Posts: 6
The study does not reference other charts. The study itself is referenced by another study for automated trading, but both studies are on the same chart. I loaded far more days than I use for backtesting and sc.Highest is only used after the study has processed its first 5 days. But in the beginning(first 100 days), everything works as it is supposed to. When I export the bar and study data to check it, I see that the calculations are correct until the start day of the backtest. From there on, everything is false. It is simply not clear to me why everything changes when the backtest starts and how this can even be affected by backtesting.
Date Time Of Last Edit: 2023-09-12 14:37:11
[2023-09-13 17:50:01]
Sierra_Chart Engineering - Posts: 17190
This is really impossible for us to say without in-depth debugging which is outside the scope of our support:
Automated Trading Management: Troubleshooting Automated Trading System Behavior
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2023-09-13 17:50:52
[2023-09-13 18:12:49]
User635871 - Posts: 6
Hi,
there is no debugging needed. Today I uninstalled and then reinstalled the new version of Sierra Charts and now everything works as it should.

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

Login

Login Page - Create Account