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 RDTrader16, Today, 10:19 PM
          0 responses
          5 views
          0 likes
          Last Post RDTrader16  
          Started by gemify, 03-08-2023, 08:02 AM
          9 responses
          148 views
          0 likes
          Last Post culpepper  
          Started by elirion, Today, 10:03 PM
          0 responses
          1 view
          0 likes
          Last Post elirion
          by elirion
           
          Started by RaddiFX, Today, 09:55 PM
          0 responses
          6 views
          0 likes
          Last Post RaddiFX
          by RaddiFX
           
          Started by Trader146, 03-29-2024, 01:22 PM
          4 responses
          26 views
          0 likes
          Last Post Trader146  
          Working...
          X