Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

adjust earnings

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

    adjust earnings

    How can I adjust the stop loss when my strategy is earning a certain amount of dollars? For example I want to do trailing stopi when I earn $ 500

    #2
    Hello heguilar, thanks for your post.

    You can call SetStopLoss within OnBarUpdate to set your stop loss dynamically. When you get the signal that the strategy's unrealized PnL (using Position.GetUnrealizedProfitLoss) is over $500, call SetStopLoss again to change its position.

    Please let me know if you have any further questions.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Jeremytang, 07-14-2018, 06:45 PM
    21 responses
    439 views
    0 likes
    Last Post mav8rick  
    Started by LeonK, Yesterday, 09:26 PM
    1 response
    7 views
    0 likes
    Last Post bltdavid  
    Started by NicholasJoannette, Yesterday, 03:01 PM
    2 responses
    11 views
    0 likes
    Last Post NicholasJoannette  
    Started by rach1994, Yesterday, 12:20 PM
    1 response
    35 views
    0 likes
    Last Post bltdavid  
    Started by litamm89, Yesterday, 11:00 AM
    5 responses
    21 views
    1 like
    Last Post rafael_delima86  
    Working...
    X