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

BarsType or ChartStyle Properties

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

    BarsType or ChartStyle Properties

    Hello,

    I've created my own BarsType and ChartStyle.
    Now I've searched a lot, but haven't found a solution yet.
    I have to pass several properties. (about 10-30)

    How can I pass properties (around 10-30) to BarsType or ChartStyle?

    #2
    Hello 1001111,

    At this time there is no supported way to add additional properties to a BarsType, they have the Value and Value2 properties which are supported. You can add public properties to the class but how you access that really depends on the context of what you are doing.

    I am not aware of any samples of this concept but you may be able to do something similar to the Cast being used in the volumetric example: https://ninjatrader.com/support/help...sub=volumetric

    That presumably (we cant see the code) has public properties defined in the bars type and then you can cast the bars type to your custom type to access its properties. I am not aware of how the properties would be defined so that they could correctly be used but that would be something you can give a try.

    The chart style would be a similar situation where it would need additional public properties however I am not aware of any sample of accessing a chart style with custom properties that I can provide.

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

    Comment


      #3
      I tried again. You cannot pass a property to BarsType. But ChartStyle And that's enough for me.


      Code:
          // example for other people
          public class ExampleChartStyle : ChartStyle
          {
      
              [NinjaScriptProperty]
              [Display(Name = "Demo", Description = "", Order = 1, GroupName = "Demo")]
              public bool Demo { get; set; }
      
              // ... code ...
          }
      Many thanks

      Comment


        #4
        Hello 1001111,

        I am not certain I understand your reply, is this a question/concern?

        Can you provide more detail if you still have a question or concern here?

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by llanqui, Today, 03:53 AM
        0 responses
        4 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        14 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        14 views
        0 likes
        Last Post strategist007  
        Working...
        X