• 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

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 vantojo, 03-14-2020, 10:36 AM
      8 responses
      63 views
      0 likes
      Last Post xTrader1  
      Started by nctpar, Yesterday, 02:13 PM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Started by webus, Today, 12:02 AM
      0 responses
      8 views
      0 likes
      Last Post webus
      by webus
       
      Started by jeronymite, Yesterday, 09:26 PM
      0 responses
      12 views
      0 likes
      Last Post jeronymite  
      Started by ttodua, 08-08-2020, 06:45 AM
      2 responses
      17 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X