Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Small font rendering was significantly improoved with 4.0 - you can not tell draw operations to align with physical pixels (good for small things) and a lot was done for making fonts more readable. I assume it helped that they made VIsual Studio in WPF now, so a lot of the problems start appearing in their own applications and THUS GET FIXED
I was wondering if you would be interested in starting a thread on PC tweaking for traders. I want to learn this stuff and run my PC like a car freak mechanic would run his muscle car..
I'd also like to start on for learning how to tweak NT7, maintain it, and how best to learn C# and what other things you need to know to tweak indicators. I noticed one book on C# in the books thread. Is that a good place to start do you think?
Hoping somebody can help me here.I'm running N6.5 using a VPS (windows server2003 750mb Ram single core.I run a simulation with 12 strategies for a month went perfectly.
I've started trading live 3 days ago and I suddenly get these messages saying that ninja was unable to submit an order due to not enough free threads in the thread Pool.
I contacted Ninja support forum and they say its a VPS problem I contact the VPS people and they say that its not their problem. I can't find any relevant info on the net.
I was wondering if the RAM being less than recommended was an issue (I don't use the VPS for any thing other than simulation and live automated trading).Maybe I need to upgrade to windows server2008 or multiple cores. opinion or advise welcome
750mb ram is not enough to run NinjaTrader. I assume your home machine has 2GB or more, hopefully 4GB or more, just run the strategy live from home for a day and see if you have the same problems.
Server 2008 isn't going to do anything except add more services and slow things down. Your best bet is XP or Windows Seven, and 2GB of ram if you are using NT 6.5.
Essentially you want to avoid looping through the data as much as possible. A good example is a simple moving average. The way most new to programming would tackle that is some sort of loop to iterate over the last N bars and sum the total. Really you should
add close[0]/period
subtract close[period]/period
That is about the simplest type of optimisation but wherever you see a loop you want to try and look at eliminating it if possible. There are always places where you are iterating through ticks or bars or something or other.
I know very little about .NET but have started to try and get up to speed on it. Having said that I hear one area to be wary of is garbage collection (as with any managed framework), it is widely written about.
This is called thread starvation. The .NET runtime allocates one thread pool per process (i.e. NT). In .NET2.0 the thread pool has a default size of 25 worker threads per available processor. In .NET3.5 Microsoft increased this to 250 worker threads. However, NT6.5 runs on .NET2.0 so you are only getting 25 worker threads.
Just found your post on the NT support forum. From the screenshot I can see you are getting an InvalidOperationException when NT invokes HttpWebRequest.BeginGetRequestStream. This is a common problem which NT should be aware of.
Try adding the following line of code to the initialisation method of your NT strategy.
See if that helps. It'll bump up the number of threads in the pool.
This is a software issue, not a VPS issue. Send that link to NT and tell them to pull their finger out and look at their code rather than being so quick to point their finger at the VPS. They should be providing support for their product, not me. I suspect they are making numerous HttpWebRequest calls without understanding the ramifications for the thread pool. On a powerful machine you won't notice a problem because the worker threads will be freed up quickly but on a less powerful machine with limited CPU resources (such as your VPS) you've got a problem.
This problem is completely unconnected to the RAM. But yes, you need a couple of Gig really to run NT comfortably. It's a memory hungry beast.
Stick with Win2003. There's no point in you upgrading to Win2008. Any increased CPU resources (such as additional cores) will definitely help. It sounds like you have a fairly low powered VPS instance and that's going to mean you don't get much CPU time allocated to you. Either get yourself a more powerful VPS or ditch the VPS entirely and run NT on a dedicated box instead (my preference).
Very interesting post at MoveTheMarkets. The way we usually do things is terribly inefficient and there is a better way:
"In all of the coding tutorials and examples I've seen, Ninjatrader indicators are used in-line. So, if you want to know when the SMA is going up, you'd check:
SMA(Close, 5)[0] > SMA(Close, 5)[1]
I find this practice repulsive for two reasons: redundancy and inefficiency. This paper chronicles the path I took to fifinding a better way. If you just want to know what the better way is, skip to the 'Solution' section at the end......"
"The problem is in the caching scheme that Ninjatrader uses for momoization. First off, it's a simple linear search!"
Hmm that is precisely the kind of thing I was eluding too above. You really don't want to be looping through 'stuff'. Loops are bad. Of course if ninja is doing it internally you have problems (as Richard discovered)
Anyone writing Ninjascript code should look at that post at MoveTheMarkets, and implement that idea in their code.
A good test case is the BigMike CollectiveMA. It makes six calls to external MA's.
I already changed it as Richard suggested, and I can easily see that it loads much faster now.
These changes are very easy to make, only taking a few minutes. When you think about it, doing that in an indicator that uses six calls to external MA's will cut the resources used by the indicator to a small fraction of the original demands.