NC Range Fill Description
NC Range Fill is a range trading strategy for NinjaTrader 8, and it comes with the full C# source code. I like trading inside a range that formed overnight: its edges give a clear target and a clear stop. It steps in when two John Ehlers tools, MESA Stochastic and the Super Smoother, agree. Its many settings are great for optimizing, and just as easy to over-fit.
How it works. Between Opening Range Start (17:00) and Opening Range End (08:00) it records a fresh high and low. Afterwards it buys on a bar close when MESA Stochastic and the Super Smoother are rising, the close is above the Super Smoother, both are inside the range, and the range high is at least Minimum Target % (20) of the range away. Shorts mirror this. Candle Direction Trend (default) wants an up candle for longs. MESA Period (10) sets both indicators. Entry Type Market (default) enters at market; Limit rests at the Super Smoother and follows it. Longs target the range high with a stop at the range low, capped at Max Stop USD (1,500); shorts the other way round. After a long, the next trade in that range must be a short, and vice versa. No entries after No Orders After (16:15). Off by default: MESA Threshold Filter (trade only while MESA is between 20 and 80), MESA Exit (exit when it turns) and Time Exit (16:40).
What you see. The range high and low as hash lines, blue while the range is forming and violet-red once it's set. The Super Smoother is drawn on price, and MESA Stochastic in its own panel with lines at the threshold levels. There are no buttons: it's fully automated.
How to use it. Times use your NinjaTrader time zone, so set the window to your session. The strategy switches off NinjaTrader's Exit on session close and Time Exit is off by default, so a trade can stay open overnight; turn Time Exit on to be flat each day. Max Stop USD caps the loss for the whole position, so the stop tightens as Position Size (1) grows. Run it on Sim101 and in the Strategy Analyzer first, and use it at your own risk.
Make it yours. Like all my frameworks, it comes with a code review video that explains the strategy logic and its filters. Use it as is, learn from the code, or change it yourself or with AI like Claude. You could add a break-even halfway to the target, a minimum range height filter, or a second range window. Range, signals and orders are separate parts, so it's an easy base to build on. Have some good trades!