Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
FileOpen dialog on indicator
Collapse
X
-
Originally posted by andrius View Post
-
Is this a bug then?
Here is the skinny after a whole host of experimentation that I just did on this one.
Here is how it works out.
- Use right-click in the indicator editor to add a reference. It will be added with the fully qualified path name. Not nice.
- Compile the indicator.
- Export the indicator as a DLL (VERY VERY IMPORTANT!!)
- If the DLL is imported, it will automatically add the reference to the System.Design.dll, without any path information. In other words, the correct way!
You can test this by removing the reference and renaming the file after you export the indicator. Restart NinjaTrader and verify that the reference is gone (the restart is not really required, but let us make assurance double sure). We are testing what would happen if your customer did NOT have the reference loaded, and tried to import the indicator that you just sold to her.
Import the DLL indicator, and you will find that NT tells you that you need the reference, and then creates the reference for you automatically. You can verify this by opening any indicator for editing and looking at the references using the right-click menu.
The nice thing is that if you then remove the assembly using the approved NT method, the reference to System.Design.dll stays in the references! How nice?
Here is the problem/potential bug.
If you do the same thing, except that you export the indicator, as source, rather than as a dll, when you try to import the indicator, NT returns an error: "Import failed. The NinjaScript archive may contain dupliacte method names that already exist on your PC or there is a required file missing in either your PC or in the import archive." I repeat: this is on a clean system. To verify, I uninstalled NT, and reinstalled it, then tried to import the source version, and got the same error.
I have attached 2 reference files for use in duplicating the problem. I consider it a bug related to importing indicators that need a system reference that NT does not ship with by default. IMHO, it should work for imports the same way, whether the exported indicator is exported as an assembly or as source code.
Of course, if we are not supposed to use any methods from System DLLs tthat NT does not reference out of the box, this point is moot, and this whole thread should probably be moved to the thread for unsupported tips and tricks.
Comment
-
koganam, sorry for the late follow up - this is working as expected, this unfortunately how reference dll are handling in compiled assemblies, this is exactly the reason why assemblies for distribution should only be exported from a clean system without any custom references defined / set.BertrandNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Bertrand View Postkoganam, sorry for the late follow up - this is working as expected, this unfortunately how reference dll are handling in compiled assemblies, this is exactly the reason why assemblies for distribution should only be exported from a clean system without any custom references defined / set.
Here is the problem/potential bug.
If you do the same thing, except that you export the indicator, as source, rather than as a dll, when you try to import the indicator, NT returns an error: "Import failed. The NinjaScript archive may contain duplicate method names that already exist on your PC or there is a required file missing in either your PC or in the import archive." I repeat: this is on a clean system. To verify, I uninstalled NT, and reinstalled it, then tried to import the source version, and got the same error.
Comment
-
so I am not alone fighting with NT support for reference problem. They try to convince me that this is expected behaviour, but I still resist My last email was about two days ago or so.
Funny thing happens if you have say proprietary indicator and vanilla system. Then you create your simple indicator, that doesn't require any external references. If you choose to export it Info.xml is added with reference to that proprietary indicator. This is clearly a bug.
In any case it's possible to find out which libraries some code requires and there should be added only those references. Looks like they search references in the same folder all indies lurk. What about simply copying needed indie and all referenced indies by that indie to tmpdir and only then wrap everything up in .zip? This is only one of possible ways to fix this. Of course there are more clever scenarios like http://stackoverflow.com/questions/4...l-dependencies, google "list dll dependencies".
Comment
-
Originally posted by koganam View PostSorry Bertrand, I do not quite understand. I have quoted the relevant part here, but you may want to reread the whole post.(New emphasis mine, in red. Not shouting; just making it prominent)
IOW, an export as a dll works differently from an export as a .cs file: the dll export/import has no problem, but the source export/import does. The inconsistency is what strikes me as a bug.
a) for the source import : the dll has to be manually added before import
b) for the compiled import : the dll would be added automatically
Is that the issue you ran into?
Thanks,BertrandNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Bertrand View PostThanks koganam, so you're basically saying :
a) for the source import : the dll has to be manually added before import
b) for the compiled import : the dll would be added automatically
Is that the issue you ran into?
Thanks,
However, as I never had the problem with my own source code, which I never had to import, except when I tried the test on a virgin installation, I would have to surmise that manually adding the reference would probably alleviate the problem.
As I know you folks are busy, and I just rebuilt another virgin development environment, let me test that theory out and report.
Comment
-
Hi Guys,
just wondering if anyone had solved this riddle yet.
I have found this dll that could help with the viewing of files but am unsure if its the correct thing I should be doing any pointers appreciated.
Thanks Raef
Comment
-
I also found this but my brain is drowning with information overload
//public static string Sellalert
/*{
string fileName = @"C:\mydir\myfile.ext";
string path = @"C:\mydir\";
string result;
result = Path.GetFileName(fileName);
Console.WriteLine("GetFileName('{0}') returns '{1}'", fileName, result);
result = Path.GetFileName(path);
Console.WriteLine("GetFileName('{0}') returns '{1}'",
path, result);
}
*/
Last edited by raefon72; 03-31-2012, 11:45 PM.
Comment
-
Originally posted by raefon72 View PostHi Guys,
just wondering if anyone had solved this riddle yet.
I have found this dll that could help with the viewing of files but am unsure if its the correct thing I should be doing any pointers appreciated.
Thanks Raef
Comment
-
Originally posted by raefon72 View PostI am getting lost / confused with the editor. I right click add refference but the dll is not there when I add it takes me to the NT7 folder but no dll for System.Design.dll is it another dll that I am refrencing / adding.??
Thanks
raef
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by usazencort, Today, 01:16 AM
|
0 responses
1 view
0 likes
|
Last Post
by usazencort
Today, 01:16 AM
|
||
Started by kaywai, 09-01-2023, 08:44 PM
|
5 responses
603 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by xiinteractive, 04-09-2024, 08:08 AM
|
6 responses
22 views
0 likes
|
Last Post Today, 12:31 AM | ||
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
21 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
||
Started by flybuzz, 04-21-2024, 04:07 PM
|
17 responses
230 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:45 PM
|
Comment