Announcement

Collapse
No announcement yet.

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.

    https://ninjatraderecosystem.com/use...indications-2/

    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 wjadevries, Today, 12:04 PM
      2 responses
      16 views
      0 likes
      Last Post wjadevries  
      Started by PhineasPhred, Today, 11:52 AM
      2 responses
      14 views
      0 likes
      Last Post PhineasPhred  
      Started by kenbun, Yesterday, 12:21 PM
      2 responses
      21 views
      0 likes
      Last Post eDanny
      by eDanny
       
      Started by patricia70, Today, 11:26 AM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_Spencer  
      Started by pdennis, Today, 11:42 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X