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

Setting Indicator to Reset on RTH Open

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

    Setting Indicator to Reset on RTH Open

    Hello,
    I am running the RTH session only and want to have the indicator to reset on the Open. I was hoping for any direction and examples if possible. I'm a total novice to coding but trying hard to learn. I'm looking to reset the RMI indicator that I attached here.
    Thank you for any help with this and I appreciate all those helping here in these forums.
    Thanks again.
    James
    Attached Files

    #2
    Hello James,

    Thanks for your post.

    You could consider using Bars.IsFirstBarOfSession in a condition to detect if the current bar processing is the first bar updated in a trading session and reset the values you want within that condition.

    See this help guide for more information about Bars.IsFirstBarOfSession and sample code: https://ninjatrader.com/support/help...rofsession.htm

    Let us know if we may assist further.

    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello Brandon,
      Thank you for your response. I'm really new to coding and looked through the information and tried out a few options but wasn't able to get anything to work. Is it possible to see an example?
      Thanks again for any help.
      Regards,
      James

      Comment


        #4
        Hello James,

        Thanks for your note.

        I understand that you want to reset values in your script to begin a trading session fresh.

        See the reference sample, SampleTradeLimiter, linked below that demonstrates resetting a variable at the beginning of a new trading session by using Bars.IsFirstBarOfSession.



        Let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Thanks Brandon.
          I will take a look at the example script and see what I can come up with.
          Thanks again for your time.
          Regards,
          James

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by claxxical, 05-30-2017, 12:30 PM
          37 responses
          4,452 views
          0 likes
          Last Post Padan
          by Padan
           
          Started by SugarDefwebsite, Today, 02:18 AM
          0 responses
          3 views
          0 likes
          Last Post SugarDefwebsite  
          Started by usglucofreeze, Today, 01:19 AM
          0 responses
          7 views
          0 likes
          Last Post usglucofreeze  
          Started by f.saeidi, Today, 01:12 AM
          0 responses
          13 views
          0 likes
          Last Post f.saeidi  
          Started by NinjaTrader_ChelseaB, 03-14-2017, 10:17 AM
          227 responses
          34,319 views
          7 likes
          Last Post rare312
          by rare312
           
          Working...
          X