Even if I use api.sell(), it still place a buy order.
symbol = "EURUSD" volume = 1 # position size: stoploss = round(price - 0.00010, 6) takeprofit = round(price + 0.00020, 6)
id = api.sell(symbol, volume, stoploss, takeprofit)
symbol = "EURUSD" volume = 1 # position size: stoploss = round(price - 0.00010, 6) takeprofit = round(price + 0.00020, 6)
id = api.sell(symbol, volume, stoploss, takeprofit)
Disclosure Due to certain limitations of the FIX API, there's a specific issue that arises when both the Stop Loss (SL) and Take Profit (TP) features are used concurrently. This issue occurs when one of them is triggered, the other remains open and will execute when the price reaches the specified level again, causing it to open another order. This issue needs to be addressed either within the ejtraderCT library or the application itself.
However, you can avoid this problem by using either the SL or TP, but not both simultaneously.