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

dollar profit target

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

    dollar profit target

    Hi,

    I am interested in using specific dollar targets for exiting trades. Is there a way to link the PnL with a exit strategy? For example, lets say I am short 5 ES and my PnL reaches $500.00. NT would then send a close position order. Is this possible?

    Thank you

    #2
    Yes this is possible, you would need to monitor Position.GetProfitLoss() and then send a market order to exit.
    RayNinjaTrader Customer Service

    Comment


      #3
      dollar profit target

      I would like to know how to do this too.
      Could code be shown please?

      Comment


        #4
        You could try something like:

        Code:
        if (Position.MarketPosition == MarketPosition.Long && Position.GetProfitLoss(Close[0], PerformanceUnit.Currency) > 500)
            ExitLong();
        RayNinjaTrader Customer Service

        Comment


          #5
          dollar profit target

          Thanks Ray,
          Looks good to me.
          Jim

          Comment


            #6
            dollar profit target

            Is there any way fpr this to be based on Realized P&L for a given time period, and not the Unrealized P&L?
            Thanks,
            Jim

            Comment


              #7
              Not currently. NT 6.5 will have some more features related to strategy performance.
              RayNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by patrickmlee007, Today, 09:33 AM
              2 responses
              15 views
              0 likes
              Last Post patrickmlee007  
              Started by magnatauren, 08-15-2020, 02:12 PM
              5 responses
              206 views
              0 likes
              Last Post RaddiFX
              by RaddiFX
               
              Started by rene69851, 05-02-2024, 03:25 PM
              1 response
              21 views
              0 likes
              Last Post rene69851  
              Started by ETFVoyageur, Yesterday, 07:05 PM
              5 responses
              45 views
              0 likes
              Last Post ETFVoyageur  
              Started by jpeep, 08-16-2020, 08:31 AM
              13 responses
              487 views
              0 likes
              Last Post notenufftime  
              Working...
              X