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 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