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

Adding a custom property in DataSeries grid for a new Bar Type

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

    Adding a custom property in DataSeries grid for a new Bar Type

    Hi,

    I would like to add a new property for a custom Bar Type of my own.

    Please give a sample code for say a new boolean property using the standard bolean type converter.

    The result will be to have a new Check Box inserted into the Data Series grid.

    Thanks






    #2
    Hello rforteza,

    In general it would only be possible to use the existing inherited variables Value and Value2. This may be possible by creating a custom PropertyDescriptor, however this is not something that would be documented or that we would have samples for. PropertyDescriptor's are a C# concept, you can find an example of one in the following public link: https://stackoverflow.com/q/11892064 This is not something I am aware has been done, so this would certainly need tested and explored if this is something you wanted to do.

    A BarsType is not as simple as an Indicator where only a public property is needed. In a BarsType, this works with properties collection directly.

    Generally it is suggested to modify one of the existing inherited properties like the other BarsTypes do, however there are no bool inherited properties you can use. You would instead use a value like 0 and 1 to denote false and true.

    The PointAndFigure is a good example of using the existing properties, you can see how this is done in its code:

    Code:
    SetPropertyName("Value",    Custom.Resource.NinjaScriptBarsTypePointAndFigureBoxSize);
    SetPropertyName("Value2",    Custom.Resource.NinjaScriptBarsTypePointAndFigureReversal);
    Value and Value2 are generic properties which can be used for any purpose your BarsType needs.


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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by vecnopus, Today, 06:15 AM
    0 responses
    1 view
    0 likes
    Last Post vecnopus  
    Started by Aviram Y, Today, 05:29 AM
    0 responses
    5 views
    0 likes
    Last Post Aviram Y  
    Started by quantismo, 04-17-2024, 05:13 PM
    3 responses
    27 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by ScottWalsh, 04-16-2024, 04:29 PM
    7 responses
    36 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cls71, Today, 04:45 AM
    0 responses
    6 views
    0 likes
    Last Post cls71
    by cls71
     
    Working...
    X