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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      93 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      138 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      123 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      73 views
      0 likes
      Last Post PaulMohn  
      Working...
      X