TimelordUK / jspurefix

native typescript FIX engine
MIT License
58 stars 27 forks source link

Support for FIX 5.0 SP2? #73

Closed douglasmuraoka closed 9 months ago

douglasmuraoka commented 9 months ago

Quick question. Does this package support FIX 5.0 SP2? I took a look at the examples folder, and all of them are using FIX 4.4; also, I saw that the AsciiSessionMsgFactory is using type definitions from 4.4.

Thanks, and amazing job here!

TimelordUK commented 9 months ago

it is not yet pulled to master but if you look at branch

https://github.com/TimelordUK/jspf-md-demo/tree/fix52

I have added a v5 example

npm run md5-app

this is using the FIX50SP2.xml file

see output

2023-10-08T15:30:35.752Z [test_server:FixSession] info: [0] 8 (BeginString) = FIX.5.0SP2[FIX.5.0SP2], [1] 9 (BodyLength) = 0000145
[2] 35 (MsgType) = V[MarketDataRequest], [3] 49 (SenderCompID) = init-comp
[4] 56 (TargetCompID) = accept-comp, [5] 34 (MsgSeqNum) = 2
[6] 57 (TargetSubID) = fix, [7] 52 (SendingTime) = 20231008-15:30:35.751
[8] 262 (MDReqID) = #GBPUSD#0#, [9] 263 (SubscriptionRequestType) = 1[SnapshotAndUpdates]
[10] 264 (MarketDepth) = 0, [11] 267 (NoMDEntryTypes) = 3
[12] 269 (MDEntryType) = 0[Bid], [13] 269 (MDEntryType) = 1[Offer]
[14] 269 (MDEntryType) = H[MidPrice], [15] 146 (NoRelatedSym) = 1
[16] 55 (Symbol) = GBPUSD, [17] 947 (StrikeCurrency) = USD
[18] 10 (CheckSum) = 111
TimelordUK commented 9 months ago

now merged to master

douglasmuraoka commented 9 months ago

@TimelordUK I wasn't able to connect to a FIX 5.0 SP2 acceptor due to the lack of field 1137 (DefaultApplVerID). I investigated the code you pushed, and noticed that the typings generated in the jspf-md-demo are quite different from the ones from jspurefix. It seems the definition from jspurefix is correct, as DefaultApplVerID is a required field.

See here: jspurefix logon definition: https://github.com/TimelordUK/jspurefix/blob/master/src/types/FIX.5.0SP2/repo/logon.ts

jspf-md-demo logon definition: https://github.com/TimelordUK/jspf-md-demo/blob/master/src/types/FIX50SP2/logon.ts

TimelordUK commented 9 months ago

They are using different definitions the below is quick fix where I copied login from fix 4 logon hence problem

FIX50SP2.xml this

Should be easy to fix I’m not in from pc at moment. It’s easier adding tags and Messages using above format.

  1. find login message in above

  2. Also need to add tag see fields at End xml above

  3. Run npm generate5

  4. Check resulting type class to see if it’s added

  5. In factory where we send logon set this new property

  6. Add field value in the json defining connection

TimelordUK commented 9 months ago

I made above change on master

should be same priciple to add other missings fields

2023-10-09T18:51:28.630Z [test_client:FixSession] info: [0] 8 (BeginString) = FIX.5.0SP2[FIX.5.0SP2], [1] 9 (BodyLength) = 0000125 [2] 35 (MsgType) = A[Logon], [3] 49 (SenderCompID) = accept-comp [4] 56 (TargetCompID) = init-comp, [5] 34 (MsgSeqNum) = 1 [6] 57 (TargetSubID) = fix, [7] 52 (SendingTime) = 20231009-18:51:28.624 [8] 98 (EncryptMethod) = 0[None], [9] 108 (HeartBtInt) = 30 [10] 141 (ResetSeqNumFlag) = Y[Yes], [11] 1137 (DefaultApplVerID) = t2 [12] 553 (Username) = js-server, [13] 554 (Password) = pwd-server [14] 10 (CheckSum) = 215