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

Getting a value to who in DataBox

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

    Getting a value to who in DataBox

    How do I do this? I have a function in my strategy that does a calculation, and I would like for it to show up in the DataBox. Do I have to create an indicator in order for this to happen? It's just a function. Point me in the right direction please.

    #2
    imported post

    The databox shows values on indicators series. So, yes you have to create an indicator, stuff your value into a data/plot series which then will be displayed in the data box.

    Comment


      #3
      imported post

      Ok, this is my code generated from wizard. On my onBarUpdate() I have these lines of code:

      double
      d = 0;

      d = (((CCI(
      6)[0] - CCI(14)[0]) / (CCI(6)[1] - CCI(14)[1]))) * 100;

      Value.Set(d);

      Basically, just calculating percentage. I would like the value of "d" to show up in the DataBox. Right now, it's not working.

      Comment


        #4
        imported post

        Did you add a plot in Initialize()?
        RayNinjaTrader Customer Service

        Comment


          #5
          imported post

          Ok, it's because I'm trying to access the data one bar ago for this calculation. The logs say "index out of bounds". Check the code below. So, what does that mean for me? There's plenty of bars on the chart. Does that mean that the indicator does not have access to those? Don't understand.

          Comment


            #6
            imported post

            See this post.

            http://ninjatrader.mywowbb.com/forum14/1911.html
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by gemify, 11-11-2022, 11:52 AM
            6 responses
            803 views
            2 likes
            Last Post ultls
            by ultls
             
            Started by ScottWalsh, Today, 04:52 PM
            0 responses
            3 views
            0 likes
            Last Post ScottWalsh  
            Started by ScottWalsh, Today, 04:29 PM
            0 responses
            7 views
            0 likes
            Last Post ScottWalsh  
            Started by rtwave, 04-12-2024, 09:30 AM
            2 responses
            22 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by tsantospinto, 04-12-2024, 07:04 PM
            5 responses
            70 views
            0 likes
            Last Post tsantospinto  
            Working...
            X