NC HiLo Description
NC HiLo is a Hi-Lo swing indicator for NinjaTrader 8, and it comes with the full C# source code. The Hi-Lo way of drawing swings is used everywhere, yet the code behind it is often confusing, especially when you try to use it in a strategy. So I wrote a version that is short, clear and easy to follow, with a single setting. It's a plain swing line, not a signal generator, and the last leg keeps moving until price turns.
How it works. At the start it tracks the highest high and the lowest low. Once price moves Min Deviation Ticks (5 by default) away from one of them on a later bar, the first leg is drawn from that point. From then on there is always one open swing point. If the leg is up and price makes a new high, the swing point moves up to that bar. If, on a later bar, the low falls more than Min Deviation Ticks below it, that high is fixed and a new down leg starts from the low. Down legs work the same way in reverse. That's the whole algorithm.
What you see. A thick blue line joins the swing points. Finished legs are solid, and the leg still forming is dash-dot, so you always know which part can still change. It calculates on each tick by default, so in real time the open leg follows price. Behind the line there is a HiLo plot that holds the swing price on the bar of each swing point. It shows in the Data Box, and it's what a strategy reads.
How to use it. Min Deviation Ticks is the only setting: raise it to see only the bigger swings, lower it to see every little wiggle. Because it counts ticks, think about the instrument; 5 ticks on ES is just 1.25 points. Use the solid legs to read the structure, higher highs and higher lows or the opposite, and treat the dashed leg as a work in progress.
Make it yours. Like all my frameworks, it comes with a code review video that explains the logic step by step. Use it as is, learn from the code, or change it yourself or with AI like Claude. You could make the line color and width into settings, add an alert when a new leg starts, or label each finished swing with its size in ticks. The whole indicator is one small class, with finding the swings and drawing them kept apart, so it's an easy base for your own swing tools. Have some good trades!