Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple profit target levels

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

    Multiple profit target levels

    Hi,
    I am trying to enter short position with 3 contract (Stop Limit) with 3 profit target levels, each one of them buy 1 contract,
    When running the strategy, the first target works OK but the 2 other and also the stop loss dont work any more.
    What is the problem ?

    This is the entry command:
    EnterShortStopLimit(3, (Low[0] - TickSize), Low[0], "Short");

    and these are the profit targets and stop loss command:

    ExitShortLimit(0, true, 1, _profitPrice1, "ProfitShort", "Short");
    ExitShortLimit(0, true, 1, _profitPrice2, "ProfitShort", "Short");
    ExitShortLimit(0, true, 1, _profitPrice3, "ProfitShort", "Short");
    ExitShortStopMarket(0, true, 3, _stopPrice, "StopShort", "Short");

    Thanks

    #2
    Hello yaniv,

    Thanks for your post.

    Each of the ExitShortLimit orders will need a unique name. You are using "ProfitShort" on all three so the system would assume you are placing one order and then changing price 2 times.

    Make each exit a unique exit name.

    If your stop order is not working then check your "log" tab of the NinjaTrader control center for any related error messages. You may need to verify that the variable "_stopPrice" is the correct value for the order.

    Comment


      #3
      Hi,
      Thanks
      I did it and still the same,
      When I had only one take profit level and one stop loss, when one of them achieved, the other have canceled (like OCO), and that is what happening also now,
      The first profit target level achieved and the other profit target levels and the stop loss have cancelled.
      How can I change this behavior ?

      Click image for larger version

Name:	Capture.JPG
Views:	672
Size:	76.4 KB
ID:	1166716
      Thanks

      Comment


        #4
        Hello yaniv,

        Thanks for your reply.

        To accomplish your goal you will need to create 3 entry orders of 1 contract each and each with a unique entry name.

        For each entry, you need to also create a separate profit and stop order tied to the entry by its signal name.

        To illustrate, entry:

        EnterShortStopLimit(1, (Low[0]-TickSize), Low[0], "Shorta");
        EnterShortStopLimit(1, (Low[0]-TickSize), Low[0], "Shortb");
        EnterShortStopLimit(1, (Low[0]-TickSize), Low[0], "Shortc");

        To illustrate, exits:

        ExitShortLimit(0, true, 1, Position.AveragePrice - 15 * TickSize, "ProfitShorta", "Shorta");
        ExitShortLimit(0, true, 1, Position.AveragePrice - 20 * TickSize, "ProfitShortb", "Shortb");
        ExitShortLimit(0, true, 1, Position.AveragePrice - 30 * TickSize, "ProfitShortc", "Shortc");
        ExitShortStopMarket(0, true, 1, Position.AveragePrice + 30 * TickSize, "StopShorta", "Shorta");
        ExitShortStopMarket(0, true, 1, Position.AveragePrice + 30 * TickSize, "StopShortb", "Shortb");
        ExitShortStopMarket(0, true, 1, Position.AveragePrice + 30 * TickSize, "StopShortc", "Shortc");

        Comment


          #5
          Hi,
          Thanks
          So, if I want to buy 100 contracts, I need to send 100 separate commands ???
          I can not send one command for entry and exit in two or more different prices from the same entry ?

          Thanks

          Comment


            #6
            Hello yaniv,

            Thanks for your reply.

            The bottom line is that separate entries would be needed for separate stops/targets.

            If you had 100 different targets and or stops then yes you would need 100 different entries.

            if you only have 3 targets then just 3 orders of 33, 33, and 34 would be needed.



            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            80 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            40 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            64 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            64 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            54 views
            0 likes
            Last Post CarlTrading  
            Working...
            X