When using the Spreadsheet System for Trading study, you can disable autotrading at certain times of day.
To allow autotrading only between two times of day, put this in cell J28: =AND(J8=0,OR(FRACTIME(J41)<TIMEVALUE("09:30:00"),FRACTIME(J41)>TIMEVALUE("16:00:00"))) You can also use this in J28 to avoid a lunchtime trade: =AND(J8=0,OR(OR(FRACTIME(J41)<TIMEVALUE("09:30:00"),FRACTIME(J41)>TIMEVALUE("16:00:00")),AND(FRACTIME(J41)>TIMEVALUE("11:30:00"),FRACTIME(J41)<TIMEVALUE("13:30:00")))) While disallowing entries, these formulas include a reference to J8 to allow for exits after autotrading is disabled. These formulas should only be used when not scaling in, or not using reversals. If you are scaling in or using reversals, additional formulas in other cells are required to disallow entries while allowing exits outside the autotrading time window: 1) Put this in cell H28 (this excludes J8 and reverses the comparison operators): =AND(FRACTIME(J41)>TIMEVALUE("09:30:00"),FRACTIME(J41)<TIMEVALUE("16:00:00")) 2) Include a reference to H28 in cells K3 and M3, like this: =AND(YourOtherEntryConditions,$H$28) 3) To also properly display the arrows: a) Put these in any spare columns O-Z…BR: Buy entry: =IF(YourBuyEntryConditionsWithoutH28,D3,0) Sell entry: =IF(YourSellEntryConditionsWithoutH28,C3,0) b) Set the Draw Styles of the above columns to Arrow Up and Arrow Down, respectively, and set the Draw Styles of SG1 and SG3 to Hidden. |