Trying to upgrade an indicator but getting an error?
If that indicator is being used in a strategy — especially in Strategy Builder — NinjaTrader won’t let you remove it. But don’t worry! Here’s a step-by-step guide to fix it without breaking your workspace.
⚠️ The Problem
Let’s say you want to upgrade an indicator you already installed. The usual steps would be:
-
Remove the old version
-
Install the new one
But if that indicator is being used by a strategy, such as one built in Strategy Builder, NinjaTrader will block the removal and show this error:
❌ “Cannot remove script – it’s referenced by another script.”
🛠️ The Solution
Here’s how to remove and reinstall the indicator without losing your strategies:
1. Identify the strategy using the indicator
Open the NinjaScript Editor and locate the strategy that is referencing the indicator you want to upgrade.
2. Exclude the strategy from compilation
Right-click on the script and select “Exclude from compilation.” This disables the strategy temporarily, allowing you to remove the indicator.
3. Remove the indicator
Go to Tools > Remove NinjaScript, select the indicator, and confirm the removal. Since the strategy is now inactive, the removal will succeed.
4. Import the new version
Install the new release via Tools > Import NinjaScript. Once completed, the upgraded indicator will be available again.
5. Re-enable your strategy
Back in the NinjaScript Editor, right-click the strategy and select “Include in compilation.”
If the indicator’s new version kept the same structure, your strategy should compile with no issues. Otherwise, you may need to adjust the code.
✅ Pro Tips
-
Do not refresh your charts or save your workspace while the indicator is removed — this helps prevent layout errors or lost settings.
-
Double-check compatibility between your strategy and the new version of the indicator.
-
Always make a backup of your NinjaScript files before performing upgrades.
🎥 Watch the full video tutorial
#NinjaTrader #TradingTools #IndicatorUpgrade #TradingStrategy#TradingTutorial #NinjaTraderTips #HowToNinjaTrader #DoItYourself#NinjaScript #StrategyBuilder #NinjaTrader8 #AlgoTrading#DayTradingCommunity #NinjaTraderUsers #TraderTips
No comments:
Post a Comment