{"id":23140838,"url":"https://github.com/f0cii/goalgo","last_synced_at":"2025-08-17T13:31:31.399Z","repository":{"id":40048527,"uuid":"150124605","full_name":"f0cii/goalgo","owner":"f0cii","description":"A real-time quantitative trading platform in Golang.","archived":false,"fork":false,"pushed_at":"2022-01-27T03:27:13.000Z","size":474,"stargazers_count":119,"open_issues_count":0,"forks_count":41,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-08-14T22:35:00.493Z","etag":null,"topics":["golang","quant","robot","trading-platform"],"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/f0cii.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}},"created_at":"2018-09-24T15:26:04.000Z","updated_at":"2025-08-05T15:30:42.000Z","dependencies_parsed_at":"2022-06-26T10:06:08.392Z","dependency_job_id":null,"html_url":"https://github.com/f0cii/goalgo","commit_stats":null,"previous_names":["sumorf/goalgo","f0cii/goalgo","frankrap/goalgo"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/f0cii/goalgo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fgoalgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fgoalgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fgoalgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fgoalgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f0cii","download_url":"https://codeload.github.com/f0cii/goalgo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fgoalgo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270856550,"owners_count":24657688,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["golang","quant","robot","trading-platform"],"created_at":"2024-12-17T14:11:47.796Z","updated_at":"2025-08-17T13:31:31.082Z","avatar_url":"https://github.com/f0cii.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goalgo\n\nA real-time quantitative trading platform in Golang.\n\n这是一个基于 Go 的量化系统，此项目不支持回测，新项目请移步: \n[crex] https://github.com/coinrust/crex （同时支持BitMEX, Deribit, ByBit...）\n\n目前支持基于以下两个库编写策略\n\nGoEx https://github.com/nntaoli-project/GoEx\n\nbitmex-api https://github.com/frankrap/bitmex-api\n\n其中 bitmexwrap 提供了对 BitMEX 交易所的支持，内部集成了 Rest 和 WebSocket 接口\n\n欢迎交流，欲使用此系统，请自行登录以下官网注册账号:\n\nhttps://www.coinrust.com\n\n如有问题，请联系加QQ群: 932289088\n\n1.简单的基于 GoEx 策略脚本:\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\n\t\"github.com/nntaoli-project/GoEx\"\n\t\"github.com/frankrap/goalgo\"\n\t\"github.com/frankrap/goalgo/algo\"\n\t\"github.com/frankrap/goalgo/log\"\n)\n\n// SimpleGoExStrategy 简单的GoEx策略\ntype SimpleGoExStrategy struct {\n\talgo.GoExStrategy\n}\n\n// Init 策略初始化方法，必须实现\nfunc (s *SimpleGoExStrategy) Init() error {\n\tlog.Info(\"Init\")\n\treturn nil\n}\n\n// Run 策略主逻辑，必须实现\nfunc (s *SimpleGoExStrategy) Run() error {\n\tlog.Info(\"Run\")\n\tfor s.IsRunning() {\n\t\ttime.Sleep(5 * time.Second)\n\t\t// 获取交易所 Ticker 数据\n\t\tticker, err := s.Exchange.GetTicker(goex.BTC_USDT)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"%v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tlog.Infof(\"Ticker %#v\", ticker)\n\t}\n\treturn nil\n}\n\nfunc main() {\n\ts := \u0026SimpleGoExStrategy{}\n\tgoalgo.Serve(s)\n}\n```\n\n2.简单的基于 bitmexwrap(BitMEX 期货市场)策略脚本:\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\n\t\"github.com/frankrap/goalgo\"\n\t\"github.com/frankrap/goalgo/algo\"\n\t\"github.com/frankrap/goalgo/log\"\n)\n\n// BitMEXDemoStrategy 示例策略(BitMEX)\ntype BitMEXDemoStrategy struct {\n\talgo.BitMEXStrategy\n}\n\n// Init 策略初始化方法，必须实现\nfunc (s *BitMEXDemoStrategy) Init() error {\n\tlog.Info(\"Init\")\n\tbalance, err := s.Exchange.Balance()\n\tif err != nil {\n\t\tlog.Errorf(\"Balance error: %v\", err)\n\t\treturn err\n\t}\n\tlog.Infof(\"balance: %v\", balance)\n\n\treturn nil\n}\n\n// Run 策略主逻辑，必须实现\nfunc (s *BitMEXDemoStrategy) Run() error {\n\tlog.Info(\"Run\")\n\tfor s.IsRunning() {\n\t\ttime.Sleep(3 * time.Second)\n\t\tticker, err := s.Exchange.Ticker()\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"%v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tlog.Infof(\"ticker: %v\", ticker)\n\t}\n\treturn nil\n}\n\nfunc main() {\n\ts := \u0026BitMEXDemoStrategy{}\n\tgoalgo.Serve(s)\n}\n```\n\n### Thanks\n\u003e This project uses the following external projects or products\n1. [RabbitMQ] https://www.rabbitmq.com/\n2. [PostgreSQL] https://www.postgresql.org/\n3. [ClickHouse] https://clickhouse.yandex/\n4. [Docker] https://www.docker.com/\n5. [GoEx] https://github.com/nntaoli-project/GoEx\n6. [coinex] https://github.com/SuperGod/coinex\n7. [porthos-go] https://github.com/porthos-rpc/porthos-go\n8. [go-plugin] https://github.com/hashicorp/go-plugin\n9. [gin] https://github.com/gin-gonic/gin\n10. [vuejs] https://vuejs.org/\n11. ...\n\n### 捐赠\n\n\u003e BTC:17XauetDWtwAZKHRyEw3DpYcRqzhKZzPHq\n\n\u003e ETH:0x5e065711852fda9b75c4e490b1e35eea89b9aaa5\n\n\u003e XRP:rshdB4kyxXkuPCtCgZw8DrcuSo7jEWfqck\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0cii%2Fgoalgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff0cii%2Fgoalgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0cii%2Fgoalgo/lists"}