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

RSI band/region in NT8

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

    RSI band/region in NT8

    Hi,

    I have an indicator in NT7 (attached)
    The important part:
    2 blue region: 38-48, 66-83 RSI points
    2 grey region: 17-34, 52-72 RSI points

    Can anyone code it in NT8? or just give some hint how to make it work? I'd say a big thank you for it

    Have a nice day

    Mark
    Attached Files

    #2
    Hello kt5ssm,

    Thank you for your post.

    NinjaTrader Support would not provide programming services, however one of our forum members may wish to develop this for you.

    I would like to inquire if you are asking for a conversion of the indicator to NinjaTrader 8 from NinjaTrader 7 or if you are asking how to use the indicator.

    Is this an indicator you have the code for in NinjaTrader 7? Or is this in a protected assembly?

    I look forward to your response.

    Comment


      #3
      It is an indicator, but I don't know how to migrate it.
      I've figured out I should use draw.regionhighlightY instead but the editor came up with the CS1501 error. It says 7 argument is too much but I don't knpw why:
      Draw.RegionHighlightY(this, "tag1" , High[34], Low[17], Brushes.Blue, Brushes.Green, 20);

      Comment


        #4
        Thank you for the clarification, kt5ssm. If we look at the IntelliSense output when we type out

        Draw.RegionHighlightY(

        we see the 3 overloads in the attached image, which take 5, 6, and 8 arguments. The one that most closely matches your code is

        Code:
        [FONT=Courier New] Draw.RegionHighlightY(this, "tag1", [B]true /* is autoscale? */, [/B]High[34], Low[17], Brushes.Blue, Brushes.Green, 20);[/FONT]
        Please let us know if there are any other ways we can help.
        Attached Files
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Thank you, If I paste this code and then compile, it is ok, but after that I can't find the indicator in the chart's indicator list.

          why?

          Comment


            #6
            This could be for many reasons. If you visit the Log tab in the control center, do you see any text near the top highlighted in orange or yellow?
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Indicator 'rsisav': Error on calling 'OnStateChange' method: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

              Comment


                #8
                Thank you for this additional information. This is telling you that you are trying to access a historical bar before it has data. While directly debugging your strategy code is beyond the scope of the support we may provide, I may make two suggestions.

                First, a "quick fix" if you know your strategy will just be trading live, and you are uninterested in seeing how your strategy would have performed historically, is to ignore all historical data. This will save you time and complicated programming. To do so,

                Code:
                [FONT=Courier New]
                protected override void OnBarUpdate()
                {[B]
                    if (State < State.Realtime)
                    {
                        return;
                    }[/B]
                    // ... your code here[/FONT]
                Otherwise, if you are interested in how your strategy would have performed historically, you are going to need to research your code to find the largest lookback period you have, then replace the bolded value by this value :

                Code:
                [FONT=Courier New]
                protected override void OnBarUpdate()
                {if (CurrentBars[BarsInProgress] < [B]100[/B]){
                        return;
                    }
                    // ... your code here[/FONT]
                If you would like more in-depth help debugging your code, please let us know so we can help you find the services of a NinjaScript consultant.
                Jessica P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by cre8able, Today, 03:20 PM
                0 responses
                2 views
                0 likes
                Last Post cre8able  
                Started by Fran888, 02-16-2024, 10:48 AM
                3 responses
                46 views
                0 likes
                Last Post Sam2515
                by Sam2515
                 
                Started by martin70, 03-24-2023, 04:58 AM
                15 responses
                114 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by The_Sec, Today, 02:29 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by jeronymite, 04-12-2024, 04:26 PM
                2 responses
                31 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X