Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diegobernardes/ctrader
Go SDK for cTrader Open API
https://github.com/diegobernardes/ctrader
ctrader forex trading
Last synced: about 2 months ago
JSON representation
Go SDK for cTrader Open API
- Host: GitHub
- URL: https://github.com/diegobernardes/ctrader
- Owner: diegobernardes
- License: mit
- Created: 2023-05-28T10:44:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-05T09:32:49.000Z (7 months ago)
- Last Synced: 2024-06-05T10:57:36.380Z (7 months ago)
- Topics: ctrader, forex, trading
- Language: Go
- Homepage:
- Size: 261 KB
- Stars: 8
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# cTrader Go SDK
This repository contains a Go SDK to consume [cTrader OpenAPI](https://help.ctrader.com/open-api).## Requirements
- Go 1.22 or higher.
- Earthly (optional).## Usage
Check the `_test.go` files.## Testing
```shell
# Set the following environment variables:
# - CTRADER_CLIENT_ID
# - CTRADER_SECRET
# - CTRADER_ACCOUNT_ID
# - CTRADER_TOKEN,# Execute the tests directly with Go:
go test -tags integration -race ./...# Or you can execute using Earthly:
earthly --secret CTRADER_CLIENT_ID="$CTRADER_CLIENT_ID" \
--secret CTRADER_SECRET="$CTRADER_SECRET" \
--secret CTRADER_ACCOUNT_ID="$CTRADER_ACCOUNT_ID" \
--secret CTRADER_TOKEN="$CTRADER_TOKEN" \
+go-test
```## FAQ
### How to register an application?
Follow [this](https://help.ctrader.com/open-api/creating-new-app/#register-your-application) instructions.## How to get an access ID and secret?
The easiest way is to use the
[playground](https://help.ctrader.com/open-api/account-authentication/#using-the-playground).### How can I upgrade cTrader OpenAPI protobuf files?
- Open the [Earthfile](https://github.com/diegobernardes/ctrader/blob/main/Earthfile.md) and edit the
`+compile-proto` target.
- Execute the target `earthly +compile-proto`.
- Sync the dependencies `go mod tidy`.
- Ensure the package still compiles `go build ./...`.
- Open a pull request.## Documentation
- [Protobuf](./docs/protobuf.md)
- [Testing](./docs/testing.md)## Acknowledgments
* [ty2/ctrader-go](https://github.com/ty2/ctrader-go)
* [MariaLetta/free-gophers-pack](https://github.com/MariaLetta/free-gophers-pack)