• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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
    -EC_Chris-
    NinjaTrader Ecosystem Vendor - Emergent Cybernetics

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

    http://ninjatrader.com/support/forum...325#post490325


    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 maggie3, Today, 02:05 AM
    0 responses
    3 views
    0 likes
    Last Post maggie3
    by maggie3
     
    Started by qewcool, Today, 01:14 AM
    0 responses
    3 views
    0 likes
    Last Post qewcool
    by qewcool
     
    Started by fredrikn, 05-08-2019, 04:01 AM
    17 responses
    669 views
    1 like
    Last Post emtrader  
    Started by zacharydw00, Yesterday, 10:19 PM
    0 responses
    3 views
    0 likes
    Last Post zacharydw00  
    Started by chafan11, Yesterday, 09:28 PM
    0 responses
    7 views
    0 likes
    Last Post chafan11  
    Working...
    X