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

Amount of bars not changed after the indicator had been launched last.

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

    #16
    Correction!!!

    Values[0][0] = variable1[li_4];
    Values[1][0] = variable2[li_4];

    Comment


      #17
      Hello Stanfillirenfro,

      Thank you for your note.

      After adding prints to the script you shared and testing the indicator, it seems that neither condition in the loop is becoming true. Since neither condition is becoming true, a value is not being set for variable1 and variable2. Also, since variable1 and variable2 are not assigned a value, there is no value being assigned to the plots.

      To understand why the script is behaving as it is, such as plotting when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

      In the indicator, add prints for every variable and condition being used in your script and also print the CurrentBar. This will allow you to see how the conditions in your script are evaluating to determine where the issue is occurring.

      Below is a link to a forum post that demonstrates using prints to understand behavior and including a link to a video recorded using the Strategy Builder.
      https://ninjatrader.com/support/foru...121#post791121

      That said, please note in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

      Please let me know if I may further assist
      Brandon H.NinjaTrader Customer Service

      Comment


        #18
        Many thanks Brandonh for your valuable help.
        I have to go back and check and understand all the links you just povided to me.
        I will revert to you if I need clarification.

        Thanks again!

        Comment


          #19
          Hello BrandonH!
          Thanks again for your help.
          I could make somme improvement since yesterdayy and I have seen at output that my

          double val1 = ADX(High, ADXbars)[li_4 - 1];
          double val2 = ADX(Low, ADXbars)[li_4 - 1];

          identic are. For each incrementation I obtain the same value for val1 and val2, so that the condition could not be true. But I am wondering why both values are identic.
          In the documentation we have: double value = ADX(High, 20)[0]; meaning the current value of a 20 period ADX using high price type.
          My val1 should be therefore the value at position [li_1 -1] of ADXBars (int) period using high price type, while val2 represents the value at position [li_1 -1] of ADXBars (int) period using Low price type.
          What is wrong in my calculation so that val1 and val2 are identic?

          Thanks!

          Comment


            #20
            Hello Stanfillirenfro,

            Thank you for your note.

            I see that you have opened another forum thread regarding this same topic. The thread is linked below. In the future, please refrain from opening multiple forum threads regarding the same topic. This causes multiple technicians to work the same ticket, ultimately slowing our response time.

            Hello! I am trying to get the the current vlues of x period ADX using high and low price types. For this ppurpuse I have used a loop. for int ( i = 100; i >= 0; i--) { double val1 = ADX(High, ADXbars)[i - 1]; double val2 = ADX(Low, ADXbars)[i - 1]; } I have seen at output that val1 and val2 are identic. For each


            I see that my colleague Jesse has answered this question and provided an example script in that forum thread. Please review the post by Jesse as well as see the example script he shared.

            Let us know if we may assist further.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kaywai, Today, 06:26 AM
            1 response
            6 views
            0 likes
            Last Post kaywai
            by kaywai
             
            Started by ct, 05-07-2023, 12:31 PM
            6 responses
            203 views
            0 likes
            Last Post wisconsinpat  
            Started by kevinenergy, 02-17-2023, 12:42 PM
            118 responses
            2,780 views
            1 like
            Last Post kevinenergy  
            Started by briansaul, Today, 05:31 AM
            0 responses
            10 views
            0 likes
            Last Post briansaul  
            Started by traderqz, Yesterday, 12:06 AM
            11 responses
            28 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X