TimeBlock marks blocks of time and specific times of day, for use in BloodHound’s Threshold solver.

Use it with the Threshold solver to pick out any of its outputs. For example:
- A block of time, for an exit signal that flattens any open position before the market closes.
- A specific time, to reset a Function node that’s blocking signals so signals can resume.
- Trading holidays, to keep a system from trading on them.
It also gets around a limitation of the Time Session solver. NinjaTrader doesn’t transfer custom session templates to other computers, so a BloodHound template that uses Time Session with a custom session template only works on another computer if that session template is recreated there. TimeBlock in a Threshold solver doesn’t have that problem.
Properties

| Setting | What it does |
|---|---|
| Start Time | The start of the block of time. |
| End Time | The end of the block of time. |
| Use on Monday … Sunday | Which days of the week the block applies to. |
| Show Text | Writes the outputs’ current values on the chart (see the image below). |
| Text Color | The color of that text. |
| Text Location | Where on the chart the text goes. |
| Color chart background | Colors the chart background with the three colors below. |
| Before Start Time Color | From midnight to the Start Time (yellow in the image above). With the default times, usually pre-market hours. |
| Between Start & End Time Color | From the Start Time to the End Time (dark in the image above). With the default times, usually trading hours. |
| After End Time Color | From the End Time to midnight (purple in the image above). With the default times, usually after-hours. |

Outputs for BloodHound
Each output is true or false (a BoolSeries): 1 for true, 0 for false. In a Threshold solver, a rule like “equals 1” produces a signal on the bars where the output is true.

| Output | True (1) on |
|---|---|
| IsStartBar | The bar at the Start Time. |
| IsEndBar | The bar at the End Time. |
| BeforeStartTime | Every bar from midnight up to, but not including, the Start Time bar. |
| BetweenTimes | Every bar from the Start Time to the End Time. |
| AfterEnd | Every bar after the End Time bar, up to midnight. |
| FirstBarOfDay | The first bar after midnight. Useful for resetting Function nodes at the start of each day. |
| IsTradingHoliday | Bars on a holiday or partial holiday, according to the instrument’s Trading Hours template. |
Blocking signals on holidays
To stop a system trading on holidays, let signals through only on non-holiday bars:
- Add a Threshold solver that outputs 1 when IsTradingHoliday equals 0 (not a holiday).
- Connect it to the last AND node in your logic. On holidays it outputs 0, so the AND node blocks the signal.

Keep Trading Hours up to date
IsTradingHoliday only works if NinjaTrader’s Trading Hours templates are up to date. NinjaTrader support can help you update them.
Videos
12:33
How to Limit Signals to a Certain Time of Day & Block Holidays
Using TimeBlock to trade only certain hours and skip holidays.
1:50:59
Workshop: How to Use the SiTimeBlock
From a 2016 workshop, starting at the TimeBlock section. Recorded with an older BloodHound.