Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator squishes candlestick bars

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

    Indicator squishes candlestick bars

    I'm a non-coder, and I wanted to use an indicator called AdvancedRiskReward as a base for adding various functions that I wanted.

    With the existing indicator, you click the middle mouse button over a bar, and it draws a stop line one tick below the bar, a line at the entry one tick above, and lines at various targets above, which you can control through the indicator settings. It also prints the stop and target values from entry in points. I wanted to make two changes: get the stop and targets in dollars. and rather than measuring between the high and the low, I wanted to measure from the open to the close.

    I gave Claude 3.5 the base code and asked it to make the changes. After some work, we got it to compile without error. As soon as I placed it on a chart, it squished all the lines into a small horizontal area at the top of the chart. When I removed the indicator from the chart, it returned the bars to their normal size. I discovered that although AdvancedRiskReward continued to function normally, now, when I placed it on a chart, the lines squished together, although we had made zero changes to this indicator.

    The indicator also works fine when I add it to a chart through a template. There's only a problem when it's added from the Indicators dialog. Also, removing RiskRewardClicker from the system didn't fix the problem. I also tried re-installing NT from both a backup and doing a fresh install from the web. Still no joy. Before doing these file restores, I removed RiskRewardClicker from the Indicators folder.

    I've been working on this error with Claude for about three full days. I suggested to it that it prepare a troubleshooting history which I could show you. Please see attached. I've also attached the RiskRewardClicker indicator. I tried to attach the AdvancedRiskReward indicator, but your editing program wouldn't let me--either as a cs file or when I had converted it to a text file.

    I would greatly appreciate any help that you could give me. My big concern is that if I don't correct the problem, I 'm going to have trouble in the future adding indicators to charts.
    Attached Files

    #2
    Hello sgordet,

    Squished chart bars generally means something is plotting or drawing at a price very far away from the price action. (like possibly plotting a value of 0)
    With the AutoScaling (which can be enabled / disabled for an object in the Indicators / Drawing Objects / Data Series windows) the chart will adjust the range to try and include all objects with autoscaling enabled in view.

    I would first recommend changing the Panel to a new panel to look at the values plotted from the indicator to see if these are prices similar to the bar price action.

    The script you will need to debug to understand its behavior and why the behavior is not as you expect.

    To understand why the script is behaving as it is, such as plotting a specific value 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 strategy add prints (outside of any conditions) that print the date time of the bar and all values compared in every condition and assignment that calculates the plot value.
    The prints should include the time of the bar and should print all values from all variables and all hard coded values in all conditions that must evaluate as true for this action to be triggered. It is very important to include a text label for each value and for each comparison operator in the print to understand what is being compared in the condition sets.
    The debugging print output should clearly show what the condition is, what time the conditions are being compared, all values being compared, and how they are being compared.

    Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

    I am happy to assist you with analyzing the output from the output window.

    Run or backtest the script and when the output from the output window appears save this by right-clicking the output window and selecting Save As... -> give the output file a name and save -> then attach the output text file to your reply.

    Below is a link to a support article that demonstrates using informative prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.


    Let me know the date and time the behavior occurred or when you are expecting the behavior to occur.


    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.​
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks, Chelsea, for getting back to me so quickly, and with such a detailed debugging plan--Much appreciated.
      Before I start this, I was wondering if you had an hypothesis as to why, after I removed from the system the offending program, RiskRewardClicker, the program which it was based on, AdvancedRiskReward, showed the squiggly lines effect when it was added to a chart from the indicators dialog and not from a template, nor did it exhibit the behavior when it was already present in a chart. Bear in mind that AdvancedRiskReward never had its programming touched.

      I think that any thoughts that you had about that would be very helpful.

      Stephen

      Comment


        #4
        Hello Stephen,

        I would venture something was changed.

        Note, there is a difference between compile errors and run-time errors.

        A compile error appears in the NinjaScript Editor and means the syntax is wrong. A wrong character somewhere, improper placement of something, a class or variable name not existing, this would cause a compile error.

        A run-time error means there is something wrong with the logic that occurs when the script is running. An unexpected value, a null value, an invalid index, improper branching commands that lead to an unexpected outcome, these would all be run-time issues with logic.
        An actual error (and not just unexpected behavior) will appear on the Log tab of the Control Center.

        I believe you have an issue with the run-time logic and not a syntax error.
        Run time errors are debugged by printing values and reviewing the output.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          But why would it affect indicators which were never changed?

          Comment


            #6
            Hello Stephen,

            It's possible the other script that was modified hasn't caused this issue and the issue was already present in the script.

            It's possible something was overwritten in an incorrect file by accident.

            It's possible a script was renamed incorrectly or copied incorrectly.

            As it's a 3rd party script and I'm not aware of what this machine experienced, it's hard to say.

            But you could directly look at the script debugging output to find out what is wrong, and this might give you a hint as to what happened.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Ah! If the core drawing tools are only modified within the script it's employed in and not affected outside of that script, is it possible that if I remove the script that's showing the squiggles, and which I think I didn't modify, and did a fresh install of that script, I might solve the problem?

              Comment


                #8
                Hello Stephen,

                It's a possibility, but I couldn't say.

                We haven't identified the issue. I would only be making guesses without more information.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  I deleted AdvancedRiskReward and re-installed it. As before, the indicator works fine in all the charts it had been previously employed. When adding it to a chart, I no longer get the squiggle lines, the indicator just doesn't do anything--it no longer marks the stop, the open, and the targets. The label is shown in the upper left hand corner. Next to the label five notes ar printed: Reset, Save Changes, Long, Attached, and Show (colored light blue) . What do those mean?

                  Comment


                    #10
                    Hello sgordet,

                    These would be something custom coded into the script by the author.

                    I recommend contacting the author or vendor that distributed this software to you to inquire what this information means.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    558 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    324 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    101 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    545 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    547 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X