Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Brevo, Today, 01:45 AM
    0 responses
    6 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    5 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    242 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    6 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Working...
    X