Skpd / ctrader-fix-api

17 stars 5 forks source link

Logging in: TargetSubID is assigned with the unexpected value 'QUOTE', expected 'TRADE' #5

Closed mateuszzebek closed 4 years ago

mateuszzebek commented 4 years ago

I am trying to run quote session from the script (I commented out the trade session):

python main.py -b fxpig -u 3002541 -p xxx -s h50.p.ctrader.com -v -t 1

The output is:

2020-03-21 17:27:37,845 MainThread fxpig.3002541 QUOTE INFO: Connecting
2020-03-21 17:27:37,909 MainThread fxpig.3002541 QUOTE INFO: Connected
2020-03-21 17:27:37,909 MainThread fxpig.3002541 QUOTE DEBUG: 8=FIX.4.49=11535=A34=149=fxpig.300254152=20200321-16:27:37.90956=cServer57=QUOTE553=3002541554=xxx98=0108=30141=Y10=159
2020-03-21 17:27:37,965 MainThread fxpig.3002541 QUOTE CRITICAL: Disconnected: TargetSubID is assigned with the unexpected value 'QUOTE', expected 'TRADE'

I tried typing different ports, I tried to add sender_sub when initializing client:

    quote_session = Session(
        sender_id=args.broker + '.' + args.username,
        target_id='cServer', target_sub='QUOTE', sender_sub='QUOTE',
        username=args.username, password=args.password)
    quote_session = Session(
        sender_id=args.broker + '.' + args.username,
        target_id='cServer', target_sub='QUOTE', sender_sub=args.username,
        username=args.username, password=args.password)

But without effect.

Is the order of tags wrong? As far as I understand from this: https://forum.fixtrading.org/t/does-ordering-of-tags-matter/13998/2 The order seems to be correct.

The solution to the related issue found in the internet: https://ctrader.com/forum/fix-api/13330 Has a very similar message though with a bit different tags' order and in my message there is an extra tag: 141 (reset sequence) Which shouldn't affect the message.

Any idea how to fix this?