NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

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

Reply
 
Thread Tools Display Modes
Old 07-06-2012, 11:00 AM   #1
Edward Kunafi
Senior Member
 
Join Date: May 2009
Posts: 283
Thanks: 6
Thanked 2 times in 2 posts
Default Splitting Indicator Files

Hello Support,

While editing (large code base) in-line compiler at times trigger exception "system runs out of memory", as it requested more memory. This could be triggerred with just typing Open Curly Bracket for instance. Normally first time it occurs, NT would be able to recover and I continue editing, but the second time it happens usually results in crash. ( I am still on XP with max 4GB memory)

How can I split my files into two, first just contain all working codes, so the working codes need not be edited, the second file is the new code or functions that I need to modify?

Thanks.
Best Regards,
Edward K.
Edward Kunafi is offline  
Reply With Quote
Old 07-06-2012, 12:08 PM   #2
NinjaTrader_JC
NinjaTrader Customer Service
 
NinjaTrader_JC's Avatar
 
Join Date: Mar 2012
Location: Denver, CO
Posts: 1,202
Thanks: 137
Thanked 183 times in 182 posts
Default

Hello Edward,

Just a note by default, all 32 bit applications are limited to 1.2 GB of memory by the .NET framework. Because of this, even those systems which have more system memory than 1.2 GB can use only this amount of memory

While it is possible to have multiple files when coding this is something that NinjaTrader would not support. You can put some common items in the User Defined Methods file to access to frequently used functions. See the following link for more information about User Defined Methods.
http://www.ninjatrader.com/support/h...ed_methods.htm

With that said how big is your file? It should not be so big as to cause to crash. Please note as well that when compiling NinjaTrader will compile every Indicator/Strategy not just the one you are working on.

Happy to be of further assistance.
NinjaTrader_JC is offline  
Reply With Quote
Old 07-06-2012, 09:15 PM   #3
Edward Kunafi
Senior Member
 
Join Date: May 2009
Posts: 283
Thanks: 6
Thanked 2 times in 2 posts
Default Reducing memory use

Hello JC,

Thank you for the response. Seems a good idea to can some functions as separate indicator, even with no plots. The reason it could crash is this SIM system is connected with multiple opened workspaces, as I am collecting data for strategy testing later.

I am wondering, I have two ideas for alternative solutions:
1. I have another computer LIVE license with the same data, can I just copy the .ntm files from relevant missing date directories over? Is there anything else I should do? I saw there is tick, minutes and day directory. What is the proper way to copy over data to another computer for specific dates interval? This way I need not open the workspaces for data collection.

2. How can I collect data with the smallest memory requirement, if I just have the DOM for the instrument I am interested in, without the chart, would NT still collect the data? and presumably use a lot less memory?

Thanks
Best Regards,
Edward K.
Edward Kunafi is offline  
Reply With Quote
Old 07-09-2012, 07:25 AM   #4
NinjaTrader_JC
NinjaTrader Customer Service
 
NinjaTrader_JC's Avatar
 
Join Date: Mar 2012
Location: Denver, CO
Posts: 1,202
Thanks: 137
Thanked 183 times in 182 posts
Default

Hello Edward Kunafi,

1. The easiest way to transfer settings/data to a second computer is using the Backup Utility within NinjaTrader.

You can access this Utility from the Control Center -> File -> Utilities -> Backup. The dialog window that appears has checkboxes for what you would like to backup and a location default to <My Documents>\Ninja Trader Backup\
The following link is to our Help Guide on Backups.
http://www.ninjatrader.com/support/h...up_archive.htm

After you have moved the Backup file to the second computer, use the Restore Utility, Control Center -> File -> Utilities -> Restore, and use the pop up file browser to select the Backup.
http://www.ninjatrader.com/support/h...up_archive.htm

Here is a link to a video demonstrating this that you may view.
http://www.youtube.com/watch?v=zGCp9...ure=plpp_video


2. Could you clarify what data that you would like to collect? (Example: Saving data as historical, Record for market replay, etc...)

Happy to be of further assistance.
NinjaTrader_JC is offline  
Reply With Quote
Old 07-09-2012, 08:57 AM   #5
Edward Kunafi
Senior Member
 
Join Date: May 2009
Posts: 283
Thanks: 6
Thanked 2 times in 2 posts
Default

Hello JC,

I know there is back up. When I do backup there is no selection which period to back up? Is the back up incremental (the first ever time I did, it take hours upon hours, so I cancel it). I just saw the video, but still wonder what would happen if the target PC already have same data? If the next week I did another back up? would it take hours upon hours again, or is it backing up just the last week? From what I see, it will do whole back up again.

My SIM computer is collecting data for market replay for strategy testing, which require every ticks. What is the simplest way with least memory usage? (Open chart with no indicator, open DOM, Open Level 2 windows)?

Answer to your previous posts, my Indicator file is about 0.5MB.

Thanks.

Regards.
EdwardK.
Edward Kunafi is offline  
Reply With Quote
Old 07-09-2012, 09:40 AM   #6
NinjaTrader_JC
NinjaTrader Customer Service
 
NinjaTrader_JC's Avatar
 
Join Date: Mar 2012
Location: Denver, CO
Posts: 1,202
Thanks: 137
Thanked 183 times in 182 posts
Default

Hello Edward Kunafi,

The Backup utility will backup everything you have selected regardless of when it was created/saved. Also, the Backup utility will do a full backup every time, and if the target PC has the same data as the backup then it will be overwritten. Please note that you depending on how much data you have in the respected folder like the Historical chart data, Log and trace files, and Market Replay data it can take a while to backup. You can manually copy over Market Replay data by coping data from the (My) Documents -> NinjaTrader 7 -> db -> data. There you will see folder(s) that will be listed by the date (yyyymmdd - 20120709) and inside those folders will be the Market Replay data listed by Instrument Name.

All of the windows are not very memory intensive, but if you are just recording the SuperDOM will work.

That is a very large file. So that I can test this behavior on my side could you send the indicator in a email. Using this website to attach the files: https://www.wetransfer.com/

After you left clicking on the link:

* Left click on the "Go" button
* Left click on the "+ Add files" icon in the top box
* Navigate to "(MY) Documents -> NinjaTrader 7 -> bin -> Custom -> Indicator left click on the indicator name and press the "Open" button
* In the "Enter friend's e-mail" put "support[At]ninjatrader[dot]com"
* Enter your e-mail address in the provided spot
* In the "Type your message" box please put "ATTN: JC -" and reference this post.
* Press the "Transfer" button


Here is a link to our support forums that goes over how to debug your code which comes in handy when writing custom code to debug it.
http://www.ninjatrader.com/support/f...ead.php?t=3418

Please let me know if I can be of further assistance.
NinjaTrader_JC is offline  
Reply With Quote
Old 07-09-2012, 10:07 AM   #7
Edward Kunafi
Senior Member
 
Join Date: May 2009
Posts: 283
Thanks: 6
Thanked 2 times in 2 posts
Default

Hello JC,

Noted. Many thanks for all the pointers and references.
I have enough to try on and continue.
Regret to say I am not able to send over my indicator.

My hopefully last questions, does .Net Framework limits memory usage of 64bit apps?
If I run NT7 on Windows7 on machine with 16GB memory, how much memory can it use?

Thanks.

Best Regards,

Edward K.
Edward Kunafi is offline  
Reply With Quote
Old 07-09-2012, 10:53 AM   #8
NinjaTrader_JC
NinjaTrader Customer Service
 
NinjaTrader_JC's Avatar
 
Join Date: Mar 2012
Location: Denver, CO
Posts: 1,202
Thanks: 137
Thanked 183 times in 182 posts
Default

Hello Edward Kunafi,

Yes, a 64bit program using .NET framework will be limited to about 2.8gb of RAM. You may view the following link that will go over more about .NET memory limits.
http://blogs.msdn.com/b/tom/archive/...processes.aspx

Please let me know if I can be of further assistance.
NinjaTrader_JC is offline  
Reply With Quote
The following user says thank you to NinjaTrader_JC for this post:
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
Splitting StopLoss order maratrm Charting 2 03-22-2012 06:55 PM
Errors when trying to download indicator files tworth NinjaScript File Sharing Discussion 4 03-07-2011 05:18 AM
Has anyone compiled Gain's weekly tick data files into larger files? bluelou Charting 0 06-18-2009 10:07 PM
splitting trades velocity Miscellaneous Support 2 01-30-2009 09:57 AM
splitting targets sub5mango ATM Strategies (Discretionary Trading) 3 12-05-2008 04:00 PM


All times are GMT -6. The time now is 12:39 AM.