Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy not being detected until refresh

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

    Strategy not being detected until refresh

    I have a strategy that changes my bar color if a criteria is met.

    But at times, the strategy would not be detected and the bar's color would not change in real time, only when I refresh the ninjascript on the chart. Again, this happens only sometimes, other times it detects it correctly.

    The strategy is for "On Bar Close". It uses Order Flow Delta, Volume and BarTimes (https://ninjatraderecosystem.com/use.../nt8-bartimes/)

    Any idea what the issue is?
    Last edited by Ousher; 01-07-2022, 10:16 AM.

    #2
    Hello Ousher,

    Thanks for your post.

    When running a strategy with Calculate mode OnBarClose, the strategy will only process logic at the close of each bar.

    If you would like to have the strategy calculate logic more frequently then you would need to use a Calculate mode of OnEachTick or OnPriceChange. If you use OnEachTick, the strategy will process logic for each incoming tick. OnPriceChange means the strategy would process logic for each change in price.

    See this help guide page for more information on Calculate: https://ninjatrader.com/support/help.../calculate.htm

    Ultimately, to understand why the script is behaving as it is, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

    In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

    Below is a link to a forum post that demonstrates how to use prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121

    Please let me know if I may further assist
    <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, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X