Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 20:46:28 +0000



[User Discussion] - How to handle non-standard sessions in back testing?

View Count: 618

[2019-12-02 16:31:26]
J4yTr4der - Posts: 20
I'm running into the problem of holiday/short trading sessions being in my data which is causing some back test trades to hold way longer than they should (several days sometimes).

I see there is (was?) an option to enter specific dates to exclude, but that's not an ideal solution. When back testing, I would like to either be able to just skip non-standard sessions (which since this is in back testing, should be no problem since the future is known) or even better have an option to flatten at a specific time on only short sessions (so that my system can trade them if there is a valid signal, but get out before the close so as not to hold too long).

In fact, related to this... during back testing it is possible that my system finds a valid signal say on a Friday afternoon, takes it, and has to hold until Sunday or longer. I would prefer this not to happen, but I don't know of a way to set something like "Exit before close of week". We can define to exit at close of a session or other specified time, but I would love to just ensure that no position is carried past the close on a Friday. Any ideas on how to accomplish this, would be great to hear. Thanks!
[2019-12-02 17:07:31]
Sawtooth - Posts: 3976
I would like to either be able to just skip non-standard sessions, or flatten at a specific time on only short sessions
The only solution is to create a table of dates/times to skip, then compare J41 to each date in the table, then sum the column, then reference that sum in your entry formulas.
The table would probably need to be on an added sheet that is not associated with a chart.

I would love to just ensure that no position is carried past the close on a Friday
Use a formula in J29 that utilizes the WEEKDAY function.
https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#WEEKDAY_Function
[2019-12-02 17:18:01]
J4yTr4der - Posts: 20
Ah interesting idea using the WEEKDAY function. I'll have to play around with that.

I'm trying to use the spreadsheet as little as possible since it's so drastically slowing down my back tests (even after following all of the suggested spreadsheet optimizations)... but if that's the only way to do it then I'll have to look into it more. Thanks Tom!

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

Login

Login Page - Create Account