NexusFi: Find Your Edge


Home Menu

 





Invalid instrument


Discussion in NinjaTrader

Updated
    1. trending_up 3,225 views
    2. thumb_up 3 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

Invalid instrument

  #1 (permalink)
Mondrakete
Germany
 
Posts: 24 since Feb 2011
Thanks Given: 1
Thanks Received: 0

Hi,

does anybody know how to work around that NT-bug?

The strategy 'xxx' has called the Add() method with an invalid instrument. Either 'TBP_Daily ##-##' does not exist in the Instrument Manager or the specified exchange has not been configured.

That's the message that comes up when I try to run a multiple timeframe script using (successfully) imported futures data
within selfcreated instruments.

NT Support said this is a current NT-limitation and has to do with the name of the instrument.
However, the above error came up when trying suggestions of the support.

How do you guys handle this?

Thanks in advance!

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

configure the instrument properly. particularly make sure the you have assigned the proper exchange. in the indicator make sure the string name matches with the instrument name exactly.

likely error, you have marked the instrument as a stock in the instrument manager.

Reply With Quote
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



Mondrakete View Post
Hi,

does anybody know how to work around that NT-bug?

The strategy 'xxx' has called the Add() method with an invalid instrument. Either 'TBP_Daily ##-##' does not exist in the Instrument Manager or the specified exchange has not been configured.

That's the message that comes up when I try to run a multiple timeframe script using (successfully) imported futures data
within selfcreated instruments.

NT Support said this is a current NT-limitation and has to do with the name of the instrument.
However, the above error came up when trying suggestions of the support.

How do you guys handle this?

Thanks in advance!

The name TPB_Daily ##-## is really strange. ##-## is used to identify continuous futures contracts. But I do not know any futures contract with the symbol TPB or TPB_Daily. Also NinjaTrader does not have such a thing as Symbol_Daily, so no wonder that it is not working.

What data do you want to add for which contract or stock?

Reply With Quote
  #4 (permalink)
Mondrakete
Germany
 
Posts: 24 since Feb 2011
Thanks Given: 1
Thanks Received: 0

The instrument is self created.
It contains historical daily data of a continuous futures contract successfully imported from a txt-File.
The symbol is used for backtesting only.
Here are the settings that I made in the instrument manager:
type: future
Exchange: CBOE, also tried default, both didn't work
currency: US-Dollar
instrument name: TBP_DAILY

When referencing the future instrument within a script according to NT support the date must be included .
In my case this would be TBP_Daily ##-##.

@ bukkan: What's the proper instrument configuration in my case?
Which role does the exchange selection play?

Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

If you call the instrument TBP, the continuous futures contract would be referenced as TBP ##-##. To add that instrument you would use

 
Code
Add ("TBP ##-##", PeriodType.Day, 1);
I still do not see, how to use that TBP_Daily.

By the way, continuous futures contracts cannot be used for backtesting, as the data streams are synthetically spliced and do not reflect anything. The correct contract for backtesting would be a mergebackadjusted contract, because

-> it automatically compensates for gains and losses on rolling positions (just need to add transaction cost and slippage once per month)
-> profits and losses encountered are exactly those that you would have experienced when trading the front month

Backtesting on a continuous futures contract distorts all (!) profits and losses and also does not account for rollover gains or losses.

Reply With Quote
Thanked by:
  #6 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

Mondrakete,
rename the text file as TBP_Daily ##-##.txt (mind the space) and then re-import the same.

Reply With Quote
  #7 (permalink)
Mondrakete
Germany
 
Posts: 24 since Feb 2011
Thanks Given: 1
Thanks Received: 0

@ bukkan
I just did it like that. But I called it in the script as weekly data since it's multi time frame.
I am able to call the instrument when viewing the imported data within charts. So, data are successfully imported into the instrument.
However, when I try to add those instruments within Initialize() the script compiles, but gives an error message
when executing it. NT Support told me this is due to a current limitation that has to do with the name of the custom instrument. However, their suggestions didn't work eighter till now. May be there is still another error I'm not aware of at the moment-what about the exchange, what would be a "wrong" setting? May be it's the symbol map settings. May be it's the setting as continious contract. I don't know.

@ Fat Tails
In this case it is a backadjusted-merged continious contract.
I will also test with nonadjusted merged contracts. For doing so, I will exit on day before rollover and entry again
after rollover. Those imported data within custom instruments are for backtesting huge data histories.
Adding transactions costs once a month only makes sence if rollover takes place once a month, right?
There are quite a few futures that are traded with 4 front months only.

Reply With Quote
  #8 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

I created a dummy file and tested the same. seems its case sensitive. use TBP_DAILY ##-## as the instrument name instead of TBP_Daily ##-##

Reply With Quote
Thanked by:
  #9 (permalink)
Mondrakete
Germany
 
Posts: 24 since Feb 2011
Thanks Given: 1
Thanks Received: 0


bukkan View Post
I created a dummy file and tested the same. seems its case sensitive. use TBP_DAILY ##-## as the instrument name instead of TBP_Daily ##-##

Thank you very much. That was it.
Now it works.

Reply With Quote
  #10 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



Mondrakete View Post
@ Fat Tails In this case it is a backadjusted-merged continious contract.
I will also test with nonadjusted merged contracts. For doing so, I will exit on day before rollover and entry again
after rollover. Those imported data within custom instruments are for backtesting huge data histories.
Adding transactions costs once a month only makes sence if rollover takes place once a month, right?
There are quite a few futures that are traded with 4 front months only.

Correct.

I had CL in mind, because I had rolled it today.

Of course, index futures are only rolled once per quarter.

Reply With Quote




Last Updated on June 17, 2011


© 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