Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit Trade When Realized Profit < Dollar Amount

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

    Exit Trade When Realized Profit < Dollar Amount

    I am trying to build logic into my strategy which tells the strategy to exit any trades and stop a strategy if the Realized profit and loss is greater than a certain dollar amount.

    I have everything set up right, but I can't get the script to look at the account realized profit and loss correctly.

    I see this thread https://ninjatrader.com/support/foru...d.php?t=108392

    but the logic isn't working for realized or unrealized. I tried to include print statements for "UnrealizedPnl" and nothing is printing. So that tells me it is not working correctly.

    I am thinking the "if(e.AccountItem == AccountItem.UnrealizedProfitLoss)" might be incorrect for what I am doing. How is it possible to force the e.AccountItem to equal AccountItem.RealizedProfitLoss?

    Thanks

    #2
    Hello EC_Chris,

    I have an example of a daily loss limit. I have re-tested this and I am finding this is still working as expected.

    Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader



    The link you have posted is for addons and not for strategies.. Are you creating an addon script?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X