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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X