Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

display variable values in data box

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

    display variable values in data box

    Hello,

    Is there a way to display the result of a variable in the data box?

    For exemple,

    protected override void OnBarUpdate()
    {​
    double myRatio = x + y;
    Print(myRatio); // comes out in output window
    }

    If i use AddPlot it will display something in the chart. But i dont want that, i want the result in the data box.

    Thank you
    btw: NT forum often disconnect or send us to wrong page while trying to log on or create topic.

    #2
    Hello frankduc,

    Only plots are going to appear in the data box.

    However, you don't have to show the plot.

    Call return at the top of the OnRender() override and this will prevent any plots from rendering.
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      Is the value will appear live in the data box? The value change and is updating as volume come in.
      On the chart you have to point by moving over the chart to see different values plot.

      Ty

      Comment


        #4
        Hello frankduc,

        The data box shows data for the bar the mouse cursor is placed over.

        If you are wanting to always show data from a specific bar, you might consider using Draw.TextFixed() or custom rendering in OnRender() the the value on the chart.

        Or you might choose to open your own addon window and display the specific values you would like to see.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea,

          I like the idea of displaying my variables values in an open window, that's exactly what i want.
          But i am not sure what is the goal of the example. It display the name of the instrument in the chart. I would like the return of my variable to be display in the opened window. Same as when i use the output window but in a more fashion and pretty way. Any examples that do that?

          Ty

          Comment


            #6
            Hello,

            The example is demonstrating how to open a new window with a button click and how to transfer information from the window to the script that opened it.

            There is not an example of specifically what you are trying to code that I know of, but the example I have provided shows the basics of how this would be achieved.

            The script assigns the instance of itself to the TargetIndicator variable in the addon, and this provides access to anything public from the script.
            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
            557 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