Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Change chart instrument using code

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

    Change chart instrument using code

    Hi,

    I have an indicator that saves chart data to MySql.

    Is there a way to change the instrument displayed on a chart using code?

    Is there a better way to gather OHLC data for various instruments than cycling through charts?

    Thanks for any assistance you can provide.

    Ian

    #2
    Hello Ian,

    Thanks for your post.

    There is not a supported way to change the instrument on a chart programmatically, but you could consider invoking the Overlay Instrument Selector and using SendKeys to enter the new instrument. My colleague Chelsea does this in his Rollover Indications indicator.

    Shows a button on the chart to roll the expiry to the next available contract month. Option to hide button until a number of days before or on roll date. Another option to confirm by opening the instrument overlay selector or automatically rollover without confirmation. (Update June 27th, 2019 – Added an option to show […]


    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    Another option would be to programmatically add data series to a script with AddDataSeries (data series should be hardcoded.)

    Multi Time Frame and Instruments - https://ninjatrader.com/support/help...nstruments.htm

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim, Chelsea's code worked fine.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Barry Milan, Today, 10:35 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by WeyldFalcon, 12-10-2020, 06:48 PM
      14 responses
      1,427 views
      0 likes
      Last Post Handclap0241  
      Started by DJ888, Yesterday, 06:09 PM
      2 responses
      9 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      40 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Today, 08:51 AM
      2 responses
      16 views
      0 likes
      Last Post bill2023  
      Working...
      X