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

Want indicator value to appear as integer in Data Box

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

    Want indicator value to appear as integer in Data Box

    I've got an indicator to plot bar numbers on the chart.

    This previously just ran in Plot() and didn't have any DataSeries or Value etc.

    However, I often disable the plotting using a button on the chart so I can get rid of the numbers for the sake of a clearer view. In this situation though, I want to see the bar number in the Data Box. So I modified the indicator to do that by adding a Plot for the bar number value and rejigging the code.

    The problem is though that it's display as 123.000 or 124.000 instead of 123, 124 etc.

    Admittedly only slight, it is still something I want to fix. How can I resolve this?

    Thanks

    #2
    Hello adamus,

    Thanks for your post. Adding code to the Plot() method is not supported by NinjaTrader. For anything specific to that, you may want to look for and ask questions in the unsupported thread.
    http://ninjatrader.com/support/forum...ad.php?t=22435

    However, it is supported to modify the amount of decimals in the price margin.
    Below is a link to the help guide on FormatPriceMarker that shows an example of this.
    http://www.ninjatrader.com/support/h...ricemarker.htm

    The decimals shown in the Data Box will be the same decimals shown on the chart.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi ChelseaB

      that's not the solution I expected, but it does exactly what I needed.

      Thanks v. much.

      Comment


        #4
        In the Data Box, my bar numbers appear now as I want them which is great.

        However as you can see from the screen shot, the label for the bar number is "Dummy".

        Can I change this somehow?
        Attached Files

        Comment


          #5
          Hi adamus,

          The Dummy is a plot that appears to be coming from an indicator named Blast.

          You may be able to open this indicator and rename the plot.

          To edit a script (if it is open source) click Tools -> Edit NinjaScript -> Indicator... -> select Blast -> click OK

          In the Initialize() section of the script you should see an Add command with Dummy as the plot name. Rename this and then compile the script.
          For example:
          Add(new Plot(Color.Blue, "Dummy"));

          Below is a link to the help guide on Add() which has an example of this.
          http://www.ninjatrader.com/support/h...es/nt7/add.htm
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Right - I thought it should be that but it's not.

            Maybe it's an old value I put in as a test which Ninja saved? I just created a new chart and added the indicator from scratch and it came up properly, as I have this in my code:

            Add(new Plot(Color.Aqua, "Bar Numbers"));

            Does "Bar Numbers" get saved by Ninja then? So if I recompile the indicator with something else instead of "Bar Numbers", I mean that Ninja will still display "Bar Numbers" unless I delete the indicator and re-add it?

            It's not a big deal, I'm just curious how Ninja deals with it.

            Comment


              #7
              Hello adamus,

              Thanks for your reply.

              By delete and re-add the indicator you are referring to removing the instance of the indicator from the chart and re-adding this, correct?

              You are not referring to creating a new indicator and copying the code to it are you?

              You are correct, there are a few things here that can cause the instance of the script to need to be removed and re-added to a chart. This includes changes to plots as well as changes to any public variables that show in the parameters of the script.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                That's right, just off and back onto the chart. That makes sense then. Thanks.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by MarianApalaghiei, Today, 10:49 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by love2code2trade, Yesterday, 01:45 PM
                4 responses
                28 views
                0 likes
                Last Post love2code2trade  
                Started by funk10101, Today, 09:43 PM
                0 responses
                8 views
                0 likes
                Last Post funk10101  
                Started by pkefal, 04-11-2024, 07:39 AM
                11 responses
                37 views
                0 likes
                Last Post jeronymite  
                Started by bill2023, Yesterday, 08:51 AM
                8 responses
                46 views
                0 likes
                Last Post bill2023  
                Working...
                X