{"id":34184230,"url":"https://github.com/luismcruz/gotrader","last_synced_at":"2026-03-17T20:34:12.704Z","repository":{"id":57506110,"uuid":"163774151","full_name":"luismcruz/gotrader","owner":"luismcruz","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-21T10:43:46.000Z","size":54,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-18T14:17:36.144Z","etag":null,"topics":["automation","backtesting-engine","golang","oanda-client","trading","trading-algorithms","trading-strategies"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/luismcruz.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":"2019-01-01T23:35:02.000Z","updated_at":"2025-12-09T13:29:51.000Z","dependencies_parsed_at":"2022-08-29T20:00:32.933Z","dependency_job_id":null,"html_url":"https://github.com/luismcruz/gotrader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luismcruz/gotrader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luismcruz%2Fgotrader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luismcruz%2Fgotrader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luismcruz%2Fgotrader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luismcruz%2Fgotrader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luismcruz","download_url":"https://codeload.github.com/luismcruz/gotrader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luismcruz%2Fgotrader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30631250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["automation","backtesting-engine","golang","oanda-client","trading","trading-algorithms","trading-strategies"],"created_at":"2025-12-15T14:54:16.422Z","updated_at":"2026-03-17T20:34:12.685Z","avatar_url":"https://github.com/luismcruz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gotrader\n\n## Overview\n\nA golang package to automatize trading strategies. This package was mainly developed to trade FOREX, and it depends on fact that the broker should provide control over trades (single transactions). Examples of such brokers are Oanda and IG if using rest API's. In the other hand, the FIX protocol only allow to close or reduce positions (defined here as an aggregation of trades) which is not supported by the package yet.\n\n## Usage\n\nCreate a streategy that implements the Strategy interface:\n\n```Go\ntype MyStrategy struct {\n    engine gotrader.Engine\n}\n\nfunc (s *MyStrategy) SetEngine(engine gotrader.Engine) { // Engine will inject itself to the strategy\n    s.engine = engine\n}\n\nfunc (s *MyStrategy) OnTick(tick *gotrader.Tick) {\n    // Main Strategy logic\n}\n\n...\n\n```\n\nThen just instantiate a trading session with the strategy and client you need:\n\n```Go\nstrategy := \u0026MyStrategy{}\n\nclient := oanda.NewOandaClient(\"my-token\", false)\n\nsession := gotrader.NewTradingSession(\n\t\tgotrader.Instruments([]string{\n\t\t\t\"EUR_USD\",\n\t\t}),\n\t\tgotrader.AccountID(\"my-account\"),\n)\n\nsession.SetStrategy(strategy).SetClient(client).Live()\n\nif err := session.Start(); err != nil {\n    logrus.Warn(err)\n}\n\n```\n\n## Included Clients\n\n- Oanda\n- Random Generator (testing)\n\n## TODO\n\n- Write tests for gotrader\n- Include more broker clients\n- Refactor to add the possibility to use FIX protocol on the clients (control over position only)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluismcruz%2Fgotrader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluismcruz%2Fgotrader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluismcruz%2Fgotrader/lists"}