The problem is quite simple. It is just the definition for "contract month" used by the API.
Interactive Brokers API -> contract month is the month of the last trading date (expiry month)
NinjaTrader -> contract month is the nominal contract month
Now for most of the futures contracts, you will find that the last trading date falls within the nominal contract month, for example the last trading date for ES 06-10 is the third Friday of June, so both NinjaTrader and Interactive Brokers agree that it is June.
However, for the most liquid energy futures traded at NYMEX (including CL, NG, RB, HO) and for IPE traded Brent Crude (BC) and WTI Crude (WTI), the expiry month is just prior to the nominal contract month. These futures cannot be traded through NinjaTrader 6.5 and Interactive Brokers. I think that this is ridiculuous, and that NT should have provided a solution since a long time instead of explaining again and again that it is all the fault of Interactive Brokers.
NinjaTrader 7.0 / IB and Energy Futures
For NinjaTrader 7 developpers made a small workaround, which requires an alternate symbol mapping, so for Interactive Brokers the correct symbol mapping would be
However, NT 188.8.131.52 still had problems correctly backfilling these contracts, when Merge Policy was set to "MergeBackAdjusted". My record was 58 data loading requests for my default workspace just to backfill one day of data....
The IPE Gasoil contract does not suffer from this problem, as the July contract expires in July, so the symbol mapping would just be GOIL.
The problem might also apply to Nybot Sugar Futures (SB), so in case you want to trade sugar futures through NinjaTrader and Interactive Brokers, you would also need to check which of the two symbol mappings, SB or SB||||1 produces the correct result. I cannot do it now during the weekend, but when the market is open, it is easy to check.
In any case, be careful and first do some simulation trading before you put real money at risk. All problems also occur with the IB simulation account.
The following 5 users say Thank You to Fat Tails for this post:
Thanks for the info Fat Tails. I can't believe that Ninja Trader would allow their customers to use their platform for months and months when it has a known issue of not reporting an open position and I believe that stops are not entered either.
Not only has the issue not been fixed in the production version of NT, but no warning or popup has been issued to advise their clients of this potentially serious issue. This is an issue that could send you bust !
I've asked for compensation for my loss from the issue, but havn't heard back from them for a week.
this is the main problem of NinjaTrader. They are sort of jack of all trades trying to make their product work with any data feed and every broker around. But their developpers are not up to this task. In the end there are hundreds of little problems and bugs that they cannot manage.
Also, depending on your time zone, NinjaTrader cannot correctly display daily data of Interactive Brokers for a different definition of time stamps. So I currently do not have daily data for TF, BC or DX.
There are also some really weird bugs. Two days ago my indicator code did not compile. The compiler errors pointed to the NinjaTrader generated code. Finally I found that the editor also checked the outcommented code in the properties region for syntax errors. I had outcommented with "/*" and "*/" as opposed to "//". Developpers confirmed the bug and that I am not allowed to outcomment with "/*" and "*/" in the properties region. This is standard syntax for C#, you are not allowed to use it, and you will not find any information on this.
So expect the unexpected and never use NT for automated trading.
I am not into automated trading systems, this is far beyond my capacities.
For discretionary trading NinjaTrader remains an option, as long as you know all the little tricks. As far as I understood MultiCharts might be more reliable and I will probably use it as an alternative front end for my trading account, when it comes with a DOM.
The following user says Thank You to Fat Tails for this post:
I for sure can not figure out why NT can not fix this. It can not be something so big. All it perhaps requires an additional software layer to do the correct translation.
I hope they do realize that people will get fed-up and some one will write their own API for IB orders and publish it.
Once you can place orders directly with IB by linking in your own code, the need for Ninja's paid license goes away to a large extent. Of course you will not get the trade performance metrics etc but you can still trade!