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 NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    48 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X