Johnathan David
Johnathan David

Reputation: 80

Incorrect BeginString (FIX.4.4) in c# (Quickfixn)

I'm trying to get the MarketData from fix, but I'm seemingly answering the "Incorrect BeginString (FIX.4.4)". The "Logon" returns OK. but when I call MarketDataRequest it doesn't work. I checked my XML dictionary and it's set to FIX.4.4.

quickfix C+ Incorrect BeginString with FIXT.1.1 and FIX.5.0 - FIX.5.0SP2

I saw a post like mine but my dictionary xml is declared as FIX.4.4 and also "LOGON" is working. so, I think a different case from the link above.

here is the log.

2020-11-10 17:27:44,148 [1] INFO  QuickFixDemo.Program OnCreate FIX.4.4:xxxxxxxxxxxxxxxx->XXXXXX
2020-11-10 17:27:46,321 [8] INFO  QuickFixDemo.Program ToAdmin 8=FIX.4.4|9=83|35=A|34=1|49=xxxxxxxxxxxxxxxx|52=20201110-08:27:46.309|56=XXXXXX|98=0|108=20|141=Y|10=112|
2020-11-10 17:27:46,666 [8] INFO  QuickFixDemo.Program FromAdmin 8=FIX.4.4|9=83|35=A|34=1|49=XXXXXX|52=20201110-08:27:46.437|56=xxxxxxxxxxxxxxxx|98=0|108=20|141=Y|10=114|
2020-11-10 17:27:46,681 [8] INFO  QuickFixDemo.Program OnLogon
2020-11-10 17:27:46,686 [8] INFO  QuickFixDemo.Program ToApp 8=FIX.4.4|9=126|35=V|34=2|49=xxxxxxxxxxxxxxxx|52=20201110-08:27:46.685|56=XXXXXX|262=0|263=1|264=0|265=0|146=1|48=4004|22=8|267=2|269=1|269=0|10=033|
2020-11-10 17:27:47,093 [8] INFO  QuickFixDemo.Program ToAdmin 8=FIX.4.4|9=100|35=5|34=3|49=xxxxxxxxxxxxxxxx|52=20201110-08:27:47.093|56=XXXXXX|58=Incorrect BeginString (FIX.4.4)|10=052|
2020-11-10 17:27:47,405 [8] INFO  QuickFixDemo.Program FromAdmin 8=FIX.4.4|9=65|35=5|34=3|49=XXXXXX|52=20201110-08:27:47.187|56=xxxxxxxxxxxxxxxx|10=038|
2020-11-10 17:27:47,426 [8] INFO  QuickFixDemo.Program OnLogout

my header of dictionary looks like this

<?xml version="1.0" encoding="UTF-8"?>

<fix major="4" minor="4" servicepack="0" type="FIX">
  <header>
    <field name="BeginString" required="Y"/>
    <field name="BodyLength" required="Y"/>
    <field name="MsgType" required="Y"/>
    <field name="SenderCompID" required="Y"/>
    <field name="TargetCompID" required="Y"/>
    <field name="MsgSeqNum" required="Y"/>
    <field name="PossDupFlag" required="N"/>
    <field name="PossResend" required="N"/>
    <field name="SendingTime" required="Y"/>
    <field name="OrigSendingTime" required="N"/>
  </header>

and my MarketDataRequest is like this:

<message name="MarketDataRequest" msgcat="app" msgtype="V">
  <field name="MDReqID" required="Y"/>
  <field name="SubscriptionRequestType" required="Y"/>
  <field name="MarketDepth" required="Y"/>
  <field name="MDUpdateType" required="N"/>
  <field name="AggregatedBook" required="N"/>
  <component name="MDReqGrp" required="Y"/>
  <component name="InstrmtMDReqGrp" required="Y"/>
</message>

my config

[DEFAULT]
BeginString=FIX.4.4
ConnectionType=initiator
ReconnectInterval=10
FileStorePath=store
FileLogPath=log
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=Y
DataDictionary=./Fix/LMAX.xml
SocketConnectHost=fix-marketdata.london-demo.lmax.com
SocketConnectPort=443
SSLEnable=Y
SSLValidateCertificates=N
HeartBtInt=20

[SESSION]
# inherit ConnectionType, ReconnectInterval and SenderCompID from default
SenderCompID=XXXXXXXXXXX
TargetCompID=LMXBDM
Username=XXXXXXXXXXXXXXXXXXXXX
Password=XXXXXXXXXXXXXXXX
ResetOnLogon=Y

---------------- aditional information 2020/11/11

I debugged the quickfix and found the place where it is returning me "UnsupportedVersion exception". follow the image of my debugger.

DefaultMessageFactory's "this._factories" is empty. then this class returns to me the UnsupportedVersion... I'm researching the reason for this. Would you have any tips?

DefaultMessageFactory.cs:Create1

DefaultMessageFactory.cs:Create2

Upvotes: 2

Views: 1292

Answers (1)

Johnathan David
Johnathan David

Reputation: 80

the problem was that in linux Directory.GetFiles is Case Sensitive, so DefaultMessageFactory:LoadLocalDlls() wasn't able to find the local dlls in Linux. I created the pull request in github https://github.com/connamara/quickfixn/pull/663 and with this change it worked perfectly in Linux.

Upvotes: 2

Related Questions