Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 16:45:58 +0000



Post From: Spreadsheet study - How to flatten all positions just on Fridays

[2023-07-31 22:19:56]
Sawtooth - Posts: 4120
The latest time in the J28 formula should be earlier than the time in the J29 formula.
IWO, if you flatten at 23:20, you could still get an entry until 20:30, which would immediately flatten.

However, this is not the reason for this issue.

For your J29 to go TRUE, there must be a chart bar that includes the FRACTIME(J41) of 23:20:00
Most Futures contracts have no bars after 17:00:00 ET on Fridays.

Note: I always add a reference to J8=0 in my J28 formula. Add AND(J8=0, in front of your J28 formula, and close it with a right parenthesis at the end of the J28 formula.
https://www.sierrachart.com/index.php?page=doc/SpreadsheetExampleFormulasAndUsage.php#DisableTradingOutsideOfRegularTradingHoursAnd2HoursMidday
This allows an exit after the latest time, but not an entry.

This is necessary because J29 is ignored if J28 is TRUE.
Spreadsheet Systems, Alerts and Automated Trading: Disable Auto Trading [J28]
So if you have a position after the latest time in J28, with the exit allowed, J28 is still FALSE after its latest time, allowing J29 to function.

Example: If you have a position when the latest time in J28 passes, it will play out as late as the time in J29, but no new entries will occur because J8<>0.
If the trade exits before the time in J29, J28 will be TRUE and no new entries, or exits, will occur because J41 is later than J28, and J8=0.
And since you are now flat, and later than J28, J29 is moot because it is now ignored.

This is also why I don't use J85-J89.
Date Time Of Last Edit: 2023-08-01 20:33:39