Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 13:14:07 +0000



Is there a way to detect the last bar of the simulation during Autotrade BackTest?

View Count: 572

[2020-04-12 11:18:16]
User909904 - Posts: 14
Hello,
Is there a way to detect that the autotrade is processing the last bar of the simulation during Autotrade BackTest?
Is there a variable that indicates that? I was unable to find that.
When sc.IsReplayRunning() turns from 1 -> I would like to run the cleanup but still within the simulation.
I would like to close all positions at the end of the BackTest so they add up correctly in the statistics and do a dynamic variables cleanup.

Thanks!
[2020-04-14 03:09:11]
Sierra Chart Engineering - Posts: 104368
We some time to look into this.

However, even when the back test finishes, it is fine to close out position and cancel orders at that time. Those will just simply be done according to the last Date-Time in the chart and will still apply to the same simulated Trade Account.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2020-04-15 05:00:22]
User909904 - Posts: 14
Yes, I am closing the positions after the simulation ends now.
That works fine if the chart is up to date but if the chart ends in the past, the close price may be very far from the last bar in the chart making the stats incorrect.

Having a way to do run commands at the end of simulation would help.
[2020-12-29 20:14:38]
Sierra Chart Engineering - Posts: 104368
Sometime ago we added this function sc.GetReplayHasFinishedStatus() which returns 1 when replay has finished.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-12-29 20:14:46

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

Login

Login Page - Create Account