Login Page - Create Account

Support Board


Date/Time: Mon, 20 May 2024 01:43:12 +0000



limit time of day

View Count: 837

[2016-08-18 19:00:49]
User57210 - Posts: 121
Hi,

Working on an automated trading system with the spreadsheet system for trading. I am looking for a way to create a condition for entry/exit based on time of day. For example, I want it to be >= 9:40am EST prior to taking any trades.

Thank you in advance.
[2016-08-18 19:14:49]
User57210 - Posts: 121
I created a column for hour, and one for minute, then created a statement with OR(AND(....)) to make this work. Open to more efficient ways if exist.
[2016-08-18 19:37:26]
Sawtooth - Posts: 4001
Use cell J28 with a formula like this:
=OR(J41-INT(J41)<TIMEVALUE("09:40:00"),J41-INT(J41)>TIMEVALUE("16:00:00"))
[2016-08-27 21:29:03]
Litz - Posts: 131
Can not seem to get this working for some reason. Tried this also =AND(J8=0,OR(J41-INT(J41)<TIMEVALUE("09:30:00"),J41-INT(J41)>TIMEVALUE("16:00:00")))

but in backtesting autotrades still are filled in off hours according to the trade activity and service logs. Trading ES in eastern time zone. The number '1' shows up in j28 after pasting formula.
Date Time Of Last Edit: 2016-08-27 21:47:08
[2016-08-27 21:56:26]
Sawtooth - Posts: 4001
The J28 formula with the J8=0 will allow exits after 16:00:00 if you are in a position.
Are the filled autotrades exits?

The J28 formula without the J8=0 will not allow entries or exits from 16:00:00 to 09:40:00 the next morning.

You can verify proper function by doing a Replay across 09:40 or 16:00, while observing cell J28.
Date Time Of Last Edit: 2016-08-27 22:04:55
[2016-08-27 22:05:52]
Litz - Posts: 131
=OR(J41-INT(J41)<TIMEVALUE("08:30:00"),J41-INT(J41) >TIMEVALUE("17:00:00")) Using this formula should prohibit all entries and exits outside of the hours? The fills are both entries and exits. Seems like J29 flatten trades isnt responding either.

Think I solved the problem. Changed the Chart Data sheet output number to match the spreadsheet #.
Date Time Of Last Edit: 2016-08-27 22:46:06
[2016-08-27 22:53:16]
Sawtooth - Posts: 4001
J41 is referencing chart time, not local time, if different.

Did you observe J28 during Replay across 08:30 or 17:00?
It should be TRUE/1 before 08:30 and FALSE/0 after 08:30
And FALSE/0 before 17:00 and TRUE/1 after 17:00

It might seem backward, but J28 is a DISABLE cell, not an ENABLE cell.
Date Time Of Last Edit: 2016-08-27 23:58:57

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

Login

Login Page - Create Account