NexusFi: Find Your Edge


Home Menu

 





Speeding up NinjaTrader with a RAM drive (ramdisk)


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Big Mike with 20 posts (13 thanks)
    2. looks_two Zondor with 18 posts (24 thanks)
    3. looks_3 kronie with 14 posts (2 thanks)
    4. looks_4 bob7123 with 12 posts (15 thanks)
      Best Posters
    1. looks_one pawnbroker with 3.4 thanks per post
    2. looks_two Zondor with 1.3 thanks per post
    3. looks_3 bob7123 with 1.3 thanks per post
    4. looks_4 Big Mike with 0.7 thanks per post
    1. trending_up 60,922 views
    2. thumb_up 94 thanks given
    3. group 41 followers
    1. forum 111 posts
    2. attach_file 6 attachments




 
Search this Thread

Speeding up NinjaTrader with a RAM drive (ramdisk)

  #21 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,464 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,662


bob7123 View Post
How did you come by this data? Or more to the point, what is the quality?







Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
About a successful futures trader who didnt know anythin …
Psychology and Money Management
REcommedations for programming help
Sierra Chart
Cheap historycal L1 data for stocks
Stocks and ETFs
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
 
  #22 (permalink)
 
bob7123's Avatar
 bob7123 
Amsterdam, The Netherlands
Legendary Market Wizard
 
Experience: Intermediate
Platform: Ninja, IRT, ToS
Broker: EdgeClear, LMAX
Trading: NQ
Posts: 668 since Oct 2011
Thanks Given: 134
Thanks Received: 2,682


Big Mike View Post






Mike

...but how do you get it all into the NT DB folder?

---
DUMB QUESTION I NOW KNOW! But at least I found the answer myself...
Importing Historical data

Still, I wonder if storing all that data in NTD files is a good idea, as it is (essentially) a one way street. I guess it depends on your application. If you are doing a lot of backtesting, then of course, but if charting active month contracts, I guess not. YMMV as they say.

Follow me on Twitter Reply With Quote
  #23 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844


Can you specify certain files to load into ram drive or does it have to be a folder? I want to put SSD in trading box (yes, I tried this previously, long story), but supposedly intense reading and writing will shorten the life, so thinking ram drive but I am limited to 16 gigs memory and my SC data folder is 40 gigs. I don't really want to put historical data in a separate folder and have to move it over every time I want to access it.

Any ideas would be helpful, thanks.

Reply With Quote
  #24 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

Using the new setup with historical data on RAMDisk, I just shut down and restarted Ninjatrader with five workspaces. The restart and reload were much faster than I have ever seen before. This really does seem to work.

Re preceding post, using Link Shell Extension it seems to me that you could create a junction leading to a file just as well as to a folder. I just did this for a png image but the only option given by the right click menu in LSE was to drop a symbolic link. It did not give me a choice of what type of symbolic link.

I don't think that the historical data in the ntd files has anything to do with the SQLServer CE database other than being in the same folder. I don't think it's a good idea to put the SQLServer CE database on the RAMDisk. Ninjatrader has said that in NT7, this database is NOT used to store historical data.

To deal with the problem of large amounts of data stored in the ntd files, it is not necessary to put the top level folders data, tick, minute, day, data and cache into the RAMDisk. You could judiciously choose lower level folders from within those folders, for example just the ones for the front month contracts.

The method that I use to move a folder from the Ninjatrader db folder to the RAMDisk is:
  • Ninjatrader is shut down.
  • Verified that I have an NTFS formatted RAMDisk Partition set to start up automatically each time the computer starts. Only needs to e set up once.
  • Save a copy of the folder to an archive on the hard disk if I don't want to risk losing it.
  • Use Windows cut and paste to move the folder to the RAMDisk drive.
  • Using LinkShellExtension, right click on the folder in the RAMDisk to designate it as the source of the link and then right click on the db folder to create the junction, which will have the same name as the folder in the RAMDisk partition.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #25 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

Just did a shutdown and restart with seven workspaces. Most of those workspaces have charts with multiple indicators that use one tick secondary dataseries, and Gom data. Restart only took a couple of minutes.

This is the best startup performance I have ever seen, by far. Before I set up the RAMdisk a seven workspace instance would usually not restart at all.

Will need to wait until Wednesday to see if improvement continues when markets are active.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #26 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

Thanks @pawnbroker, this is one of the best Ninjatrader performance improvements ever.

I tried putting the Templates folder and the SQLServer CE database on the RAMDisk but did not see any performance improvement, so moved them back to their default locations. Will try that with the Indicator folder too, mainly out of curiosity.

For now the RAMDisk contains only the five data storage folders (data, day, tick, minute, cache) from the db folder, and the db folder has junctions that link to them. I used Link Shell Extension to create the links.

Technically, the database files are inside the SQLServer CE folders called Ninjatrader and Ninjatrader.Old. The files in the five folders are not part of the SQLServer database. They are data storage files, but strictly speaking are not database files. When Ninjatrader refers to the database they are referring to the SQLServer database, which does NOT store historical data.

This seems like a stable setup. The RAMDisk software is a production version so I don't consider this to be a white knuckle "experiment". Ninjatrader loads faster and with less drama, especially with multiple workspaces. There is none of the flashing and freezing that I was used to seeing as workspaces and charts loaded from data stored on the hard disk. The RAMDisk backup image is only being updated once per hour and on shutdown, but the loss of some of that data due to an unexpected event would not be a serious problem anyway.

The main problem is that the datastore folders will eventually outgrow the RAMDisk partition. There are various ways to handle this, which may be a little awkward but are worth the trouble based on the improvement in performance.


Putting the datastore folders on their own dedicated physical disk, preferably an SSD and linking to them from junctions in the db folder would simplify dealing with large amounts of historical data. This would not perform as well as the RAMDisk but would certainly be an improvement on the base configuration due to reduction of I/O conflicts - even if using a hard drive.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #27 (permalink)
 pawnbroker 
Cheltenham
 
Experience: Advanced
Platform: InvestorRT, NinjaTrader
Trading: ES
Posts: 54 since Jan 2012
Thanks Given: 8
Thanks Received: 107


Zondor View Post
Putting the datastore folders on their own dedicated physical disk, preferably an SSD and linking to them from junctions in the db folder would simplify dealing with large amounts of historical data. This would not perform as well as the RAMDisk but would certainly be an improvement on the base configuration due to reduction of I/O conflicts - even if using a hard drive.

You may like to try SuperCache 5 to create a RAM cache for a drive. I tried that while the markets were closed and saw no improvement, but I saw the same with a RAM drive too. Perhaps my set up needs the stress of live data coming in to get an improvement.

SuperCache sounds good, because you can dedicate say 2 GB of memory for a disk of any size. That would avoid the disk space issue, but it is only worthwhile if there is a performance gain.

I have not tried FancyCache yet, which is a similar product in beta and free while in beta.

With both of those apps, you should not use the option to cache writes. That is very dangerous as lost writes can cause corruption and NT will be improved most by fast reads.

Anyway, I am glad to see that the RAM disk idea is having some benefits!

Started this thread Reply With Quote
Thanked by:
  #28 (permalink)
 futuretrader 
Como Italy
 
Experience: Intermediate
Platform: Ninjatrader, customized
Trading: ES
Posts: 525 since Feb 2010
Thanks Given: 471
Thanks Received: 643

I'd been getting increasingly frustrated with NT's slow startup. After reading this thread, and particularly Zondor's posts, I decided to try reducing the size of the db folder by archiving what I wasn't using. By itself, this cut startup time by about two thirds. Perhaps NT runs a check on the entire db on initial startup.

Reply With Quote
Thanked by:
  #29 (permalink)
 
djkiwi's Avatar
 djkiwi 
Mercer Island WA
 
Experience: Advanced
Platform: Ninjatrader/Strategy Desk
Broker: Various
Trading: TF/NQ/ES/Stocks
Posts: 561 since May 2010
Thanks Given: 981
Thanks Received: 1,558


futuretrader View Post
I'd been getting increasingly frustrated with NT's slow startup. After reading this thread, and particularly Zondor's posts, I decided to try reducing the size of the db folder by archiving what I wasn't using. By itself, this cut startup time by about two thirds. Perhaps NT runs a check on the entire db on initial startup.

I must try that one. I've been deleting the database cache which seemed to help.

This has been a bone of contention over the years. I'm hoping NT8 overhauls the entire database structure. I suspect Ninjatrader doesn't have a hardcore database expert on staff who has the skills to redesign the architecture. It does seem extremely slow particularly compared to other packages I see people using in demos. I'm seeing FT71 loading his volume profiles back a few years in seconds....

Cheers
DJ

Reply With Quote
  #30 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731


Have not given much thought to disk caching software since I am already dedicating two USB memory sticks to Windows Ready Boost®.

Noticing that with the historical data archives moved to the RAM disk I can run multiple complex workspaces simultaneously in replay mode, reliably. Up until now this would cause Ninja to freeze and crash. However with this setup, during day session hours the CPU load is very high and with the contoller set for 500x, the replay is only at around 3x actual speed.

If using inefficiently coded indicators the results would not be as good. Maybe we should call the revision of indicators to reduce resource load "economization" rather than optimizaion, to avoid confusion with strategy optimization.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on August 6, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts