I'm developing a strategy that increases the number of contracts as the price moves in our favor (for instance, if we enter Long and the price rises, it adds positions).
- The distance at which these orders are placed is configurable.
- Targets and Stop Loss are also set for each executed entry, and they are configurable as well.
- Additionally, I have a condition that if the position is set to Flat, all subsequent additional orders placed to enter the market are canceled. So that when it reaches a specific target and is set to flat, it does not make any more entries.
The question is:
- Given that the next entry is configurable and the Take Profit is configurable, there is a possibility that they are placed at the same price (assuming this is valid for now).
- If there are 5 additional entries, and the first additional entry has the same price as the first original Take Profit, when it reaches the configured price, which order is executed first? Is it the Take Profit or the Additional Entry?
In this scenario, I don't want the positions to be closed because I want the additional entry to be executed first, so it doesn't go flat, then open the new position, and finally, the Take Profit is executed. All this when it reaches the same price. Is it possible to do this? How?
I conducted tests, and on one PC, it does one option, and on another PC, it does the other option. Hence the question.
Since we are in LONG, the Take Profit order is a Limit, and the additional order is a Stop.
I'll show the case in the attached image.

Comment