ejtraderCT icon indicating copy to clipboard operation
ejtraderCT copied to clipboard

Even if I use api.sell(), it still place a buy order.

Open wds33817 opened this issue 2 years ago • 1 comments

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)

wds33817 avatar Oct 25 '23 12:10 wds33817

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.

traderpedroso avatar Mar 30 '24 15:03 traderpedroso