{"id":24881063,"url":"https://github.com/dboyara/quikgo","last_synced_at":"2025-09-07T03:38:07.440Z","repository":{"id":274166610,"uuid":"921058651","full_name":"DBoyara/QuikGo","owner":"DBoyara","description":"Доступ к функционалу Quik из связки Lua\u0026Golang","archived":false,"fork":false,"pushed_at":"2025-06-20T05:24:23.000Z","size":75,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-11T18:46:19.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DBoyara.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-23T09:03:17.000Z","updated_at":"2025-06-20T05:24:26.000Z","dependencies_parsed_at":"2025-02-28T06:46:05.879Z","dependency_job_id":"6a4d4b62-21ed-41c2-a80d-82ba6f504a2f","html_url":"https://github.com/DBoyara/QuikGo","commit_stats":null,"previous_names":["dboyara/quikgo"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/DBoyara/QuikGo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DBoyara%2FQuikGo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DBoyara%2FQuikGo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DBoyara%2FQuikGo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DBoyara%2FQuikGo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DBoyara","download_url":"https://codeload.github.com/DBoyara/QuikGo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DBoyara%2FQuikGo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273993039,"owners_count":25203792,"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-09-07T02:00:09.463Z","response_time":67,"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":[],"created_at":"2025-02-01T11:28:22.019Z","updated_at":"2025-09-07T03:38:07.410Z","avatar_url":"https://github.com/DBoyara.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuikGo\nДоступ к функционалу Quik из связки Lua\u0026amp;Golang\n\n![CI Status](https://github.com/DBoyara/QuikGo/actions/workflows/main.yml/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/DBoyara/QuikGo)](https://goreportcard.com/report/github.com/DBoyara/QuikGo)\n[![GoDoc](https://godoc.org/github.com/DBoyara/QuikGo?status.svg)](https://godoc.org/github.com/DBoyara/QuikGo)\n[![License](https://img.shields.io/github/license/DBoyara/QuikGo)](https://github.com/DBoyara/QuikGo/blob/main/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/DBoyara/QuikGo.svg)](https://GitHub.com/DBoyara/QuikGo/releases/)\n[![Known Vulnerabilities](https://snyk.io/test/github/DBoyara/QuikGo/badge.svg)](https://snyk.io/test/github/DBoyara/QuikGo)\n\n## Install\ngo get -u github.com/DBoyara/QuikGo@v0.4.6\n\n## Examples\n\n### Пример подключения к серверу LUA и команды Ping\n```go\nfunc main() {\n\tlogger, _ := zap.NewDevelopment()\n\tclient, err := quik.NewQuikClient(\"127.0.0.1\", 54320, true) // development = true — режим разработки, false — продакшен\n\tif err != nil {\n\t\tlogger.Error(\"Failed to create Quik client\", zap.Error(err))\n\t\treturn\n\t}\n\tdefer client.Close()\n\n\tcontext := context.Background()\n\n\tresponse, err := client.Ping(context)\n\tif err != nil {\n\t\tlogger.Error(\"Failed to ping Quik server\", zap.Error(err))\n\t\treturn\n\t}\n\n\tlogger.Info(\"Ping response\", zap.Any(\"response\", response))\n}\n```\n\n### Пример создания DataSource и получения свечей\n```go\nfunc main() {\n\tdataDataSource := quik.CreateDataSourceRequest{\n\t\tquik.DataSourceRequest: quik.DataSourceRequest{\n\t\t\tTicker:   \"SBER\",\n\t\t\tInterval: 1,\n\t\t}\n\t\tClass: \"TQBR\",\n\t}\n\terr := client.CreateDataSource(dataDataSource, context)\n\tif err != nil {\n\t\tlogger.Error(\"Failed to create data source\", zap.Error(err))\n\t\treturn\n\t}\n\n\tdataCandles := quik.GetCandlesRequest{\n\t\tTicker:   \"SBER\",\n\t\tInterval: 1,\n\t\tCount:    10,\n\t\tClass:    \"TQBR\",\n\t}\n\tcandles, err := client.GetCandles(dataCandles, context)\n\tif err != nil {\n\t\tlogger.Error(\"Failed to get candles\", zap.Error(err))\n\t\treturn\n\t}\n\n\tfor _, candle := range candles {\n\t\tfmt.Printf(\"Candle: %s O: %.2f H: %.2f L: %.2f C: %.2f V: %d\\n\",\n\t\t\tcandle.Timestamp,\n\t\t\tcandle.Open,\n\t\t\tcandle.High,\n\t\t\tcandle.Low,\n\t\t\tcandle.Close,\n\t\t\tcandle.Volume,\n\t\t)\n\t}\n}\n```\n\n### Пример получения аккаунтов\n```go\naccounts, err := client.GetTradeAccounts(context)\nif err != nil {\n    logger.Error(\"Failed to get trade accounts\", zap.Error(err))\n    return\n}\n\nfmt.Println(accounts)\n```\n\n### Пример денежных лимитов\n```go\nlimits, err := client.GetMoneyLimits(context)\nif err != nil {\n    logger.Error(\"Failed to get limits\", zap.Error(err))\n    return\n}\n\nfmt.Println(limits)\n```\n\n### Account, ClientCode, FirmId - можно разово получить из GetTradeAccounts и GetMoneyLimits\n### Пример заявок на покупку\n```go\ntransID := quik.NewCounter(1)\ndataOrder := quik.CreateOrderRequest{\n    ClassCode: \"TQBR\",\n    SecCode:   \"SBER\",\n    Account:   \"your-account-code\",\n    Trans_id:  transID.Next(),\n    Operation: \"B\",\n    Price:     \"100.00\",\n    Quantity:  \"1\",\n    Action:    \"NEW_ORDER\",\n    Type:      \"L\",\n}\nerr = client.SendTransaction(dataOrder, context)\nif err != nil {\n    logger.Error(\"Failed to create order\", zap.Error(err))\n    return\n}\n```\n\n### Пример портфолио\n```go\ndataPortfolio := quik.GetPortfolioRequest{\n    ClientCode: \"your-client-code\",\n    FirmId:     \"your-firm-id\",\n}\nportfolio, err := client.GetPortfolioInfo(dataPortfolio, context)\nif err != nil {\n    logger.Error(\"Failed to get portfolio\", zap.Error(err))\n    return\n}\n\nfmt.Println(portfolio)\n```\n\n### Пример обработки Callback\n```go\nfunc eventHandler(event quik.Event) {\n\tswitch event.Cmd {\n\tcase \"OnConnected\":\n\t\tfmt.Println(\"✅ Подключение установлено:\", event.Data)\n\tcase \"OnDisconnected\":\n\t\tfmt.Println(\"❌ Подключение разорвано:\", event.Data)\n\tcase \"OnTrade\":\n\t\tfmt.Println(\"📊 Новая сделка:\", event.Data)\n\tdefault:\n\t\tfmt.Println(\"⚠️ Неизвестное событие:\", event.Cmd, \"| Данные:\", event.Data)\n\t}\n}\n\nfunc main() {\n\tlogger, _ := quik.NewLogger(true)\n\tquik.RunServer(54321, true, eventHandler, logger)\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdboyara%2Fquikgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdboyara%2Fquikgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdboyara%2Fquikgo/lists"}