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, 05-11-2026, 05:56 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    199 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    365 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    283 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X