Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access indicator fields

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

    Access indicator fields

    Hi,
    I have an indicator which calculates the entry and stop and draws this information in the chart.
    Now I would like to create a strategy with this indicator. However I do not want to copy the entry/stop code from the indicator to the strategy.

    My idea was to add a public List to the indicator which contains all entry and stop information. Items are added to the list in the Indicator.OnBarUpdate().
    However if I try to access the list in Strategy.OnBarUpdate() the list is always empty because the indicator is calculated *after* the strategy. That doesnt make sense to me. My expectation would be that all indicators are already calculated to the current bar of Strategy.OnBarUpdate.

    Would you please help me with this?

    Thanks a lot and greetings,
    Bobin

    #2
    Hello Bobin,

    Thanks for your post.

    You could call the Update() method in the indicator to ensure the exposed variable is up-to-date.

    See the reference sample linked below for how Update() could be used.
    SampleBoolSeries: https://ninjatrader.com/support/help...alues_that.htm

    Let us know if we may assist further.
    <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, Yesterday, 05:17 AM
    0 responses
    63 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    139 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X