• 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

RSI value at close of bar

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

    RSI value at close of bar

    Hi I have a strategy I’m working on. To put a order in 1 tick above the high of a candle close, when the RSI value crosses above the oversold. The issue I’m having is it is reading the RSI last value but it’s not basing it off the close of the candle. How can I get it to only read when the candle closes, to read the value of the RSI? To input the order. Thanks

    #2
    Hello Hurrikane,

    Thanks for your post and welcome to the Ninjatrader forums!

    Can you clarify if you are working directly in Ninjascript or are you using the Strategy Builder?

    What Calculate mode is the strategy running in? (OnBarClose, OnPriceChange, or OnEachTick)

    Are you testing the strategy on live data, marker replay data or in the strategy analyzer with historical data?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply.
      I am using Ninjascript
      I have tried OnBarClose and OnEachTick but it keeps getting me in multiple times per bar.
      I am testing live data

      Comment


        #4
        Hello Hurrikane,

        Thanks for your reply.

        If you use Calculate.OnBarClose then your strategy code will run one per bar when the bar closes. The values of the RSI would be of the values when the bar closes and would not change.

        You could also use Calculate.OnEachTick and use the system bool IsFirstTickOfBar as a trigger to run your coe that only needs to run once per bar.
        Reference: https://ninjatrader.com/support/help...ttickofbar.htm

        Here is a link to an example that shows this in use: https://ninjatrader.com/support/help...either_cal.htm
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Okay thanks! I got it to work correctly on a minute chart. When I change my chart to a tick chart it isn’t reading the OnBarClose. Do I need the script to read different for tick charts?

          Comment


            #6
            Hello Hurrikane,

            Thanks for your reply.

            Calculate.OnBarClose will work in every bar type.

            Do you see any errors in the "Log" tab of the control center related to the strategy?

            If so that would need to be addressed.

            If no errors, can you clarify your comments "...it isn’t reading the OnBarClose.".

            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jayfutures23, Today, 07:06 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Melissa  
            Started by MojoJojo, Today, 05:59 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Spark68, Yesterday, 07:48 PM
            1 response
            19 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by Lotyok, Today, 01:08 AM
            4 responses
            26 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by Tri-Star, Yesterday, 07:28 PM
            3 responses
            12 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Working...
            X