- If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.
Collapse
No announcement yet.
Collapse
NinjaTrader
Collapse
X
Collapse
- Posts
- Latest Activity
- Photos
Filter
Clear All
new posts
EastLondonKiwi
Junior Member
- Sep 2016
- 69
#1
US 10 Year bonds instrument
Hi
I am struggling to find the US 10 year bonds instrument, in the instrument list I have.
Can support either point me at the correct instrument name or point me at a help guide reference that explains how to load it.
Kind regards
Duncan
Tags:None
NinjaTrader_EricB
NinjaTrader Customer Service
- Aug 2014
- 2736
#2
Hello EastLondonKiwi,
Thank you for your post,
The 10 Year US Bonds is listed in NinjaTrader as "ZN."
To view this, I suggest going to New > Chart > Select the magnifying glass > Search "ZN" and select by double-clicking > OK to open the chart.
Once this is complete, you'll then be able to access the ZN from every instrument drop-down list.
https://ninjatrader.com/support/help...ntselector.htm
Let us know if we may assist further.
Eric B.NinjaTrader Customer Service
Comment
EastLondonKiwi
Junior Member
- Sep 2016
- 69
#3
Thanks Eric. I'll check out ZN.
in Ninja script 8 what is the method I could call that lists all the Instruments? and what properties can be derived from it?
Eg Name, Type (Futures, Forex) etc...
Kind regards
Duncan
Comment
NinjaTrader_JessicaP
NinjaTrader Customer Service
- Dec 2015
- 2457
#4
Thank you for your question Duncan. While there is no supported method for doing this, other users have had some luck investigating the undocumented object NinjaTrader.Cbi.InstrumentList.All . Undocumented code can not be supported nor guaranteed to be maintained. However, for the moment, the following block of code will work.
Code:
[FONT=Courier New] protected override void OnBarUpdate() { foreach(NinjaTrader.Cbi.InstrumentList l in NinjaTrader.Cbi.InstrumentList.All) { Print(l.Name); foreach(Instrument i in l.Instruments) { Print(i.FullName); } } }[/FONT]
Jessica P.NinjaTrader Customer Service
Comment
#5
Thanks Jessica you are a star
Comment
EastLondonKiwi
Junior Member
- Sep 2016
- 69
#6
Jessica Ok I am getting there.
Firstly. Calling NinjaTrader.Cbi.Instrument must be within the method OnStateChange, trying to call it from OnBarUpdate causes an error
Once I figured that out I got results I was after
Then I realised the Instrument list is a derived list made by a User, and is not the list of Instrument I want to check. I am after the entire list of instruments my NinjaTrader database contains. So based on your example I got to this point.
Code:
foreach (NinjaTrader.Cbi.Instrument l in NinjaTrader.Cbi.Instrument.All){ Print(l.MasterInstrument.Name){
However. this is now more data than I need and I want to only add to a variable those name where the InstrumentType equals "Forex"
but I am having a blond moment and can not figure out how to cast l.MasterInstrument.InstrumentType to a string. I had thought this would work, but I was wrong:
Code:
foreach (NinjaTrader.Cbi.Instrument l in NinjaTrader.Cbi.Instrument.All){ where(l.MasterInstrument.InstrumentType.ToString.Contains("Forex")) { Print(l.MasterInstrument.Name) }{
Can you advise
Thanks
Duncan
Comment
NinjaTrader_JessicaP
NinjaTrader Customer Service
- Dec 2015
- 2457
#7
We are discussing undocumented functionality and parts of NinjaTrader we do not directly support. Discovering how to filter down to a specific instrument list is a trial and error investigative process. This said the code example I posted earlier was tried inside an indicator's onbarupdate routine, and if you will carefully analyze the difference between my code and your code I believe you will be able to see a point where the code I posted is capable of making this distinction already. I recommend running it in a new indicator as the indicator's entire onbarupdate method, with a ninjascript output window already open, then pressing ctrl+a, ctrl+c inside the output window, and finally pasting the copied output into your favorite text editor. If you look inside the output for a known symbol, for example, the ES 06-17, then look upward from there, and compare this to the code, you should be able to discover how to filter based on instrument list.
Jessica P.NinjaTrader Customer Service
Comment
EastLondonKiwi
Junior Member
- Sep 2016
- 69
#8
Thanks Jessica
I will look at your code again and access, however I am still sure the list in your code is the derived lists to enable a user to group specific instruments together making finding them later easier, and while I could use these lists as the basis for my indicator, I would rather have a more generic method I can use for wider purposes. So I will keep battling on with figuring out how to address the output. Oh and for clarification I am using the Output window for assessing the results.
Ok that said can you also have a look at the instrument ZN 06-17 that is the US 10 year bonds futures instrument.
I found that instrument in the database, and I can add that to a chart, but I get no data from it? does that mean I am limited in the data type my licenses allows me to access or is there some other issue I need to address.
Thanks
Duncan
Comment
NinjaTrader_JessicaP
NinjaTrader Customer Service
- Dec 2015
- 2457
#9
Originally posted by EastLondonKiwiView Post
I found that instrument in the database, and I can add that to a chart, but I get no data from it? does that mean I am limited in the data type my licenses allows me to access
Usually this is the case. I would like to invite you to visit Tools -> Instruments, find and edit your ZN instrument, and compare your settings to those I have attached, to ensure that your instrument mappings are not causing this. 06-17 is a recent expiry date.
Attached Files
Jessica P.NinjaTrader Customer Service
Comment
EastLondonKiwi
Junior Member
- Sep 2016
- 69
#10
Thanks Jessica
My settings match your settings, so I have to assume it's my data feed.
Thanks
Duncan
Comment
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Pop up window when closing a tabby jjopd2001 Started by jjopd2001, Today, 05:26 AM | 0 responses 0 views 0 likes | Last Post by jjopd2001 | ||
Neuropure Reviews 2024 BUYER BEWARE!(Shocking Consumer Reports Exposed)by JaniceContreras Started by JaniceContreras, Today, 05:16 AM | 0 responses 3 views 0 likes | Last Post by JaniceContreras | ||
How to Start a new Candle (Tick Chart) at a specific time?by Margi2021 Started by Margi2021, Yesterday, 01:04 PM | 2 responses 24 views 0 likes | Last Post by Margi2021 | ||
two time frames same chart. indicator from timeframe hiddenby SteveReiza Started by SteveReiza, Yesterday, 11:34 PM | 1 response 9 views 0 likes | Last Post by NinjaTrader_Jason | ||
apex trade copier. multiple instrumentsby SteveReiza Started by SteveReiza, Yesterday, 11:20 PM | 2 responses 12 views 0 likes | Last Post by NinjaTrader_Jason |
View All
All times are GMT-7. This page was generated at 05:59 AM.
Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing one’s financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.
CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates.
Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.
Working...
X