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

Multiple MDEntryType #20

Open
ganymedenet opened this issue Jul 13, 2024 · 1 comment
Open

Multiple MDEntryType #20

ganymedenet opened this issue Jul 13, 2024 · 1 comment

Comments

@ganymedenet
Copy link

Good day,

How can I set multiple MDEntryType (269=) for MarketDataRequest?
I need to subscribe for Bid and Ask order updates.

Regards,

@Simongolovinskiy
Copy link

Simongolovinskiy commented Jul 21, 2024

Hello!
Actually, you don't need to set multiple MDEntryType. If you check documentation (https://help.ctrader.com/fix/specification/?h=269#market-data-request-msgtype35v), you have such a param as NoMDEntryTypes - Always set to 2 (both bid and ask will be sent). I don't remember why, but i have NoMDEntryTypes = 1. Try both - values 1 or 2. So your code will be looking like that:

from ctrader_fix.messages import MarketDataRequest
def create_request(symbol) -> None:
        quote_conf = handler.quote.config
        req = MarketDataRequest(quote_conf)
        req.MDReqID = time.time()
        req.SubscriptionRequestType = 1
        req.MDUpdateType = 1
        req.MarketDepth = 1
        req.NoMDEntryTypes = 1
        req.MDEntryType = 0
        req.NoRelatedSym = 1
        req.Symbol = symbol
        handler.quote.fix_client.send(req)

Hope it will solve your problem, since i haven't answered on your question. But in my code i have both of market data - bid and ask.

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