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

I Found an indicator but when I apply it to my chart it doesn't plot anything

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

    I Found an indicator but when I apply it to my chart it doesn't plot anything

    I found in my collection of indicators a Reversal Bar Indicator for Renko charts that I had aquired sometime ago. So I pulled it out and compliled it and it was successful. I then applied it to a chart but it doesn't plot anything.

    Anyone have any ideas why not?



    Attached Files

    #2
    Hello Taddypole,

    I can see this is based on the barPeriodValue.

    It looks like it will be necessary to add debugging prints to get an understanding of why no line is being drawn.

    Print values of the conditions setting the markV variable on lines 86 and 91 one line above each condition.
    And print the value of markV below those condition logic blocks.
    Include labels for each value and comparison operator.

    Below is a link to a support article on adding debugging prints to understand behavior.


    Save the output from the output window (right-click > Save as) and attach this with your next post.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      To start I added 3 simple Print Statements. I compiled the code, re-applied the indicator to the chart and watched the NinjaScript Output winodw. Nothing shows up. What am I doing wrong?

      Attached Files

      Comment


        #4
        Hello Taddypole,

        Add prints higher in the method.

        Line 73 is making sure that barPeriodValue is greater than 0 to continue, but if is 0 will return and stop processing.

        Print barPeriodValue > 0 one line above this condition.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Print statements show that the code is getting to Step 4 but not after. What would cause Step 5 not printing?

          Click image for larger version

Name:	8 step print statements.png
Views:	19
Size:	183.9 KB
ID:	1307631

          Comment


            #6
            Hello Taddypole,

            Most likely line 91.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Near Print 2 I verified the "barPeriodValue" = 5. So shouldn't it get by line 91?

              Comment


                #8
                Hello Taddypole,

                Uncertain, print the value of barPeriodValue one line above the condition.

                Attach the output to your reply.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  It prints a bar value of 5 just before the zero check but doesn't get to Step 5.

                  Click image for larger version

Name:	BarPeriodVerified at 5.png
Views:	16
Size:	279.6 KB
ID:	1307659

                  Comment


                    #10
                    Hello Taddypole,

                    It appears you are printing BarsPeriod.Value and not barPeriodValue.
                    These are not the same.

                    Print barPeriodValue in the print as this is what is being compared in the condition.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Okay, when I properly print barPeriodValue I do get zero. I removed the check for zero, and now the code runs.
                      Can you point me to a good explaination of barPeriodValue?

                      Comment


                        #12
                        Hello Taddypole,

                        Unfortunately, I'm not the author of this script and I don't know what this variable was added for or it's intention.

                        It looks possibly like this is only supposed to run on a specific bar type named 90.. (This is the name of the bar type not the BarsPeriodId)

                        I would recommend asking the author why they wrote this code and how their software is intended to function.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Thank you for your help ChelseaB... it's much appreciated....

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by reekotubbs, Yesterday, 01:09 PM
                          3 responses
                          26 views
                          0 likes
                          Last Post reekotubbs  
                          Started by Blaze212, 07-07-2024, 08:58 PM
                          2 responses
                          18 views
                          0 likes
                          Last Post Blaze212  
                          Started by medicmiked, Today, 11:56 AM
                          0 responses
                          2 views
                          0 likes
                          Last Post medicmiked  
                          Started by miaolivi9, Today, 06:59 AM
                          0 responses
                          8 views
                          0 likes
                          Last Post miaolivi9  
                          Started by tradertweets, Today, 05:36 AM
                          0 responses
                          12 views
                          0 likes
                          Last Post tradertweets  
                          Working...
                          X