Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Total PNL not working

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

    Total PNL not working

    Hello!

    I had your team help me setup my total PnL bool.

    Its supposed to shut off at -$450 but sometimes it goes over and loses around -$560 when it should shut off and other times it shuts off at the right time.

    I also use renko bars and calculate on bar close.

    Is there a better way to do this so that works closer to where I want it to close.

    #2
    Hello litamm89,

    Thanks for your post.

    You could use Calculate.OnPriceChange so that your strategy calculates for each incoming change in price instead of only at the close of a bar (OnBarClose).

    If you need to detect when a bar closes, you could use IsFirstTickOfBar. IsFirstTickOfBar determines if the incoming tick is the first tick of a new bar, also meaning that the current bar closes since the incoming tick is for a newly forming bar.

    See this help guide page for more information about IsFirstTickOfBar: https://ninjatrader.com/support/help...ttickofbar.htm

    Please note that Renko bars use RemoveLastBar and will result in multiple bar closures when this method gets called in the bar.

    See post #7 in this forum thread for more information: https://ninjatrader.com/support/foru...stbarofsession

    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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    92 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    138 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    121 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    72 views
    0 likes
    Last Post PaulMohn  
    Working...
    X