Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using ForceRefresh() and SessionIterator()

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

    Using ForceRefresh() and SessionIterator()

    Dear Support,

    In some cases when using calculate On Price Change instead of On Bar Close, some drawn objects such as buy/sell signals are not correct and are not updated if there is no price change on the last tick of the bar.

    I am thinking that using The ForceRefresh() on bar update will clean up any object created on price change and recalculate that object for previous bar. Some questions please:

    1. Is that a correct approach to use ForceRefresh() to cleanup wrong signal objects?

    2. Does using ForcRefresh() impact performance, specially if that indicator is used in Market Analyzer to scan a list of symbols (SP500) for that buy/sell signal?

    3. The issue is, for example, that after the market close on Friday the bar will not close until Sunday or Monday when a new bar opens, thus making On Price Change the preferred option to see the last trading day signal before Sunday or Monday open. Would using SessionIterator() help generating signals on market close if calculate on Bar Close is used?

    Please advise if this is a performance issue for a Market Analyzer scan of watchlists and if there is an alternative method other than using ON Bar Close. I know I can use Calculate On Each Tick, but that is a real performance issue for scanning a long watchlist.

    Many Thanks.


    #2
    Hello aligator,

    Thank you for your post.

    ForceRefresh() is used to mark a chart as needing to re-render. ForceRefresh() would not work in an indicator run in a Market Analyzer window since there is no chart to re-render.

    SessionIterator() provides trading hours session data and would not help generate signals when the market closes when OnBarClose is used.

    If you would like to have an indicator that is run in a Market Analyzer window to update on the last tick of a bar, you would need to use OnEachTick even though it could be performance heavy. Using OnBarClose would not update the indicator on the last tick of a bar since the bar would not close until the next tick into the next session.

    For more information about ForceRefresh() and SessionIterator(), see the help guide documentation below.
    ForceRefresh() - https://ninjatrader.com/support/help...rcerefresh.htm
    SessionIterator() - https://ninjatrader.com/support/help...oniterator.htm

    Please 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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X