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 alifarahani, Today, 09:40 AM
          6 responses
          38 views
          0 likes
          Last Post alifarahani  
          Started by Waxavi, Today, 02:10 AM
          1 response
          18 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by Kaledus, Today, 01:29 PM
          5 responses
          15 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Waxavi, Today, 02:00 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by gentlebenthebear, Today, 01:30 AM
          3 responses
          17 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X