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:	660
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 NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            93 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            152 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            80 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            53 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            63 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X