hi, could anyone help me to fix this issue with ninja script add on. whenever i try to add indicator on ninja a message pop up
“import failed. the ninja script archive file may contain duplicate method names the already exist on your PC, modify a method signature that other scripts were dependent on, or be missing a required file on either your pc or in the import archive.”
Its a tough one to debug. But first create a fresh install after backing up your present Ninja Trader folder, and see if the import works on a clean install then import third party tools you have one by one checking the import every time to find the cultprit.
2 Likes
Once you’ve identified the offender per #vipinb, whilst I’m not a coder so don’t know much about the why’s and wherefore’s but I have experienced this when attempting to produce my own indicators (v. basic!)
As I understand it, it occurs when an installed custom script (a third-party indicator) is using a (‘custom’) method name, and you try to import another custom script which contains the same custom method name (there may be more to it than that alone). A solution is to change/rename the custom method name in the indicator causing the problem (iirc you should be able to identify it by copy and pasting the offending script into Ninja, trying to compile it and seeing what error (method name conflict) comes up in Ninja Script Editor).
If this is incorrect, hopefully a member with real coding expertise may step in.
Kind regards,
Worth confirming first whether the import is a .dll or .cs file, you can check by opening the zip before importing.
If it’s a .dll: go to Tools > Remove NinjaScript Assembly and check if an older version of the same indicator is already installed. Remove it, then reimport.
If it’s a .cs file: navigate to Documents\NinjaTrader 8\bin\Custom\Indicators and check if a file with the same name already exists. Delete or rename the old one, then reimport.
The error usually means NT is seeing two versions of the same method removing the old copy resolves it in most cases.
I’ve had this too.
Screenshot the error and paste the picture into Claude, it’ll help you get to the bottom of it, correct it, and give the the opportunity to learn.
Start paying for Claude if you’re not already, I assume you’re developing the addon.
For this particular problem, a high level ai tool like Claude will save you days of consternation, or the $500 fee it’ll take a csharp/ninjascript person to look at it.
Open the zip file. Is the indicator is a .CS file open it in notepad and copy paste to ninjascript editor. NT will try to compile it and will tell you exactly which indicator(s) it conflicts with.
You can use free Claude, ChatGPT or Qwen (thinking) to try to rewrite the indicator to avoid errors.