Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss problem activating strategy immediately submits stoploss and ProfitTarget

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

    SetStopLoss problem activating strategy immediately submits stoploss and ProfitTarget

    In my strategy I enter multiple entries with separate Profit targets.
    But I want to protect profit if the trade starts failing.
    So the strategy enters one trade with PT with qty 4 , a low target.
    It also enters one trade for qty 2 next target
    An lastly enters 1 trade with qty 1 which would be the runner. highest target
    So in my condition if position is less than 2 (in other words the first two trades gave filled) then set stoploss to the postion.average + the first profit target, that way if the trade goes south it stops out.
    When I add the first condition it creates a stop and profit target as soon as strategy is enabled.
    Without it there are many $0.00 stop loss trades.
    What am I missing here to accomplish my desired outcome?

    /// Condition to set and reset the stoploss to the original stop
    if (Position.MarketPosition == MarketPosition.Flat)
    {
    SetStopLoss("",CalculationMode.Ticks, Stop,false);
    previousPrice = 0;
    }
    /// Condition to move the stop for the last trade to a new stop
    if (Position.Quantity < 2 && Position.MarketPosition == MarketPosition.Long && BarsSinceEntryExecution() > 3 && previousPrice == 0)
    {
    newStopLossTicks = Position.AveragePrice + L_Profit;
    SetStopLoss(CalculationMode.Price, newStopLossTicks);
    previousPrice = Position.AveragePrice;

    }

    #2
    I think it is resolved, what I was seeing was historical fills with stop and profit orders remaining from those fills. I have since added not to consider historical and it seems to work, testing today.

    Comment


      #3
      Hello set2win,

      Thanks for following up.

      If you are still having difficulty please reply back with any other details you have from your testing and we can review that further.

      I look forward to being of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      62 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X