A graph can look correct and still do something unexpected. You will learn to limit trading to chosen hours with the Time node and to draw lines, arrows and histograms so you can see what each part of the graph does.
Limiting trading to a time window
Many strategies only make sense in certain sessions, because volume and spreads differ across the day. The Time node has one input, Time, which you connect to Data.Time, and one boolean output, Active. Active is true on candles inside the schedule you configure.
- Schedule:
At or afteris active from the start time onwards, andTime rangeis active between a start and an end. - Start is inclusive and end is exclusive, so a range of 08:00 to 17:00 includes 08:00 and excludes 17:00.
- Timezone sets how clock times are read, and the session start days choose which days the schedule applies to.
To use it, combine Active with your entry condition using And: the trigger is then true only when the setup occurs and the time is allowed. Put the combined result into Trigger.
Worked example
Filtering a crossing with a time range
- Set the
Timenode to the range 08:00 to 17:00 in UTC on weekdays, andAnditsActiveoutput with the crossing trigger. - A crossing occurs on a candle stamped 06:00.
Activeis false, so the trigger is false. - A second crossing occurs on a candle stamped 09:00.
Activeis true, so the trigger is true. - A third crossing occurs on a candle stamped 17:00. The end is exclusive, so
Activeis false and the trigger is false.
Of three crossings, only one (09:00) becomes a trade entry; with hourly candles stamped at their start, the window contains 9 candles per day, from 08:00 to 16:00.
A time filter is also a parameter you can tune to history. Choose hours for a reason, such as when your market is most active, and check that results do not depend on one particular hour.
Drawing what the graph sees
Three visualisation nodes draw on the chart, in panes of their own where the scale differs from price. Each has a colour setting, and VisualizeArrow also has a position setting such as above the bar.
VisualizeLinetakesData, a number, and draws it as a line. Use it forSMA,EMA,RSI,ATRor any computed price such as a stop.VisualizeArrowtakesSignal, a boolean, and draws an arrow on every candle where it is true. Use it on the trigger to see where the graph would enter.VisualizeHistogramtakesDataand draws bars, for example theHistogramoutput ofMACD.
A good habit is to draw both averages with VisualizeLine, the trigger with VisualizeArrow, and the stop and target prices as lines. If an arrow appears where there is no visible crossing, or a stop line sits on the wrong side of price, the graph is wrong and the picture tells you where to look.
Checking trades in the replay
After the visual check, run a backtest and open the Backtest tab. It replays the historical candles and shows trades on the chart one by one, with drawing tools. Step through the first trades and compare each entry, stop and target with what you intended.
- Pick several trades from different market conditions, not only the best ones.
- Check that each entry candle really is a crossing and is inside the allowed hours.
- Check that stops and targets are on the correct sides and at the distances you expect.
- Fix the graph, rerun and look again before reading any performance numbers.
Key takeaways
- The
Timenode outputsActivefor a configured window, with an inclusive start and an exclusive end, and combining it withAndlimits when entries can fire. VisualizeLine,VisualizeArrowandVisualizeHistogramdraw indicator values, boolean signals and bars on the chart.- Draw the trigger and the stop and target prices to catch wiring mistakes early.
- Step through trades in the Backtest tab replay before reading any performance statistics.