Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 22:00:09 +0000



Auto-trading disabled and positions not flattening - Spreadsheet System for Trading

View Count: 380

[2022-08-03 01:50:52]
Alex Q - Posts: 83
So I've been running a lot of backtests lately. I've got a decent handle on how to program the spreadsheet. However, tonight I"m having an interesting problem that I cannot seem to troubleshoot. I've reset spreadsheet and have started from scratch, however I am having the same problem.

I am simply buying the overnight low, and selling at the overnight high. Trading is only allowed 6:35 PST thru 12:49 PST. I have cancel and flatten all orders set to 12:48:49. This has been working no problem for all of my tests for the past several weeks.

I have isolated myself to one day (3/25/22) until I get the settings correct. Running the backtest it will buy the overnight low, but fail to flatten at the time specified (12:48:49). The result is that trading gets locked, and it fails to simulate any subsequent trades.

However, if I change the test from LONG the overnight low to going SHORT the overnight high, it works perfectly fine, and flattens at the time specified. I am not changing any other settings when doing this. Just simple deleting everything in the buy to open column, and using the sell to open column.
[2022-08-03 02:31:55]
Sawtooth - Posts: 3993
If you are using J85-J89, try this:

I prefer to use J28/J29 instead of J85-J89, and I set the Flatten time the same or later than the autotrading end time.
This is so that no new entry can happen after the flatten time.

This is accomplished by using a formula like this in J28:
=AND(J8=0,OR(FRACTIME(J41)<TIMEVALUE("06:35:00"),FRACTIME(J41)>TIMEVALUE("12:49:00")))

...and a formula like this in J29:
=FRACTIME(J41)>>TIMEVALUE("12:50:00")

The reference to J8 in J28 will disallow entries after 12:49, but allow exits after 12:49.
[2022-08-03 02:46:51]
Alex Q - Posts: 83
Tomgilb, thank you for your response. Unfortunately that doesn't seem to be it.

The issue is strange: Why is it that short trades are following the rules/inputs, but long trades are not?
[2022-08-03 18:37:02]
Alex Q - Posts: 83
Okay, so I have figured it out, and I feel pretty silly about it. I used a different SIM account than usual for backtesting, and that one had specific loss rules set under Global Profit/Loss management causing the account to lock out. Oops. Simple solution. Thank you 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