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

How to combine Exit orders with TakeTrofit

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

    How to combine Exit orders with TakeTrofit

    Hello, I have an idea to exit position with ExitStopLimit, for example

    Code:
    EnterLong("Basic Entry");
    ExitLongStopLimit(stopPrice - (1 * TickSize), stopPrice, "Exit Stop Limit", "Basic Entry");
    It works ok, but now I'm trying to set take profit exit.
    I tried standard approach with TakeProft, like this

    Code:
    SetProfitTarget("Basic Entry",CalculationMode.Ticks,takeProftLevel);
    but it says it is impossible (see internal order handling rules). Is there any possible way to set take profit order?

    #2
    Hello rfsettling,

    If you would like to set both a profit target and stop loss you should use, SetProfitTarget and SetStopLoss methods together, which would be tied together with an OCO.

    See SetStopLoss section of our helpguide,

    You cannot use SetProfitTarget and ExitLongStopLimit, and the reason why is explained at the following link under, Internal Order Handling Rules that Reduce Unwanted Positions,

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      I understand that I cannot use standard SetProfitTarget, it was clear from the very start. My question is not about SetProfitTarget, but about any other way to reach the same result

      Comment


        #4
        Hello rfsettling,

        Once the buy entry is filled, in OnExecution place an ExitLongLimit() order above the bid price for the profit target and ExitLongStopLimit() (or ExitLongStopMarket) order below the bid price for the stop loss. For both, use the fromEntrySignal of the entry order.

        ExitLongLimit - http://ninjatrader.com/support/helpG...tlonglimit.htm
        ExitLongStopLimit - http://ninjatrader.com/support/helpG...gstoplimit.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks a lot. It works

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by trilliantrader, Yesterday, 03:01 PM
          3 responses
          29 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          4 responses
          25 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Brevo, Today, 01:45 AM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by rjbtrade1, 11-30-2023, 04:38 PM
          2 responses
          74 views
          0 likes
          Last Post DavidHP
          by DavidHP
           
          Started by suroot, 04-10-2017, 02:18 AM
          5 responses
          3,022 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X