Login Page - Create Account

Support Board


Date/Time: Sat, 27 Apr 2024 22:25:44 +0000



Bartime in Backtesting

View Count: 1395

[2018-11-23 19:52:45]
omeros - Posts: 4
Hello,

I am trying to exit all my positions in backtesting by 15:45 on a daily basis. I used the formula BARTIME>TIME(15,45,00), but I still have positions that continue the other day. How can I stop all my positions by a specific time using "Trading System Based on Alert Condition" while backtesting?

Thanks a lot.
[2018-11-23 22:40:38]
Sawtooth - Posts: 3980
BARTIME is the time stamp at the open of a bar. If there are no bars after 15:45, the formula will never go TRUE.

You might try BARTIME>=TIME(15,44,59)

What is really needed is the Simple Alert equivalent to the spreadsheet study's 'Last Bar End Date Time' (J41).
Date Time Of Last Edit: 2018-11-24 13:55:43
[2018-11-25 07:30:05]
Sierra Chart Engineering - Posts: 104368
This is true that if there are no bars with a start time at or after 15:45, the formula never goes true.

We will add a new variable for Simple Alerts to get the last bar end date-time.
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: 2018-11-25 08:21:47
[2018-11-25 16:18:54]
omeros - Posts: 4
Thank you. This function will really help.
[2019-04-27 20:08:33]
User861654 - Posts: 1
Has this new variable for Simple Alerts been added yet? Thanks.
[2019-04-28 03:17:38]
Sierra Chart Engineering - Posts: 104368
Yes. It is:
BARENDDATETIME
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

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

Login

Login Page - Create Account