Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding Indicator to Strategy

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

    Adding Indicator to Strategy

    I am attempting to add the ParabolicSAR to my strategy.
    I am able to Add() the indicator and have it plot to my chart. The problem is that I have been unable to find a way to change the plot attributes for the indicator. I would like to change the color and name associated with it.

    Below is the Code that I am using.
    protectedoverridevoid Initialize()
    {
    ParabolicSAR(0.02, 0.2, 0.02).Plots[0].Name = "ParSAR";
    ParabolicSAR(0.02, 0.2, 0.02).Plots[0].Pen.Color = Color.Blue;
    Add(ParabolicSAR(0.02, 0.2, 0.02));
    CalculateOnBarClose = true;
    }

    protectedoverridevoid OnBarUpdate()
    {
    // Working Code
    }

    publicoverridestring ToString()
    {
    return" ";
    }

    Any assistance would be greatly appreciated.
    Thanks.
    Larry.

    #2
    Larry, which NinjaTrader version are you running? You can check under Help > About - I tested your code with the fixed Parabolic version and it does work as expected -

    Code:
     
    protected override void Initialize()
    {
    ParabolicSARFixed(0.02, 0.2, 0.02).Plots[0].Pen.Color = Color.Blue;
    Add(ParabolicSARFixed(0.02, 0.2, 0.02));
    CalculateOnBarClose = true;
    }

    Comment


      #3
      .NET Version: 2.0.50727.3082

      Ninja Trader Version: 6.5.1000.11

      ===========

      Perhaps my setups for the chart and strategy are not set properly.

      Thanks.
      Larry

      Comment


        #4
        Larry, these are the correct versions -did you gave my posted snippet a try?

        Comment


          #5
          My version of NinjaTrader does not recognize "ParabolicSARFixed()"

          Interestingly ... The price Marker paints the correct color the value plots do not.

          - Larry

          Comment


            #6
            Larry,

            Please disregard the "fixed" part and use the regular ParabolicSAR(). The price markers should show the same value as the plot on the last bar.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hi Josh,

              Yes the ParSAR is correctly plotting the values.
              I was attempting to change the attributes of the plot .. i.e. the color, the name that displays on the chart - such that I could display different names for the different setups in different colors.

              I can get the price marker to the new color of Blue ... The parSAR dots are still the deualt Orange. I wanted to be able to identify my plots from the default indicator color.

              Comment


                #8
                Larry,

                Will look into it.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Larry,

                  Could be a bug. Thank you for reporting. In the meantime, you can bring up the indicators dialogue and then close it to get it to show up as blue.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Yes - that is a work around. Bringing the indicator window active and applying to the chart will change the color to that of my Strategy.

                    Thanks for your help. Looking forward to the upcomming fix.

                    Comment


                      #11
                      Thanks for reporting this one in Larry, it should be fixed in NinjaTrader 7

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      650 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      370 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      109 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      574 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      577 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X