Announcement

Collapse
No announcement yet.

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.

            https://ninjatrader.com/support/foru...igh-price-type

            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 maiyudse, Today, 12:57 AM
            0 responses
            2 views
            0 likes
            Last Post maiyudse  
            Started by SmartArtsStudio, Yesterday, 11:24 PM
            0 responses
            3 views
            0 likes
            Last Post SmartArtsStudio  
            Started by kenz987, Yesterday, 10:06 PM
            0 responses
            4 views
            0 likes
            Last Post kenz987
            by kenz987
             
            Started by AaronKoRn, Yesterday, 07:24 PM
            0 responses
            8 views
            0 likes
            Last Post AaronKoRn  
            Started by Aquatrade, 05-15-2021, 11:46 AM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X