Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wds33817 opened this issue Oct 25, 2023 · 1 comment
Open

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

wds33817 opened this issue Oct 25, 2023 · 1 comment

Comments

@wds33817
Copy link

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)

@traderpedroso
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants