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

editing standard pivots indicator

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

    editing standard pivots indicator

    I've copied the standard Pivots indicator code to a new file I've named PivotsImproved. I am changing the formula for S3/R3 and adding midpoints, stored in variables s1m, s2m... etc.

    I'm getting a flood of error messages regarding NinjaTrader.Custom.Resource. I have programmed in Java before etc, but am having difficulty with NinjaScript.

    The error output is attached.
    I had to try to utilize NinjaTrader.Custom.Resource.PivotsR1m (R2m.. etc) alongside of the standard code showing NinjaTrader.Custom.Resource.PivotsPP, R1, R2... etc. However, obviously this code doesn't exist, so I need to fill in for this.

    There are some other errors I am unsure of. I appreciate any guidance!
    Attached Files

    #2
    If you want people to comment, Why don't you post your modified indicator.
    Example. Did you add the corresponding Plots for the new variables? Its hard
    to comment on just an error message.

    Comment


      #3
      Of course, thanks.

      Here's a pdf of the code.
      Attached Files

      Comment


        #4
        I've had a quick look at what you have posted. It's far too much to go through in detail but a few observations to help you along:

        1. In your State == State.SetDefaults the name and description will not work the way you have them. It is much simpler for you to use the following:

        Code:
        Description = @"Displays my new improved pivot point indicator.";
        Name = "MyIndicatorName";
        2. You have:

        Code:
        [TypeConverter("NinjaTrader.NinjaScript.Indicators.PivotsTypeConverterImproved")]
        public class PivotsImproved : Indicator
        { ... }
        I guarantee you that NT staff did not create a Type converter of this type. You would have to write your own type converter of this type. Perhaps your code might work if you use the original type converter that came with the original indicator. If not, you might think about skipping the type converter altogether.

        3. Add your own plots for your indicator. Don't use NinjaTrader.Custom.Resource.Pivots... You don't need to use these. You can simply use for example,

        Code:
        AddPlot(new Stroke(Brushes.Lime, DashStyleHelper.Solid, 2), PlotStyle.Line, "pivot1");
        There are many ways to accomplish what you want but I am trying to keep things simple for you. Start with this and see how far you get with your indicator.

        All the best

        Comment


          #5
          Thank you! I'm going to use these suggestions. I don't have a full understanding of all segments of this code, but I'll give it a shot. Will get back to you. Thanks for posting

          Comment


            #6
            You are welcome.
            All the best

            Comment


              #7
              Originally posted by Zeos6 View Post
              You are welcome.
              All the best
              Sweet, I got the indicator to work!

              Last thing - the program uses the close as the close at 5 pm Eastern. I need it to use the close of the bar ending at 4:15 pm Eastern. What code modification would allow this? I searched the Ninjascript language page, not able to find what I need..

              Cheers

              Comment


                #8
                Hello pappal,

                Thanks for your posts.

                Good job creating your pivots, great community support from members JerryWar and Zeos6 to get you started.

                The pivots, like all indicators, will use the trading hours of the instrument the indicator is applied to. To change the hours you would need to set the trading hours template needed for the instrument. Most instruments already have the correct trading hours defined however you can change to what you need. To change the trading hours of an instrument on a chart, right mouse click on the chart and select "data series..", in the data series window find the row "Trading Hours", left click on the drop down arrow in the current setting to select the template needed. Reference: http://ninjatrader.com/support/helpG...price_data.htm

                To see the specific trading hours of a temple, in the NinjaTrader control center, go to Tools>Trading hours. Reference: http://ninjatrader.com/support/helpG...urs_window.htm
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                19 views
                0 likes
                Last Post algospoke  
                Started by ghoul, Today, 06:02 PM
                3 responses
                14 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                45 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                21 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                181 views
                0 likes
                Last Post jeronymite  
                Working...
                X