Add a private JavaScript indicator to Chart (NinjaTrader)
In your NinjaTrader Web workspace, add Chart (NinjaTrader) and Code editor. Open a liquid dated contract on a plain one-minute chart. In Code editor choose File → New. Name the file tradeReignInputCheck.js, paste the sample, and use File → Save. NinjaTrader documents that you can use your own saved file without publishing it.
On Chart (NinjaTrader), open Add indicators and search for tradeReignInputCheck, the name exported by the module. Select it to add it. For a community indicator, install it through the Community Indicators panel first, then add it from the chart's picker.
This sample adds three points to whichever price input the indicator receives. It draws a reference line for a display check. For code from another platform, first identify the file type. NinjaTrader Desktop NinjaScript uses C#, TradingView Supercharts uses Pine Script, and NinjaTrader Web’s Code editor uses JavaScript.
class TradeReignInputCheck {
map(bar) {
const input = bar.value();
return input + 3;
}
}
module.exports = {
name: "tradeReignInputCheck",
calculator: TradeReignInputCheck,
};