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

Add your own variables to DataBox

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

    Add your own variables to DataBox

    I have about a dozen variables I'd like to add to the Databox but I'm not sure how to go about doing that in the simplest way. The variables are several different types (ints, strings, bools).

    Anyone have any suggestions? Thanks for your help!

    #2
    Hello,

    Thank you for the post.

    The databox specifically would be able to display the Plots of your indicator. For other items such as strings or bools, you would likely need to instead create your own display instead of using the databox specifically.

    The most simple way to do this would be to use the Drawing Tools like Draw.Text to draw these values on the chart either for each bar or in one area of the chart.

    For double values or int values, you could make Plots and those would show up in the databox for each bar. If you are looking to achieve a similar effect where you can scroll around and see the values for each bar, you would likely need to use an Indicator that implements OnRender and gathers the mouse position to know what bar is hovered.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for the fast response!

      Okay, I think I can live with just having the ints and doubles in the databox for now.

      Could you describe the process to add a plot based on myDouble but not have it displayed on the chart?

      I very much appreciate your help with this!

      Comment


        #4
        Hello,


        To hide plots and have them show up in the databox, you have two options.

        If you have other plots that should show up but want to hide a few, you would use Brushes.Transparent for the color of the plot, and also use ShowTransparentPlotsInDataBox property.



        Both pages have examples on the syntax needed.

        The other option, if this should not display any plots and only show them in the databox, you could implement the OnRender override and do not call the base.OnRender to prevent the plots from being rendered.

        Code:
        protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
        {
          //  base.OnRender(chartControl, chartScale); //adding the override and omitting this line prevents plots from displaying
        }


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cre8able, Today, 01:16 PM
        2 responses
        9 views
        0 likes
        Last Post cre8able  
        Started by chbruno, 04-24-2024, 04:10 PM
        3 responses
        48 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by samish18, Today, 01:01 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by WHICKED, Today, 12:56 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by WHICKED, Today, 12:45 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X