Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator as input to a strategy

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

    Indicator as input to a strategy

    Hi NT,

    I am trying to build a strategy which takes a pre-defined indicator as input. The strategy should be able to choose from all the indicators in NT.
    I know about the "ENUM" but it isn't what I am looking for.

    Otherwise, Is it possible to input a indicator name in strategy properties and later on call the indicator by it's name in strategy to calculate signals ?

    I am not sure but maybe something like this :


    Code:
    private IndicatorBase inputIndicator1;
    ..
    [XmlIgnore()]
    [Description("Indicator 1 input data")]
    [Category("Parameters")] [Gui.Design.DisplayName("Indicator 1")]
    public NinjaTrader.Indicator.IndicatorBase InputIndicator1
    { get { return inputIndicator1; }
    set { inputIndicator1 = value; } }

    #2
    Hello dastaan,

    Thank you for your post.

    It may be possible, but would not be something we could provide very much assistance on as it would require unsupported code.

    A dynamic type can be used for the actual indicator you want to use in your code, but we would also have to consider how to select any indicator as a property, how to modify the property grid to display those indicator properties, and how to construct the indicator with those parameters in our code.

    Dynamic types are standard C# concepts and can be used freely, and we do have some insight for how TypeConverters can be used to dynamically modify the property grid:



    However, we do not have an "All Indicators" picker to offer and we could not provide any insight for using Reflection to identify properties of the dynamically selected indicator and how to write a constructor with it.

    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X