Go Back   NinjaTrader Support Forum > NinjaTrader 8 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 03-19-2017, 07:48 AM   #1
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 3,279
Thanks: 248
Thanked 756 times in 577 posts
Default NinjaTrader crashes when exporting an indicator open source

NinjaTrader 8.0.5.2.:

I have coded an indicator and tried to export it open source (no DLL, no protection).

The export worked, but NinjaTrader 8 crashed (shut down) on an unhandled exception.

Quote:
2017-03-19 14:37:25:192 *************** unhandled exception trapped ***************
2017-03-19 14:37:25:192 Access to the path 'Butterworth Filter.dll' is denied.
2017-03-19 14:37:25:192 System.UnauthorizedAccessException: Access to the path 'Butterworth Filter.dll' is denied.
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
at NinjaTrader.Gui.NinjaScript.ExportNinjaScriptViewM odel.<>c__DisplayClass26_0.<DoExport>b__0(Object x)
at System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System. Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
The error message points to a path "Butterworth Filter.dll", which is strange, as there is no such path. "Butterworth Filter" is simply the name of the zip file that I have chosen for exporting the indicator. Also the indicator is pretty simple and does not reference or call any other NinjaScript files.
Harry is offline  
Reply With Quote
The following user says thank you to Harry for this post:
Old 03-19-2017, 08:20 AM   #2
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 3,279
Thanks: 248
Thanked 756 times in 577 posts
Default

The issue is not 100% reproducible.

When exporting 40 indicators, I had 4 crashes with 4 different indicators. When exporting the same indicator a second time, the crash may repeat or not.

The issue is not related to specific indicators, but may occur with both simple and complex indicators.

It is a random occurence that happens in about 10% of all cases.
Harry is offline  
Reply With Quote
The following user says thank you to Harry for this post:
Old 03-19-2017, 06:40 PM   #3
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 7,634
Thanks: 119
Thanked 1,697 times in 1,599 posts
Default

Hi Harry,

Do you have any custom dlls in the Documents\NinjaTrader 8\bin\Custom folder?

Trying exporting from a clean settings folder and let me know if you get the same behavior.

To create a clean temporary NinjaTrader folder:
  • Shutdown NinjaTrader
  • Rename (My) Documents\NinjaTrader 8\ to (My) Documents\NinjaTrader 8.original\
  • Download the NinjaTrader installation package from the link below
  • http://ninjatrader.com/GetStarted
  • Run the repair from this (if the repair is unsuccessful, uninstall and then re-install NinjaTrader)

This will recreate the NinjaTrader 8 folder in (My) Documents

To switch back to your original environment:
  • Shutdown NinjaTrader
  • Rename (My) Documents\NinjaTrader 8 to (My) Documents\NinjaTrader 8.secondary\
  • Rename (My) Documents\NinjaTrader 8.original to (My) Documents\NinjaTrader 8\
  • Start NinjaTrader
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 03-20-2017, 03:55 AM   #4
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 3,279
Thanks: 248
Thanked 756 times in 577 posts
Default

I have no custom DLLs. The only DLLs are NinjaTrader.Custom.dll, NinjaTrader.Vendor.dll and VendorLicensing.dll.

Repairing the installation is a complex task, as I would need to reenter license number, reconfigure data feeds, copy the data base, copy indicators and workspaces and then reinstall the vendor licensing module. This will take up to 10 hours, so I cannot do that now.

I think you should be able to find out, why NinjaTrader searches for an inexistant path "Butterworth Fillter.dll" - the path being derived from the name I have chosen for the exported file - when I try to export a simple indicator as non DLL.

Something is wrong here, and the guy who committed the crime should immediately know, what is going on.

Also it is important to understand that NinjaTrader tries to access the inexistant path, after the export has already been completed.The export actually works, and it is only afterwards that NinjaTrader crashes.
Harry is offline  
Reply With Quote
Old 03-20-2017, 04:01 PM   #5
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 7,634
Thanks: 119
Thanked 1,697 times in 1,599 posts
Default

Hello Harry,

None of these things would be necessary to test exporting a script in a clean environment.

You can use the Free Simulation License. No connection is necessary. No Database is necessary. Any indicators called by the script would be necessary. No strategies would be necessary.

We are only testing exporting a script.

I can say that I am able to export scripts on my end without issue using the latest version of NinjaTrader. This means the issue is with the script or with something you have imported in NinjaTrader.

If you can demonstrate you are unable to export without any custom scripts we can submit this as a bug report to our development.

How would you like to continue?
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 03-20-2017, 04:10 PM   #6
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 3,279
Thanks: 248
Thanked 756 times in 577 posts
Default

Quote:
Originally Posted by NinjaTrader_ChelseaB View Post
Hello Harry,

None of these things would be necessary to test exporting a script in a clean environment.

You can use the Free Simulation License. No connection is necessary. No Database is necessary. Any indicators called by the script would be necessary. No strategies would be necessary.

We are only testing exporting a script.
When testing, I would need to to test it under different scenarios. For example I would need to add the vendor licensing module to find out whether it has an impact on exporting files. Basically, I would need to add elements of my current installation until the bugs shows again.

As it is not 100% reproducible, I would need to export 30 to 40 indicator files each time, before a new occurence might happen.

Also I would need to test it on my second machine. We are talking about several hours at least.

Again, the key element is that the crash occurs after the file has been exported successfully. What does NinjaTrader do after the zip file has been written to the selected directory?

Why does NinjaTrader include a non-existant DLL in the path?
Harry is offline  
Reply With Quote
Old 03-21-2017, 10:02 AM   #7
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 7,634
Thanks: 119
Thanked 1,697 times in 1,599 posts
Default

Hello Harry,

I am not able to reproduce this behavior on my end.

From my understanding NinjaTrader does not include a Butterworth Filter.dll file in either NinjaTrader 7 or NinjaTrader 8.
I am expecting that this is something you have imported. Possibly a reference to the file is causing an issue when compiling and exporting. For now I am unsure.

I am also expecting that if you export just this script in a clean environment folder without any other 3rd party of custom scripts that the behavior will not be reproducible.

However, if you are able to reproduce, I want to reproduce on my end as well and make sure we get this reported to our development.
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 03-21-2017, 11:40 AM   #8
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 3,279
Thanks: 248
Thanked 756 times in 577 posts
Default

Quote:
Originally Posted by NinjaTrader_ChelseaB View Post
Hello Harry,

I am not able to reproduce this behavior on my end.

From my understanding NinjaTrader does not include a Butterworth Filter.dll file in either NinjaTrader 7 or NinjaTrader 8.
I am expecting that this is something you have imported. Possibly a reference to the file is causing an issue when compiling and exporting. For now I am unsure.

I am also expecting that if you export just this script in a clean environment folder without any other 3rd party of custom scripts that the behavior will not be reproducible.

However, if you are able to reproduce, I want to reproduce on my end as well and make sure we get this reported to our development.

Hello Chelsea,

I had explained it below. I do not have any "Butterworth Filter.DLL" in any of my subdirectories.

When I export an indicator open source and save the zip file as "Elefant", NinjaTrader 8 crashes and the error message on the trace file reads that it could not find "Elefant.dll".

When I export the same indicator open source and save the zip file as "Butterworth Fillter", NinjaTrader crashes and the error message on the trace file reads that it could not find the path to "Butterworth Filter.dll".

None of these DLLs exists, the name of the path is nonsense, as it is just derived from the name I had chosen for the zip file. This explains that the access is denied, as no such path exists.

The question here is:

Why does NinjaTrader try to access a non-existant path after the zip file has been exported? NinjaTrader probably performs an operation that should only be performed when a DLL has been exported, but this operation is also erroneously performed, when an indicator file has been exported open source.
Last edited by Harry; 03-21-2017 at 11:43 AM.
Harry is offline  
Reply With Quote
The following user says thank you to Harry for this post:
Old 03-21-2017, 12:30 PM   #9
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 7,634
Thanks: 119
Thanked 1,697 times in 1,599 posts
Default

Hello Harry,

I believe NinjaTrader is referencing the non-existant file because something in the settings folder is not correct. I think this may also be responsible for the crashes (unhandled exception from not finding the file).

I think creating a new settings folder would correct the behavior.
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 03-21-2017, 04:26 PM   #10
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 3,279
Thanks: 248
Thanked 756 times in 577 posts
Default

Quote:
Originally Posted by NinjaTrader_ChelseaB View Post
Hello Harry,

I believe NinjaTrader is referencing the non-existant file because something in the settings folder is not correct. I think this may also be responsible for the crashes (unhandled exception from not finding the file).

I think creating a new settings folder would correct the behavior.
I also believe that it would correct the behavior. But then I did not post to correct the behavior, but to find the bug, I have no assemblies installed - with the exception of the vendor assembly. My installation is as clean as it can be.

In order to find the bug, I would need to slowly migrate from a fresh installation to my current installation. As the issue is not 100% reproducible, but only occurs in about 10% of all cases, this would take a lot of time. I cannot currently do that.

I have reported the bug, and when I find some time to further enquire into that issue, I will do it. But it is hours of work.
Harry is offline  
Reply With Quote
Old 03-22-2017, 09:51 AM   #11
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 7,634
Thanks: 119
Thanked 1,697 times in 1,599 posts
Default

Hello Harry,

If this is a bug and not an issue with the settings of your local computer, then I would need to be able to reproduce this on my end before I can report the behavior to our development.

If I am not able to reproduce the behavior on my end and I am not able to provide a single simplified script or set of steps to reproduce the behavior I will not be able to report this.

Do you have a reduced script that can reproduce the behavior in a clean settings folder?

Do you have a set of steps I can use to reproduce the behavior?

(The point of the clean settings folder is not to correct the issue but to test to see if the issue can be reproduced. Your original folder is renamed so that we can switch back to this once we've tested in a clean environment. I have not asked you to copy any other scripts, templates, or other items into the clean environment as this would no longer be a clean environment.)

Please let me know if you would like to proceed.
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 03-22-2017, 01:16 PM   #12
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 3,279
Thanks: 248
Thanked 756 times in 577 posts
Default

Quote:
Originally Posted by NinjaTrader_ChelseaB View Post
Do you have a reduced script that can reproduce the behavior in a clean settings folder?

Do you have a set of steps I can use to reproduce the behavior?

(The point of the clean settings folder is not to correct the issue but to test to see if the issue can be reproduced. Your original folder is renamed so that we can switch back to this once we've tested in a clean environment. I have not asked you to copy any other scripts, templates, or other items into the clean environment as this would no longer be a clean environment.)

Please let me know if you would like to proceed.
As I had already reported in the beginning the issue is not reproducible. It only occurs from time to time. This makes it particularly difficult to test the behaviour. I told you that this will take hours, as I need to migrate from the clean folder to the current folder, until I can observe the behavior again.

I would also need to test it on my second machine.

I will do it, once I find a bit of time. I simply do not have the time to start testing it right now.

The issue as such is easy to understand. When exporting an indicator file open source, NinjaTrader "thinks" that is has exported an assembly, somehow looks for the assembly that does not exist and crashes. All this happens after the indicator file has been successfully exported to the selected directory. That is all.
Harry is offline  
Reply With Quote
Old 04-19-2017, 03:24 AM   #13
Harry
Senior Member
 
Join Date: Oct 2007
Posts: 3,279
Thanks: 248
Thanked 756 times in 577 posts
Default NinjaTrader Crash

Further crashes today witn NT 8.0.6.0.

I am just exporting simple indicators (no assembly, no protection) and NinjaTrader crashes and shuts down automatically.

Quote:
2017-04-19 11:16:56:444 *************** unhandled exception trapped ***************
2017-04-19 11:16:56:444 Access to the path 'ADXR Enhanced.dll' is denied.
2017-04-19 11:16:56:446 System.UnauthorizedAccessException: Access to the path 'ADXR Enhanced.dll' is denied.
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
at NinjaTrader.Gui.NinjaScript.ExportNinjaScriptViewM odel.<>c__DisplayClass26_0.<DoExport>b__0(Object x)
at System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System. Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
NinjaTrader seraches for ADXR Enhanced.DLL. There is no DLL that can be accessed, as I have only exported a simple add-on open source and named the zip file containing the indicator file ADXR Enhanced.

There are so many programming bugs in NinjaTrader 8 and I feel that there are not being fixed at all.
Harry is offline  
Reply With Quote
The following user says thank you to Harry for this post:
Old 04-19-2017, 05:46 AM   #14
sledge
Senior Member
 
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 4,352
Thanks: 1,635
Thanked 1,058 times in 910 posts
Default

Quote:
Originally Posted by Harry View Post
Further crashes today witn NT 8.0.6.0.

There are so many programming bugs in NinjaTrader 8 and I feel that there are not being fixed at all.
This is still beta softwares. I'm still in nt7 for production. Nt8 is unreliable.
sledge is offline  
Reply With Quote
Old 04-19-2017, 06:53 AM   #15
sledge
Senior Member
 
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 4,352
Thanks: 1,635
Thanked 1,058 times in 910 posts
Default

I tried about 7 times with my simple indicator and nothing frame happened. 8052. Even tried to network share and d: drive.
sledge is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NT8 crashes when exporting Market Analyzer MAX Platform Technical Support 6 10-25-2016 01:18 PM
Ninjatrader 7 Crashes on me Every Time, after Installing Indicator i2w8am9ii2 Platform Technical Support 4 07-28-2016 01:32 PM
NinjaTrader Crashes When Connecting to Data Provider With Indicator Loaded On Chart sckid Indicator Development 7 08-10-2012 10:50 AM
Mixing Open Source and Compiled DLL's Prospectus General Development 2 11-21-2010 02:03 PM
Is an automated framework implementation available as open source? dirtybrown Platform Technical Support 1 01-23-2008 02:43 AM


All times are GMT -6. The time now is 06:21 PM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.