NC Smart Levels Description
NC Smart Levels is a support and resistance strategy for NinjaTrader 8, and it comes with the full C# source code. Levels are the most subjective thing in trading: we all see our own, and finding them with an algorithm has always been a quest. I used the ADX's directional movement lines to find and manage them. The honest part: there's no stop-loss order, so treat it as a template to build on.
How it works. It's fully automated and runs on bar close, reading DI+ and DI- from NC ADX Suite (ADX Period 14). While DI+ is above ADX Threshold (15), every high above the up level lifts the level to it. Once a level has stood for Level Lifetime Bars (50) without a refresh, the next high made while DI+ is above the threshold replaces it, even a lower one. The down level does the same with lows and DI-. A long comes when the close crosses above the up level, if that level is younger than 50 bars, DI- is not above DI+, and the up level is not below the down level. Shorts mirror this. It enters at market for Pos Size (1), one position at a time. A long is closed at market when the down level gets pushed lower, or when the up level reaches its lifetime without a refresh; shorts mirror this. There's no time filter.
What you see. Up levels are dashed dark green marks and down levels dashed dark red, and both turn purple once a level is 50 bars old, so stale ones stand out. NC ADX Suite opens in its own panel with the DI+, DI- and ADX lines.
How to use it. Test it in the Strategy Analyzer and watch which levels price respects. A lower ADX Threshold lets more bars move the levels; Level Lifetime Bars sets how long a level stays tradeable. Exits happen only at bar close, nothing protects the trade at the broker, and Exit on session close is off, so I'd add a protective stop before going live. Run it on Sim101 and in the Strategy Analyzer first, and use it at your own risk.
Make it yours. It comes with a video that walks through the bot's logic. Use it as is, learn from the code, or change it yourself or with AI like Claude. You could add a stop at the opposite level, a session window, or read the public LevelUp and LevelDown series from your own strategy. Levels, signals and orders are separate parts of one short file, so you can swap in your own level idea. Have some good trades!