Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarTypes Label

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

    BarTypes Label

    Hello NInjaTrader

    How can i change the label of custom BarTypes ?
    The default is @value Witch uses the bars.BarsPeriod.Value.
    is there a way to change this.

    i would like to be able to set it so i could do something like this.
    (bars.BarsPeriod.BaseBarsPeriodValue + " - " + bars.BarsPeriod.Value)


    Thanks
    Donto
    NinjaTrader Ecosystem Vendor - otrading.dk

    #2
    Hello donto,

    Try overriding the DisplayName string.
    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 donto,

      I've tested the following and didn't have any compile errors.

      public override string DisplayName
      { get { return "Test name"; } }

      Are you certain you've copied the code from the sample code on the documentation?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hello Chelsea
        I got that working now but that is not the field i want to change. this changes the name on the left but what i want to change is the Label on the Right.


        Click image for larger version

Name:	billede.png
Views:	23
Size:	16.6 KB
ID:	1330671


        as default it is set to @value

        Click image for larger version

Name:	billede.png
Views:	21
Size:	13.8 KB
ID:	1330672
        Attached Files
        Donto
        NinjaTrader Ecosystem Vendor - otrading.dk

        Comment


          #5
          Hello donto,

          The label is what would appear on the chart.

          Unfortunately, I'm not certain what window you are looking at. This does not appear to be the internal label of a bar type.

          This looks like a window where you can set a custom string (like in the Alerts window).
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sclay115, Today, 04:06 PM
          6 responses
          19 views
          0 likes
          Last Post sclay115  
          Started by defa0009, 12-13-2024, 09:19 AM
          19 responses
          188 views
          1 like
          Last Post bltdavid  
          Started by frslvr, 04-11-2024, 07:26 AM
          27 responses
          824 views
          1 like
          Last Post grose
          by grose
           
          Started by Malcom3434, Today, 06:35 PM
          0 responses
          6 views
          0 likes
          Last Post Malcom3434  
          Started by prelogmilivoj, Today, 05:32 PM
          0 responses
          7 views
          0 likes
          Last Post prelogmilivoj  
          Working...
          X