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