title: Place multiple stop exit orders for single entry
body: <p>In a strategy on tradingview, I enter an entry and have a condition to place a trailing stop. At the same time I want a stop-loss order at a fixed price, but when I place two <code>strategy.exit()</code> commands, only one is actually used, because both are of type "stop". But it is possible to replace an exit order with another one by calling <code>strategy.exit()</code> and giving it the same id. So my idea is to replace one exit with another and back, when it suits me, such that only one exit order is active at the same time.</p>
  
  <p>Let's say I have a strategy with a condition to enter a position with a certain price, eg <code>conditionEnter</code> and <code>enterPrice</code>, at the time of entering I also know the stop-loss <code>stopLossPrice</code>, so I can set:</p>
  
  <pre><code>if conditionEnter
      strategy.entry(id="longEnter", long=true, qty=1, limit=enterPrice
  strategy.exit(id="longExit", from_entry="longEnter", qty_percent=100, stop=stopLossPrice)
  </code></pre>
  
  <p>Now, if <code>conditionTrailingStopLoss</code> is met, I replace it accordingly:</p>
  
  <pre><code>if conditionTrailingStopLoss
      strategy.exit(id="longExit", from_entry="longEnter", qty=strategy.position_size * 0.2, trail_price=priceToTriggerTrailingStopLoss, trail_offset=100)
  </code></pre>
  
  <p>where <code>priceToTriggerTrailingStopLoss</code> is equal or below the close price, so that the trailing stop is placed immediately and trails the price by 100 ticks. Notice, that even if it is executed, only a fifth of the current position is exited.</p>
  
  <p>As expected, the placement of the trailing stop loss exit order erases the original stop loss exit order - that is even true, when different ids are used. I would like to wait until the trailing stop loss has executed (is filled) and then place the stop loss exit order again. But how can I determine the time of execution?</p>
  
  <p>I tried something along</p>
  
  <pre><code>if strategy.position_size &lt; strategy.position_size[1]
      strategy.exit(id="longEnter", long=true, qty=1, limit=enterPrice
  strategy.exit(id="longExit", from_entry="longEnter", qty_percent=100, stop=stopLossPrice)
  </code></pre>
  
  <p>to see that some exit has been executed, but I never saw both orders executed. Changing the order of commands around does influence which one of the two is ignored though. If in above piece of code I change the <code>id</code> to something completely different, none of the three exit orders is ever executed!</p>
  
  <p>So can anyone help here? I mean wanting to have one fixed stop loss and one trailing stop loss is not very exotic to wish for, it has to work somehow, right?</p>
  
  <p><strong>Edit:</strong> If I scroll back in the chart, I actually do see sometimes one, sometimes the other exit order executed, but still never both for the same entry order.</p>