EMA Cross
A fast EMA crossing a slow EMA publishes buy and sell signals; the confirmation series reports the trend side.
- Settings: fast period, slow period
- Confirmation: 1 while fast > slow, -1 while below
The free B4 Signal API, three ready-to-learn demo indicators and the B4 NinjaTrader 8 skill library for AI-assisted development. Everything you need to publish entry and confirmation signals the B4 way.
// reset, then publish for the current bar b4BuySignal[0] = false; b4SellSignal[0] = false; b4ConfirmationDirection[0] = 0; if (B4UseEntrySignals) { b4BuySignal[0] = CrossAbove(fast, slow, 1); b4SellSignal[0] = CrossBelow(fast, slow, 1); } if (B4UseConfirmations) b4ConfirmationDirection[0] = fast[0] > slow[0] ? 1 : -1;
Add these members to any NinjaTrader 8 indicator and its signals can be read by B4 tools and by any other NinjaScript, exactly like built-in indicator series. The API publishes signals only; it never places orders.
B4UseEntrySignalsbool settingTurns entry signals on or off (default on)B4UseConfirmationsbool settingTurns the confirmation series on or off (default on)B4BuySignalsSeries<bool>true only on the bar that produced a buy signalB4SellSignalsSeries<bool>true only on the bar that produced a sell signalB4ConfirmationDirectionsSeries<int>1 long bias, -1 short bias, 0 none, for the current barReset every bar to false / false / 0, then publish. A signal is true only on the bar it happened.
Tools match by name. Keep the types, the settings group "B4 CoPilot Pro Integration" and the empty setters.
API indicators publish information only. Execution stays with a strategy or tool the trader controls.
Simple, readable NinjaScript written from scratch, each with the B4 Signal API built in. Every signal-affecting value is an adjustable setting.
A fast EMA crossing a slow EMA publishes buy and sell signals; the confirmation series reports the trend side.
RSI climbing back out of oversold publishes a buy; falling back out of overbought publishes a sell.
A close beyond the previous N-bar channel publishes a breakout signal in that direction.
Seven skills for Claude Code and compatible AI coding tools. Each one turns hard-won NinjaTrader 8 engineering practice into a procedure, with templates and checklists.
nt8-indicator-foundationsLifecycle states, plots, Series<T>, properties, bar guards, Calculate modes, anti-repaint and hot-path performance, plus a starter template.
Use when: creating or editing any NT8 indicator.
nt8-b4-signal-apiAdd the five-member B4 Signal API v1 to any indicator, with a copy-paste block and a test checklist.
Use when: an indicator should publish B4 entry and confirmation signals.
nt8-adjustable-parametersNo hard-wired trading values. Turn every threshold, period and offset into a setting without changing behaviour.
Use when: writing new code or removing magic numbers.
nt8-build-verificationEight verification gates, real compiles, an error database and an honest build report. No "should work".
Use when: finishing any change, or a compile fails.
nt8-drawing-and-renderingDraw.* overloads and tags, when to move to OnRender with SharpDX, resource lifetime and keeping visuals out of logic.
Use when: adding arrows, zones, labels or custom visuals.
nt8-order-flow-and-dataOnMarketData trade classification, Tick Replay, Level II depth, multiple series and keeping real versus estimated order flow honest.
Use when: building footprint, delta, CVD, profile or DOM tools.
nt8-safe-deploymentBack up, deploy only when flat, understand the automatic compile, reload charts and keep a rollback path.
Use when: installing or updating NinjaScript on a live platform.
.cs file into Documents\NinjaTrader 8\bin\Custom\Indicators\.%USERPROFILE%\.claude\skills\ for personal use, or .claude\skills\ inside a project.The demos place no orders, read no account data and write no files. They are learning material, not trading systems. Community projects built with this kit are third-party work unless B4 reviews and supports them.