Skip to content

Parameter "SenderSubID" missing during login #69

Description

@dawadam

I am trying to login to cTrader broker and "SenderSubID" parametter is needed.
I'm using a ctrader custom dictionary and adding this parameter on the json file, but it's not being sent.
And no response from the server.

json file :

{
  "application": {
    "reconnectSeconds": 10,
    "type": "initiator",
    "name": "test_ctrader",
    "tcp": {
      "host": "h51.p.ctrader.com",
      "port": 5201
    },
    "protocol": "ascii",
    "dictionary": "../../resources/FIX44-CSERVER.xml"
  },
  "BeginString": "FIX4.4",
  "Username": "123456",
  "Password": "azerty",
  "EncryptMethod": 0,
  "ResetSeqNumFlag": true,
  "HeartBtInt": 30,
  "SenderCompId": "demo.aaa.123456",
  "TargetCompID": "cServer",
  "SenderSubID": "QUOTE"
}

Application code :

import "reflect-metadata"

import {
    EngineFactory,
    SessionLauncher,
    AsciiSession,
    MsgView,
    IJsFixLogger,
    IJsFixConfig
} from 'jspurefix'

/**
 * 
 */
class FixTest extends AsciiSession {

    private readonly logger: IJsFixLogger
    private readonly fixLog: IJsFixLogger

    constructor(public readonly config: IJsFixConfig) {
        super(config)
        this.logReceivedMsgs = true

        this.fixLog = config.logFactory.plain(`jsfix.${config.description.application.name}.txt`)
        this.logger = config.logFactory.logger(`${this.me}:TradeCaptureClient`)
    }

    /**
     * 
     * @param msgType 
     * @param txt 
     */

    protected onDecoded(msgType: string, txt: string): void {
        console.log('onDecoded', msgType, txt)
        this.fixLog.info(txt)
    }

    /**
     * 
     */
    protected onEncoded(msgType: string, txt: string): void {
        console.log('onEncoded', msgType, txt)
        this.logger.info('test')
        this.fixLog.info(txt)
    }

    /**
     * 
     * @param msgType 
     * @param view 
     */
    protected onApplicationMsg(msgType: string, view: MsgView): void {
        console.log('onApplicationMsg', msgType)
        switch (msgType) {

        }
    }

    /**
     * 
     * @param view 
     */
    protected onReady(view: MsgView): void {
        console.log('READY')
    }

    /**
     * 
     * @param error 
     */
    protected onStopped(error?: Error): void {
        console.log('STOPPPED')
    }

    /**
     * 
     */
    protected onLogon(view: MsgView, user: string, password: string): boolean {
        console.log('LOGON')

        return true
    }

}


/**
 * 
 */
class AppLauncher extends SessionLauncher {
    public constructor(client: string = '../../jspurefix-test-initiator.json') {
        super(client)
        this.root = __dirname
    }

    protected override makeFactory(config: IJsFixConfig): EngineFactory {
        return {
            makeSession: () => new FixTest(config)
        } as EngineFactory
    }
}

const l = new AppLauncher()
l.exec()

Logon fix message :

8=FIX4.4|9=0000105|35=A|49=demo.aaa.123456|56=cServer|34=1|52=20230827-16:38:22.081|98=0|108=30|141=Y|553=123456|554=azerty|10=176|

No SenderSubID parameter, identifier is 50

How add it in login message ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions