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 Barry Milan, Yesterday, 10:35 PM
        6 responses
        18 views
        0 likes
        Last Post Barry Milan  
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Started by DJ888, 04-16-2024, 06:09 PM
        4 responses
        13 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        12 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        8 views
        0 likes
        Last Post nandhumca  
        Working...
        X