Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Profit targets

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

    Multiple Profit targets

    I am supremely confused by the profit target setup. I have used ExitLongLimit/ExitShortLimit as in the picture below.

    Click image for larger version

Name:	image.png
Views:	175
Size:	123.0 KB
ID:	1318359

    Not only is it ignoring the profit target for half an hour plus, it dances over it and does nothing until it drops back under it... then goes back and figures out what it's supposed to do.
    The second problem here is that I only have 1 "ProfitTarget-S1" it's just processing multiple times and sure as heck is not wanted.

    I have used ​​"SetProfitTarget" Which is very crisp and very accurate, but does not allow me to set multiple exits.

    I have no idea what is going on.
    Attached Files

    #2
    Hello alphatango,

    Are you manually coding this or using the builder?

    Comment


      #3
      Sorry for the delay. Manually coding. This is a snippet. Again it makes no sense that it wouldn't calculate the ExitlongLimit and simply exit me out. IT has to dance over the profit target 2-3 times to finally process.

      Code:
      if (Logic)
                      {
                          EnterLong(3, "MTF-Long1");
                          ExitLongLimit(1, Position.AveragePrice + 20, "ProfitTarget-L1", "MTF-Long1");
                      }​

      Comment


        #4
        One thing to keep in mind is that your Exit Order cannot be submitted on the same exact same Bar Update as your Entry Order.

        What is happening right now from your screenshot -> CrossOver happens -> Submits Entry Order -> Strategy continues until a second Crossover -> Logic is true again -> Submits profit target -> Strategy continues until a 3rd cross over -> Submits second profit target -> Once you get another cross over, it will submit another profit target until you are Flat.

        =========

        Typically what you want to do is make sure you are using On Price Change or On Each Tick if your EXIT orders are submitted using OnBarUpdate(). Split up your Entry into however many Targets you want. (If you have 3 Profit Targets -> Submit 3 separate entries)

        For Example:

        private bool EntryBool = false;

        if (Logic && Position.MarketPosition == MarketPosition.Flat && EntryBool == false)
        {
        EnterLong(1, "MTF-Long1");
        EnterLong(1, "MTF-Long2");
        EnterLong(1, "MTF-Long3");

        EntryBool = true
        }

        if (Position.MarketPosition == MarketPosition.Long && EntryBool == true)
        {
        ExitLongLimit(1, Position.AveragePrice + 20, "ProfitTarget-L1", "MTF-Long1");
        ExitLongLimit(1, Position.AveragePrice + 40, "ProfitTarget-L2", "MTF-Long2");
        ExitLongLimit(1, Position.AveragePrice + 60, "ProfitTarget-L3", "MTF-Long3");

        EntryBool = false;
        }

        Hope that makes sense. I made a video that goes over how to do this on Strategy Builder with SetProfit() / SetStopLoss() and the later half uses custom Exit Order like the example above. I know you are custom coding but you can view the code and use as a similar guideline.



        Hope this helps, best of luck!
        TradeSaber Inc.NinjaTrader Ecosystem Vendor - TradeSaber Inc.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        25 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        121 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X