Login Page - Create Account

Support Board


Date/Time: Mon, 29 Apr 2024 01:09:11 +0000



[Programming Help] - Disabling auto trade multiple times per day

View Count: 1086

[2018-04-27 13:26:35]
User739131 - Posts: 27
Hi, I was wondering if there is a way to disable auto trading multiple times per day. For instance if I wanted to disable from 9:00 to 9:30, 10:30 to 11:00, and 11:30 to 12:00 can this be done?



Thanks very much for your help.
MJ
[2018-04-27 13:44:28]
Sawtooth - Posts: 3982
Have a look at this link:
https://www.sierrachart.com/index.php?page=doc/SpreadsheetExampleFormulasAndUsage.php#DisableTradingOutsideOfRegularTradingHoursAnd2HoursMidday
[2018-04-27 13:47:34]
User739131 - Posts: 27
Hi Tom,

Thank you for the reply. I currently am using the disable mid day time code. However this only allows me to disable trading once per day. I can't seem to figure out how to start and stop multiple times per day.
[2018-04-27 13:57:30]
Sawtooth - Posts: 3982
The second half of that formula is an AND statement inside of the OR statement. Simply add another AND statement inside the OR.
[2018-04-27 14:09:27]
User739131 - Posts: 27
Ok great thanks!
[2018-04-27 15:26:07]
User739131 - Posts: 27
Ok so I've entered the code and I am getting #NUM! in cell J28. Not sure what this means.
[2018-04-27 15:27:52]
User739131 - Posts: 27
This is the code.


=AND(J8 = 0, OR(OR(FRACTIME(J41) < TIMEVALUE("08:30:00"), FRACTIME(J41) > TIMEVALUE("14:29:00")), AND(FRACTIME(J41) > TIMEVALUE("08:59:59"), FRACTIME(J41) < TIMEVALUE("09:30:00")), AND(FRACTIME(J41) > TIMEVALUE("010:29:59"), FRACTIME(J41) < TIMEVALUE("11:00:00")), AND(FRACTIME(J41) > TIMEVALUE("11:29:59"), FRACTIME(J41) < TIMEVALUE("12:00:00"))))
[2018-04-27 15:33:05]
Sawtooth - Posts: 3982
TIMEVALUE("010:29:59") needs to be TIMEVALUE("10:29:59")
[2018-04-27 15:44:24]
User739131 - Posts: 27
Stupid typo. I swear I'm going blind.



Thanks very much!

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

Login

Login Page - Create Account