Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

display in data box but not on chart

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

    display in data box but not on chart

    I am doing cycle counts on the Stoch. I've written an indicator that plots the stochastic the way I want.

    I would like to count cycles and display in the Data Box, but don't want them to display on the chart. Can I do that?

    I can also write a separate indicator, but would prefer to have it as one indicator


    #2
    Hi cre8able, thanks for writing in.

    You would need to have two scripts for this. The databox-only script will implement a plot and plot the values in OnBarUpdate normally, but will also override OnRender and simply return from OnRender to cancel out the plot rendering. This would make the plot show up in the data box but not the chart.

    Please let me know if you have any further questions,
    -ChrisL

    Comment


      #3
      hey Chris.

      thanks makes sense but how do I go about changing OnRender()?

      like this?

      protected override void OnRender(ChartControl char tControl, ChartScale chartScale)
      {
      Return();
      }

      Comment


        #4
        Hi cre8able, thanks for your reply.

        That is correct, returning from the OnRender override will prevent the indicator from rendering any graphics to the chart so the plot will only show up in the data box.

        Comment


          #5
          Hello,

          could you please provide, how exactly the code is written for this? I need the same. There is no exact example in the library for OnRender.

          AND

          another question, i would like to get a button in the chart, to switch it on and off, that the indicator is vivible if i would like to check something and when the strategy is running I don´t need to see it, a button would be the perfect solution.
          Last edited by Triple_M; 08-17-2023, 04:06 AM.

          Comment


            #6
            Hello Triple_M,

            Welcome to the NinjaTrader forums!

            cre8able had some some minor syntax errors that would prevent compile. The 'return' is not a method and is not capitalized.
            Code:
            protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
            {
                return;
            }

            See the heading 'Return values' in the microsoft programming guide on c#.
            A method in C# is a code block that contains a series of statements. A program runs the statements by calling the method and specifying arguments.


            Attached is an example with the code from post # 3 corrected and copied and pasted in.
            NoRenderPlotLineTest_NT8.zip
            Attached Files
            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
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            331 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
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X