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

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.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by mattbsea, Today, 05:44 PM
    0 responses
    3 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    31 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    2 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,282 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    20 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Working...
    X