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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X