• 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.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Programmatically add a new instrument

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • liborc
    replied
    Hi Chelsea,

    Thank you very much for this piece of code, it is exactly what I needed and works just fine.

    You are the best, Chelsea!

    Many thanks again,

    Libor

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Libor,

    This method was not supported by NinjaTrader Support to do for NinjaTrader 7.

    That said, the Instruments.txt file is no longer used for NinjaTrader 8. Instead these settings are read from the NinjaTrader.sdf file in the Program Files directory.

    vladko,

    I failed to provide you with a tracking ID for you feature request.

    For future reference your request to allow instruments to be inserted into the NinjaTrader database via NinjaScript is being tracked with ID #SFT-1849.

    Please note, it is up to the NinjaTrader Development to decide if and when a request will be implemented.

    That said, I was working in a completely different area and might have found some undocumented and 100% unsupported code that might make this happen for you.
    Code:
    Account.All.First(a=> a.Name == "Sim101").Connection.ResolveSymbol("TestSymbol1", InstrumentType.Stock, Exchange.Default, NinjaTrader.Core.Globals.MaxDate, 0, OptionRight.Unknown, true, (resolvedInstrument, errorCode, errMsg, o) =>
        {
         resolvedInstrument.MasterInstrument.TickSize = 0.01;
        }, null);
    Last edited by NinjaTrader_ChelseaB; 10-31-2019, 10:10 AM.

    Leave a comment:


  • liborc
    replied
    Hi Chelsea,

    I understand there is no proper customer support for this, but in an old NT7 thread, the adding of instruments in bulk was discussed as possible and efficient - using the intstruments.txt file.

    See the thread here: http://ninjatrader.com/support/forum...ad.php?t=34232

    I sorely miss such a feature and hope that maybe this is still an option in NT8, but I do not have the instruments.txt file format specs so that I could try it.

    Could you please shed some light here?

    Many thanks,

    Libor

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello vladko,

    Instruments are saved in the NinjaTrader database located in:
    • Documents\NinjaTrader 8\db\NinjaTrader.sdf

    Leave a comment:


  • vladko
    replied
    I mean which files are updated?

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello vladko,

    Any instruments you manually modify the settings for and save, will take effect once the data is reloaded.

    Leave a comment:


  • vladko
    replied
    What happens when manually updating the database? (from "Instruments" window)

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello vladko,

    It is not supported to programmatically add an instrument to the NinjaTrader database in either NinjaTrader 7 or NinjaTrader 8.

    I will submit a feature request on your behalf to allow instruments to be created from a NinjaScript.

    This thread will remain open for any community members who may know of an unsupported way to achieve this and would like to share.

    Leave a comment:


  • vladko
    started a topic Programmatically add a new instrument

    Programmatically add a new instrument

    How to programmatically add a new instrument?
    In 7 versions this was done by editing the "Instruments.txt" file

Latest Posts

Collapse

Topics Statistics Last Post
Started by plydcv, Today, 12:40 AM
0 responses
1 view
0 likes
Last Post plydcv
by plydcv
 
Started by Sh00tHerMcGavin, Yesterday, 07:39 PM
0 responses
3 views
0 likes
Last Post Sh00tHerMcGavin  
Started by Mberg, Yesterday, 05:13 PM
0 responses
1 view
0 likes
Last Post Mberg
by Mberg
 
Started by Barry Milan, Yesterday, 01:33 PM
2 responses
10 views
0 likes
Last Post marcus2300  
Started by NW Trader, Yesterday, 03:42 PM
2 responses
8 views
0 likes
Last Post NW Trader  
Working...
X