• 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

Need method to set interval programmatically

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

    Need method to set interval programmatically

    There needs to be a simple method to change the chart interval programmatically, for example by passing a BarPeriod object. Using SendKeys generally does not work per (https://ninjatrader.com/support/foru...ad.php?t=81953), and even if that did work, it does not provide a means to set a custom interval.

    This is a feature that has been asked for numerous times since NT7, and should be easy to add since the interval selector obviously already handles the change, and just needs to be properly exposed to us with a BarPeriod input.

    #2
    Hello aslane,

    Thanks for your inquiry.

    The feature request ticket ID is SFT-1085. It has not yet been fulfilled, so I will submit a vote on your behalf for a supported way to programmatically change a chart's instrument/interval.

    Upon fulfillment feature requests will be noted in the help guide when a release of NinjaTrader contains the implementation. Release notes can be found here: https://ninjatrader.com/support/help...ease_notes.htm

    In the meantime, you may wish to investigate Chelsea's RolloverIndications indicator to experiment with a way to do this through unsupported code. The button press to rollover starts at line 138.

    His script can be found here: https://ninjatrader.com/support/foru...atid=7&lpage=1

    Please let us know if we can be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thank you, that code reference is very helpful.

      Also, while it is not documented, it seems that setting the Interval on the IntervalSelector to any period value seems to work (including custom bar types). Not sure if there are any unknown side affects, but so far seems to work. YMMV. If that was properly tested/documented that would meet the requirements for setting the interval.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pennywise, Yesterday, 04:14 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by MarthaClines, Today, 06:20 PM
      0 responses
      7 views
      0 likes
      Last Post MarthaClines  
      Started by Irukandji, 05-09-2019, 04:28 AM
      38 responses
      298 views
      0 likes
      Last Post nkhoi
      by nkhoi
       
      Started by manugarc, Today, 01:15 PM
      0 responses
      11 views
      0 likes
      Last Post manugarc  
      Started by JMont1, Today, 11:42 AM
      0 responses
      10 views
      0 likes
      Last Post JMont1
      by JMont1
       
      Working...
      X