I created a Grid strategy that opens several limit orders.
When the trade is opened, it sets a target and stop loss and keeps the other limit orders pending on the screen, which can be filled if the price reaches them.
The idea is that if the price moves against it, it increases the position, averaging down better.
Everything is working.
If there is no open position, the grid orders are repositioned with each bar on the chart.
Problem: I want that when the target is triggered, in addition to closing the trade, the strategy cancels the pending orders, clearing the grid (as if the close button were pressed in ChartTrader), and restarts everything on the next bar refresh.
But I can’t get the pending orders to be canceled when the target is reached.