{"id":25063755,"url":"https://github.com/chenjunpc2008/go-fix","last_synced_at":"2025-06-13T16:09:17.638Z","repository":{"id":198869545,"uuid":"701673535","full_name":"chenjunpc2008/go-fix","owner":"chenjunpc2008","description":"The Financial Information Exchange (FIX) Protocol  Engine","archived":false,"fork":false,"pushed_at":"2023-10-08T07:56:03.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T12:27:49.227Z","etag":null,"topics":["finance","financial-information-exchange","fintech","fixprotocol","go","golang","messaging-library","protocol","quickfix","stock-market","stocks","trading","trading-systems"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenjunpc2008.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-07T08:24:52.000Z","updated_at":"2023-10-08T01:16:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"def1d703-c810-4b77-b4d2-6e73a2b3e696","html_url":"https://github.com/chenjunpc2008/go-fix","commit_stats":null,"previous_names":["chenjunpc2008/go-fix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chenjunpc2008/go-fix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunpc2008%2Fgo-fix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunpc2008%2Fgo-fix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunpc2008%2Fgo-fix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunpc2008%2Fgo-fix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenjunpc2008","download_url":"https://codeload.github.com/chenjunpc2008/go-fix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjunpc2008%2Fgo-fix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259677363,"owners_count":22894678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["finance","financial-information-exchange","fintech","fixprotocol","go","golang","messaging-library","protocol","quickfix","stock-market","stocks","trading","trading-systems"],"created_at":"2025-02-06T18:45:25.406Z","updated_at":"2025-06-13T16:09:17.586Z","avatar_url":"https://github.com/chenjunpc2008.png","language":"Go","readme":"# go-fix\nThe Financial Information Exchange (FIX) Protocol Engine\n\n\n## fixacceptor\nGo FIX server\n\n## fixinitiator\nGo FIX client\n\n# Usage\n\n## fixacceptor\n---\nfor example: ```example/demoServer```\n\n1. Create a struct for server event call back, and put your own message process in the callback functions.\n    ```go\n    type myApp struct {\n    }\n\n    var _ fixacceptor.ApplicationIF = (*myApp)(nil)\n\n    func (a *myApp) OnError(msg string, err error) {\n        fmt.Printf(msg, err)\n    }\n\n    func (a *myApp) OnErrorStr(msg string) {\n        fmt.Printf(msg)\n    }\n\n    func (app *myApp) OnEvent(msg string) {\n        fmt.Println(msg)\n    }\n\n    func (app *myApp) FromAdmin(fixMsg *quickfix.Message) {\n        fmt.Println(\"FromAdmin:\", fixMsg)\n    }\n\n    func (app *myApp) FromApp(fixMsg *quickfix.Message) {\n        fmt.Println(\"FromApp:\", fixMsg)\n    }\n\n    func (app *myApp) OnSendedData(fixMsg *quickfix.Message) {\n        fmt.Println(\"OnSent:\", fixMsg)\n    }\n\n    func (app *myApp) OnDisconnected(serverIP string, serverPort uint16) {\n        fmt.Printf(\"OnDisconnected:%s:%d/n\", serverIP, serverPort)\n    }\n    ```\n2. Use the server and go\n    ```go\n    var setting = fixacceptor.DefaultConfig()\n    setting.Port = 5001\n    setting.SenderCompID = \"NASDAQ\"\n    setting.FixDataDictPath = \"./spec/FIX42.xml\"\n\n    app := new(myApp)\n\n    acceptor := fixacceptor.NewAcceptor(setting, app)\n\n    acceptor.Start()\n    ```\n\n\n## fixinitiator\n---\nfor example: ```example/fixTradeClient```\n\n1. Create a struct for server event call back, and put your own message process in the callback functions.\n    ```go\n    type tradeCliApp struct {\n    }\n\n    var _ fixinitiator.ApplicationIF = (*tradeCliApp)(nil)\n\n    func (app *tradeCliApp) OnConnected(serverIP string, serverPort uint16) {\n\n    }\n\n    func (app *tradeCliApp) OnError(msg string, err error) {\n        fmt.Println(msg, err)\n    }\n\n    func (app *tradeCliApp) OnErrorStr(msg string) {\n        fmt.Println(msg)\n    }\n\n    func (app *tradeCliApp) OnEvent(msg string) {\n        fmt.Println(msg)\n    }\n\n    func (app *tradeCliApp) OnAdminMsg(fixmsg *quickfix.Message) {\n        fmt.Println(fixmsg)\n    }\n\n    func (app *tradeCliApp) OnAppMsg(fixmsg *quickfix.Message) {\n        atomic.AddInt64(\u0026GRspRcvNum, 1)\n        fmt.Println(fixmsg)\n    }\n\n    func (app *tradeCliApp) OnDisconnected(serverIP string, serverPort uint16) {\n\n    }\n    func (app *tradeCliApp) OnSendedData(msg *fixinitiator.MsgPkg) {\n\n    }\n    ```\n2. Use the client and go\n    ```go\n    var setting = fixinitiator.DefaultConfig()\n    setting.FixDataDictPath = \"./spec/FIX42.xml\"\n    setting.RemoteIP = \"127.0.0.1\"\n    setting.RemotePort = 5001\n\n    setting.BeginString = \"FIX.4.2\"\n    setting.SenderCompID = \"qaib84\"\n    setting.TargetCompID = \"IB\"\n\n    app := new(tradeCliApp)\n\n    gFixCli = fixinitiator.NewInitiator(setting, app)\n\n    var (\n        senderStartSeqNum uint64 = 1\n        targetStartSeqNum uint64 = 1\n    )\n    gFixCli.Start(senderStartSeqNum, targetStartSeqNum)\n    ```\n3. Send a new trade order\n   ```go\n    fixOrder = buildIBNewOrderSingle()\n    mpkg.Fixmsg = fixOrder\n    gFixCli.SendMsgToSvr(mpkg)\n   ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenjunpc2008%2Fgo-fix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenjunpc2008%2Fgo-fix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenjunpc2008%2Fgo-fix/lists"}