👋 So… you’ve used moving averages.
And let’s be honest—they’re fine. Maybe useful. Maybe just noise. Maybe you’ve got an EMA or HMA on your chart that turns green or red when price crosses over. Maybe you’ve tried tweaking someone else’s code, hoping to make it fit your style.
But what if you could actually build your own?
Not just some color-changing overlay—but a flexible, customizable moving average tool you designed from scratch—with your logic, your visual cues, your control.
That’s what we’re doing in this series.
We’re going to walk through how to plan, code, test, and polish a full NinjaTrader 8 indicator that builds on familiar tools—but gives you something way more powerful.
❓ Why This Series?
We already have tutorials that walk through the individual pieces of NinjaScript—how to use plots, work with Series<T>
, structure your indicator, and so on.
But tutorials can only take you so far.
At some point, you need to see how all those parts come together in something real.
That’s what this series is about. We’re taking the core concepts from the Learn NinjaScript lessons and putting them to work—building an actual indicator from scratch that you’d want to use on your chart.
And here’s the thing: I’m building this live, right alongside you.
That means if we run into an issue or realize we need to rethink something in a later post—you’ll see that too.
This isn’t a perfectly pre-polished walkthrough. It’s a real development process. You’ll get the full picture: the decisions, the tradeoffs, and yes, even the occasional mid-series fix.
🧰 What Are We Building?
Here’s what our “better” moving average will do:
- ✅ Let you pick from any built-in MA (SMA, EMA, HMA, etc.)
- 📈 Automatically detect when that moving average is rising, falling, or flat (we’ll add other conditions to this later)
- 🎨 Apply different color logic based on trend direction (including changes)
- 🟥 Let you choose what gets colored: the MA line, the price bars, or the background
- ⚙️ Provide clean, toggled inputs for visual customization
We’re not re-creating moving averages—we’re wrapping them in a smarter shell that gives you clearer signals.
💡 What Will You Learn?
This isn’t just “build a moving average”—this is how to code.
You’ll learn:
- How to structure your indicator from the start (no guessing mid-build)
- How to work with built-in indicators as inputs
- How to use
[NinjaScriptProperty]
and[Display]
attributes properly - How to detect trend changes using slope logic
- How to color different parts of your chart dynamically
- How to store conditions with
Series<int>
for cleaner logic - How to debug your code and test your logic the real way
🔄 And since this is being built live, you’ll also see how to catch issues, course-correct, and update your design as you go.
🗂️ What’s the Roadmap?
This series is being built in real time—as I code the indicator, I’m writing these posts. That means you’re getting a behind-the-scenes look at how a real NinjaScript project takes shape.
We’re not following a rigid script. If something doesn’t work or needs rethinking later, we’ll adjust—just like you would in your own development process.
Here’s the working roadmap:
- 🧠 Let’s Make a Better Moving Average ← You’re here
- 🧩 Planning the Better MA — Laying out our goals, inputs, and logic
- 🏗️ Building the Indicator Shell — Creating the class and wiring up the structure
- 📈 Detecting Rising and Falling Conditions — Figuring out slope logic and conditions
- 🎨 Coloring the Plot, Bars, and Background — Bringing the visuals to life
- 🧰 Debugging and Testing — Output window, edge cases, and visual verification
- 📦 Final Polish and Sharing — Tidying up, naming things, and exporting
This list may evolve as we go—if we need to add a post, refactor something, or fix a bug in a future part, we’ll walk through that together. You’re not just learning how to code—you’re learning how to build and adapt.
📊 Why Start with a Moving Average?
Because it’s actually useful.
Everyone uses them, and almost every strategy relies on them in some way. They’re also one of the easiest things to experiment with visually—making them the perfect candidate to teach:
- Dynamic input control
- Real-time chart feedback
- Clean code practices
- Logic layering (e.g., trend + visual + conditionals)
If this is your first indicator—this will teach you everything you need. If you’re already coding—this will level up your organization, flexibility, and structure.
🚀 Let’s Build Something You’ll Actually Use
If you’ve been waiting for a project to push your skills forward and create something you’re proud to use every day—this is it.
We’re going to do this together. No skipping steps. No shortcuts. In the next post, we’ll walk through exactly what we need to build before we write a single line of code.
This isn’t a polished example from a finished product—it’s an active build. So if something changes mid-series, we’ll tackle it together. The goal here isn’t perfection. It’s progress—and helping you build the confidence to code your own indicators from scratch.
🎉 Prop Trading Discounts
💥91% off at Bulenox.com with the code MDT91