Ninja Soft Page Faults - NinjaTrader Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming

Ninja Soft Page Faults
Started:February 20th, 2013 (11:24 AM) by sniffy Views / Replies:479 / 3
Last Reply:February 23rd, 2013 (02:31 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Ninja Soft Page Faults

Old February 20th, 2013, 11:24 AM   #1 (permalink)
Trading Apprentice
Futures Experience: Master
Platform: ninja
Posts: 7 since Oct 2009
Thanks: 0 given, 5 received

Ninja Soft Page Faults

Does anyone have millions and millions of soft page faults when running Ninja ?

I have gazillions of them.

Reply With Quote

Old February 20th, 2013, 11:24 AM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Old February 20th, 2013, 01:27 PM   #3 (permalink)
Market Wizard
Birmingham UK
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
ratfink's Avatar
Posts: 2,826 since Dec 2012
Thanks: 8,481 given, 5,414 received
Forum Reputation: Legendary

sniffy View Post
Does anyone have millions and millions of soft page faults when running Ninja ?

I have gazillions of them.

Depends more on the working set size and the PF Delta (i.e. rate), if the baseline PF Delta is in the 2-5k range during normal use for a 500Mb footprint I'd say that's very normal. PF Delta on mine will jump to 12-15k when I switch workspaces but its still instant.

All OO type software programs tend to destroy low-level caches, hence the desire for heaps of DDR3. Not really a worry given the level of functionality we get in exchange, only a real worry if you get into hard page fault territory, then you have a system dog on your hands...

Travel Well
Reply With Quote
The following user says Thank You to ratfink for this post:

Old February 23rd, 2013, 02:31 PM   #4 (permalink)
Trading Apprentice
Futures Experience: Master
Platform: ninja
Posts: 7 since Oct 2009
Thanks: 0 given, 5 received

Here's the skinny

So for all those thousands who are secretly dying to know ...

The background is that I have a spawned Form that creates price bars/other objects and is drawn and updated by a multi-layered graphics process that uses Bitmaps for buffers. This gives me double buffering with the drawing taking place in memory, then the painting of only those elements that have changed taking place in the Paint event handler.

However, I had left in place in my Form constructor, the setStyle instruction to use .Net double buffering. (I think the default for Forms is double buffering). So I changed that to not use double buffering ( I was already doing it manually through the Bitmap buffer after all).

Here is my complete setStyle list:

this.DoubleBuffered = false;
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);

Getting rid of the .Net double buffering reduced my soft page faults PFDelta from a background level of circa 450 with quite frequent peaks of 6/7 K and even up to 10-20K, by more than half. By double buffering x double buffering I presume that I was probably setting up a nice chain of unnecessary page faults.

Has there been any noticeable performance degradation ? None whatsover. The Bitmap double buffering and other anti-flicker options in the setStyles are clearly doing their job.

Not that there was any apparent visual issue before this change other than the unsettling number of soft page faults. However when you are waiting for confirmation of a fill or whatever, every little edge can obviously be very valuable.

In the process of trying to track down the reasons for these page faults I also noticed that I was allocating the Bitmaps in a way that didn't make sense, and sorting this out seems to have reduced the page fault regime further, and sorted a very small Dispose issue.

I also tried different options in the Bitmap allocation statement. I found that there was no apparent effect either on perceived graphics performance, or on the page fault annoyance. I currently use this:

Bitmap newBitmap5 = new Bitmap(rightPanel.Width, rightPanel.Height, PixelFormat.Format32bppPArgb);

So where am I now?

I have a baseline PFDelta of about 300 with peaks/spikes up to about 1K. Perceived graphics performance is still excellent with not a sign of flicker. Reducing the number of soft page faults was not the objective, gaining an understanding of why they seemed so high was.

Last edited by sniffy; February 23rd, 2013 at 03:29 PM.
Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > NinjaTrader Programming > Ninja Soft Page Faults

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
US Economy Hits a Soft Patch, But Some See It as 'Temporary' Quick Summary News and Current Events 0 May 30th, 2011 01:50 PM
Apple Macs now seen as a 'soft target' for spreading viruses kbit Tech Support 0 May 23rd, 2011 06:10 PM
Tuesday: Stocks Start May Soft; Look to Auto Sales Quick Summary News and Current Events 0 May 2nd, 2011 11:20 PM
Dollar Broadly Lower After Soft US Economic Reports Quick Summary News and Current Events 0 April 28th, 2011 11:50 AM
No Safe Assets In 'Soft & Fluffy' Europe? Quick Summary News and Current Events 0 December 10th, 2010 04:40 AM

All times are GMT -4. The time now is 09:38 AM.

Copyright © 2016 by 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.
no new posts

Page generated 2016-10-22 in 0.11 seconds with 19 queries on phoenix via your IP