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

Someone to please correct coding an indicator

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

    Someone to please correct coding an indicator

    I have an indicator that was made for me by someone that just doesn't work properly. I am asking for a knowledgeable person that would trouble shoot the code and fix the problem of why it's not performing as it should. I would gladly allow the indicator (ATR with auto extensions) to be used as the person sees fit that fixes it. Please let me know and I will send it to you how ever you tell me. Thanks in advance.

    #2
    Hello diver,

    Thank you for post.

    You can search our extensive library of vendors who provide programming services through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more!

    Search trading apps & services to cusomize your NinjaTrader platform with trading indicators, signals and strategies.


    You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third party services for NinjaTrader all pricing and support information will need to be obtained through the consultant.

    This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    Please let me know if you have any questions, concerns or if I can provide any further assistance by responding to this thread at your convenience.
    Ryan L.NinjaTrader Customer Service

    Comment


      #3
      Ryan,

      It's because of one of your "vendors" that I'm here looking for help.

      Comment


        #4
        Originally posted by diver View Post
        I have an indicator that was made for me by someone that just doesn't work properly. I am asking for a knowledgeable person that would trouble shoot the code and fix the problem of why it's not performing as it should. I would gladly allow the indicator (ATR with auto extensions) to be used as the person sees fit that fixes it. Please let me know and I will send it to you how ever you tell me. Thanks in advance.
        Just attach the indicator and post here. It may pick someone's interest to help you.

        Cheers!

        Comment


          #5
          Good Idea. Here it is:
          Attached Files

          Comment


            #6
            Originally posted by diver View Post
            Good Idea. Here it is:
            Diver,

            It would help people if you explain what the issues are that need fixes. What is it supposed to do, what is not doing, how is used, etc. These details would help the helper to make your indicator working and useful for intended purposes. Obviously you gave some description of what you needed to the programmer that did not meet your expectations.

            "just doesn't work properly" is too open ended and does not say much to someone to begin looking for issues not knowing what the indicator is supposed to do.

            Cheers!

            Comment


              #7
              Originally posted by aligator View Post
              Diver,

              It would help people if you explain what the issues are that need fixes. What is it supposed to do, what is not doing, how is used, etc. These details would help the helper to make your indicator working and useful for intended purposes. Obviously you gave some description of what you needed to the programmer that did not meet your expectations.

              "just doesn't work properly" is too open ended and does not say much to someone to begin looking for issues not knowing what the indicator is supposed to do.

              Cheers!
              Thanks again Aligator! You are right so here goes.

              This is a 3 extension period (user defined) ATR indicator. It plots the ATR level based on the user input for a given amount of days etc. When the session rolls over it should show the upper and lower ATR levels of the user defined levels. These levels change as new highs and lows are made. When an ATR level is hit the 3 extensions of that ATR appear on the chart. They are: 125%, 150%, 175%. Until the ATR level is hit no extensions should appear on the chart.

              Problems:

              1.The math isn't correct. The ATR levels are not plotting correctly and consequently the relative extensions are incorrect as well.

              2. On some charts not all charts the extensions are showing up before the respective ATR level is hit.

              I hope this helps some.

              Comment


                #8
                Hello diver,

                Thanks for reaching out for assistance on the forums!

                I won't be able to debug the indicator for you, but I could give you some input on how to work on the code to achieve your desired results.

                1.The math isn't correct. The ATR levels are not plotting correctly and consequently the relative extensions are incorrect as well.
                If you have narrowed the issue down to incorrect math, than that is a great start. You can look for how the Values[][] get set for each plot and then take further debugging steps to add prints and watch how each Value gets calculated, and how that calculation could be corrected.

                2. On some charts not all charts the extensions are showing up before the respective ATR level is hit.
                I'd suggest narrowing this down to a reproducible case that you can recreate with the Playback Connection and Market Replay data. You can add prints to the code that tell you more about the circumstances in which the extensions are appearing or possibly not getting set back.

                Debugging resources can be found here:

                Values[][] - https://ninjatrader.com/support/help...us/?values.htm

                Debugging - https://ninjatrader.com/support/foru...ead.php?t=3418

                Playback Connection - https://ninjatrader.com/support/help...s/set_up12.htm

                As I am not an expert on this custom indicator, I would highly encourage you to consult the developer of the indicator and let them know things aren't quite right. As long as you are clear with the issue, they should be able to understand and fix it.

                If there is anything else we can do to help, please let us know.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Jim View Post
                  Hello diver,

                  Thanks for reaching out for assistance on the forums!

                  I won't be able to debug the indicator for you, but I could give you some input on how to work on the code to achieve your desired results.


                  If you have narrowed the issue down to incorrect math, than that is a great start. You can look for how the Values[][] get set for each plot and then take further debugging steps to add prints and watch how each Value gets calculated, and how that calculation could be corrected.


                  I'd suggest narrowing this down to a reproducible case that you can recreate with the Playback Connection and Market Replay data. You can add prints to the code that tell you more about the circumstances in which the extensions are appearing or possibly not getting set back.

                  Debugging resources can be found here:

                  Values[][] - https://ninjatrader.com/support/help...us/?values.htm

                  Debugging - https://ninjatrader.com/support/foru...ead.php?t=3418

                  Playback Connection - https://ninjatrader.com/support/help...s/set_up12.htm

                  As I am not an expert on this custom indicator, I would highly encourage you to consult the developer of the indicator and let them know things aren't quite right. As long as you are clear with the issue, they should be able to understand and fix it.

                  If there is anything else we can do to help, please let us know.
                  Thanks for the comeback. I am working with the person who wrote the code for me but he is stumped. We know the problems but can't figure out where it exactly is and how to fix it. I'll show him your reply and see if that helps him. Thanks again.

                  Comment


                    #10
                    Originally posted by diver View Post
                    .... I am working with the person who wrote the code for me but he is stumped. We know the problems but can't figure out where it exactly is and how to fix it.....
                    if(DPeriod1 != 0)
                    {
                    Values[4][0] = SessionLow + DATR1[0];

                    PlotValuesBack(4);
                    }
                    else
                    // Values[0].Reset(); //I think this is suppose to be Values[4].Reset();

                    I am pretty good with debugging(my job) I suggest he comments out all plots calculation except Plot 0. then work on it until it looks right.

                    First, I put the 3 ATRs on daily chart to compare with ATR calculated for each session, they are all diff.

                    Second,
                    I mark start of each session with a vertical color line and print DATR1, DATR2, DATR3, the values are close enough to be treated as of the same value.
                    You can see red lines trace each session high and low.

                    Conclusion: this is range breakout indicator but given the way of the range of each session calculated and compare that range to each given ATR , I am not sure what consistency conclusion can be deducted from this.
                    Attached Files
                    Last edited by nkhoi; 01-24-2018, 10:45 AM.

                    Comment


                      #11
                      Compound decision on "Double" 's

                      Trying to perform a decision based on multiple criteria of Double(s.) The code would be something like this:

                      if (( MIN(Low, 10)[1] = MIN(Low, 10)[0]) && (MAX(High,10[1] = MAX(High, 10)[0]))
                      return;

                      This is to limit calculations when there is no change. Unfortunately, I get the error that " &&" cannot be used on doubles. So as an inexperienced programmer I can only think that I would have to convert MIN(Low, 10)[1] and the others to strings that would be compared.

                      1. It seems doing that would add as much or more code and calculations as not doing the compare and letting the useless calculation happen.

                      2. Since this is for multiple instruments with different string types (.e... 58.21, 0.0999, etc...) Not sure if the string requires a format. And of course an INT would not work for the decimal instruments.

                      May I request a recommendation.

                      Second question for the same indicator hopefully will be right next to this one in the thread: Draw.Horizontal.Line needs release

                      Comment


                        #12
                        Draw.Horizontal.Line needs release

                        My previous question once resolved will have the system draw a horizontal line that changes on the fly. It appears this change, which can occur VERY quickly in a short term with breakouts, may cause an issue where the current drawn line as first line for instance named MinLowLine will not be accurate.

                        The first line would be dropped and a second line with the same name MinLowLine is drawn. In fast events it ppears this can be an issue. Is there a line of code that would release the first drawn line value immediately before the new line with the new value is written?

                        I tried finding answers for both these questions in the documentation but could not find a definitive answer for either one. First question: Compound decision on "Double" 's

                        Thank you for your assistance in advance since I will simply click thanks if solution(s) are presented.

                        Comment


                          #13
                          Hello JMont1,

                          I am seeing some basic compiler errors in the line of code shared. Providing programming education escapes the scope of services we may provide in the support department, but I may suggest you review what Basic Programming Concepts we have outlined in our NinjaTrader 7 help guide or any other external resources that may provide further direction for writing correct syntax.

                          Notably, please understand how operators you are using are to be used. The AND operator (&&) checks if two boolean values are both true, or both false. ASSIGNMENT operators (=) set a value and do not compare. The IS EQUAL (==) Operator compares two values for equality. I may also suggest to look up the compiler errors on Google to get a better understanding on what these mean and how to fix them. There are many other beginning programmers who hit similar issues on other projects and their experiences can be useful for your learning as well.

                          I may also suggest to use the Strategy Builder or Strategy Wizard to create the logic, and then click View code to see the resulting syntax.

                          NinjaTrader 7 programming concepts - https://ninjatrader.com/support/help...sic_syntax.htm

                          Strategy Builder 301 - https://www.youtube.com/watch?v=HCyt90GAs9k

                          Please let me know if we can be of further assistance.
                          JimNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by sightcareclickhere, Today, 01:55 PM
                          0 responses
                          1 view
                          0 likes
                          Last Post sightcareclickhere  
                          Started by Mindset, 05-06-2023, 09:03 PM
                          9 responses
                          258 views
                          0 likes
                          Last Post ender_wiggum  
                          Started by Mizzouman1, Today, 07:35 AM
                          4 responses
                          18 views
                          0 likes
                          Last Post Mizzouman1  
                          Started by philmg, Today, 01:17 PM
                          1 response
                          6 views
                          0 likes
                          Last Post NinjaTrader_ChristopherJ  
                          Started by cre8able, Today, 01:01 PM
                          1 response
                          9 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Working...
                          X