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)
Without understanding the context of the issue, off the top of my head, you could have problems with PnL on a non USD pair since we have to retrieve the rates at the time of trade execution in order to attempt to properly calculate the PnL. If the rate data is not available, then PnL will be off. This is not an answer to your situation, just off the top of my head information. If you can provide me a ticket #, I can look into this more closely. Also, NinjaTrader is much different in operation than MT4. MT4 serves as the broker's matching engine and thus takes full responsibility for a closed loop system. NinjaTrader in contrast sits on the outside of the system the broker uses to generate statements. If you need to generate statements for clients I would use the data provided by your broker since there should be no question that this data matches your account.
Is there any meaningful alternative to ninjatrader ?
I was trying to develop an own tradingframework based on java with calculations done in c++ for my pair trading approach , but its hell of a lot work. It seems that Ninja is simply to slow programm wise to handle any decent calculation amount in realtime ....
I would not generalize that NinjaTrader is slow. Of course, if you trade ES and perform complex calculations on every incoming tick, this will not work. But you have three options to control speed and avoid freezing
-> only perform calculations on bar close, and not intra-bar
-> use filters within the algorithm, when to perform calculations and when not to perform them
-> pay attention to non-standard plots as they will be triggered with every tick, which is not filtered out by the display update interval
I have no problems with speed, as only some of my indicators are in CalculateOnBarClose = false mode.
The past week, my NT install has been really slow, taking 5 or 6 minutes to startup, and taking 2 to 3 minutes to load charts, and bring up menus, etc. every thing seemed to be bringing up the hour glass. Looking around, I saw that my database file was around 300Mb, but at initial install it was around 4Mb, so I performed an NT database backup, deleted the database file, restarted NT, and performed a database restore. Now the application is operating normally again, with acceptable performance.
If you set your indicator to CalculateOnBarClose = true,
-> OnBarUpDate() will only be called once the bar is completed
-> but the Plot() method of every indicator of every visible chart in your active workspace will be called every 200 milliseconds, if that is the chart display update interval that you selected (I use the default value of 0.5 sec)
Some indicators use custom plots that perform extensive calculations within the Plot() method. I have observed that this can slow down NinjaTrader considerably. It is best practice to try as much as possible to have a slim Plot() method.
Maybe there is some room for improvement here. If an indicator is in CalculateOnBarClose = true mode, it would be best to store the result of the Plot() method in a cache to avoid recalculating for nothing. But I am not sure, if the architecture of NinjaTrader will allow for this modification.
Ok, got it. When I have an indicator I want to calculate only on bar close, I store the CurrentBar number and only perform the calculation when the CurrentBar number changes. That way, no matter what CalculateOnBarClose is set to, the calculation only happens once.
Every indicator can be set to CalculateOnBarClose = true, so you do not need to code anything. However, for the Plot Override Method() you can either
-> filter before performing calculations (check for new current bar or values that need to change)
-> check at the beginning of Plot Override() whether a new bar has been called
The second exercise is not so easy, because you need to store the lastBarPainted and firstBarPainted in a cache for checking. Also you need to store the paths for all plots of the indicator, as you need to retrieve them, when Plot Override() is executed without calculations.