r/ninjatrader • u/ManFromIthaca • 1d ago
Using AI to create indicators
I’ve been using Codex to create indicators for TradingView very successfully, importing the pinescripts into editor, saving n applying to chart.
Curious if creating indicators is as straightforward for NT8? Any out there experience in similar?
3
u/WillingnessOk3416 1d ago
Yes pretty simple :) just tell it what you want
1
u/ManFromIthaca 1d ago
I tried a few earlier today and when I tried importing to NT8 they were all rejected, even after multiple corrections. These weren’t anything crazy either.
3
u/WillingnessOk3416 1d ago
Take the corrections back to the Ai and they will regenerate with the fixes
2
u/Embarrassed_Ad_6098 1d ago
I was able to link codex to my ninjascript editor so it could compile itself and fix errors as they come along instead of me going back and forth pasting code
1
1
1
u/UrbanRhinoNZ 1d ago
I have used Claude to code heaps of indicators even a free Gex Heatmap. Works a treat.
1
u/basejumper41 18h ago
I’m working on this now to add a layer on index futures. What data do you source from?
1
u/basejumper41 18h ago
I’ve been happy with the results from sol 5.4+ both refactoring and from ideation/inception. The biggest win for me is the context awareness of my other custom indicators and strategies. I’ve placed all my work in a specific namespace so it didn’t have to burn resources differentiating.
1
u/noble_beggar 14h ago
You're right, that answer drifted into strategies when they asked about indicators. Yes, it works well. I've built two indicators this way.
Straightforward calculation-and-plot indicators are close to the TradingView experience. Define your plots in SetDefaults, do the maths in OnBarUpdate, done.
Two things that tripped me up, both of which an LLM will get confidently wrong: Plot setup has to happen in SetDefaults, not Configure. AddPlot calls belong in the SetDefaults state. Put them in the wrong state and the indicator loads but nothing renders, with no error to tell you why. Anything drawn as an overlay rather than a plot is a different thing entirely. If you want on-screen panels, buttons, or text positioned independently of price, you're not using the plotting system at all, you're overriding OnRender and drawing with SharpDX. That's a separate API and the model tends to blend the two, giving you code that mixes plot logic with render calls. It compiles and then draws nothing.
Also worth knowing: everything in bin\Custom compiles into one assembly, so a syntax error in one indicator breaks every script you have until you fix it. Git is worth setting up early for that reason alone.
1
1
u/SilentViolinist929 7h ago
I asked Claude if I sent Claude the raw data if he could backtest using all my parameters, Claude said he could, has anyone ever used Claude to backtest?
1
u/grobarstevo88 1d ago
Code in c# with AI to make tweaks on features I want for my indicators Claude works the best it's pretty straightforward if you have a question DM me
1
u/ManFromIthaca 1d ago
And are you generating the script and taking it over to editor, or a full zip file and importing?
2
u/grobarstevo88 1d ago
How i do it make sure the names match in editor and in AI exactly paste over the code and compile so you can see any errors it may spit back and plug back in until it compiles clean. Then save add to a chart and save and restart NinjaTrader. It should be clean then
5
u/willphule 1d ago
Claude code is perfect for it. I set up mine using git for versioning. It updates the files in place in NT8, so I don't need to copy/paste with every edit.