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

orders are messed up #33

Open
vism211 opened this issue Mar 5, 2024 · 2 comments
Open

orders are messed up #33

vism211 opened this issue Mar 5, 2024 · 2 comments

Comments

@vism211
Copy link

vism211 commented Mar 5, 2024

hi, could you please explain why the following code is resulting in the 3 orders/positions you can see in the images below?

api = Ctrader(server,account,password)
api.subscribe("EURUSD")
print(api.quote())
print(api.buy(symbol="EURUSD", volume=0.01, stoploss=1, takeprofit=1.5, price=1.08))
api.logout()

ord
pos

moreover, the quote() method is returning {}

@vism211 vism211 changed the title messing uop orders are messed up Mar 5, 2024
Copy link

github-actions bot commented Mar 5, 2024

We're glad you've opened your first issue. Please provide all the necessary details and any relevant code or screenshots to help us understand the problem better. Our team will review your issue and provide assistance as soon as possible. Thank you for contributing!

@traderpedroso
Copy link
Member

hi, could you please explain why the following code is resulting in the 3 orders/positions you can see in the images below?

api = Ctrader(server,account,password)
api.subscribe("EURUSD")
print(api.quote())
print(api.buy(symbol="EURUSD", volume=0.01, stoploss=1, takeprofit=1.5, price=1.08))
api.logout()

ord pos

moreover, the quote() method is returning {}

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