Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Assign property Indicator Property in Strategy

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

    Assign property Indicator Property in Strategy

    Team,

    I have declared a below property/parameter in Indicator

    [Display(Description = "", GroupName = "Parameters", Name = "Base Param1", Order = 1)]
    [Range(1, 2147483647)]
    public int BaseParam1 { get; set; }


    In Strategy, I would like to assign value to this parameter. How can I do it?
    Can I do it through Wizard or through code?


    #2
    Hello surya,

    Thank you for your post.

    Setting the value for the indicator property within a strategy could be accomplished by adding the indicator to your strategy. Then, assigning a value for the indicator property.

    For example, if we have an indicator called MyCustomIndicator and a strategy called MyCustomStrategy, we would add the indicator to the strategy. The code would look something like this.

    private MyCustomIndicator myCustomIndicator;

    Then, we could assign a value to the indicator parameter within the OnBarUpdate() method of the strategy. This would look something like myCustomIndicator.BaseParam1 = 10;

    See the attached example script that demonstrates this.

    Please note that this would not be possible to accomplish in the Strategy Builder. You would need to unlock your code from the Strategy Builder to accomplish this.

    Let us know if we may assist further.
    Attached Files
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    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