Files
Brummel 9c39a743d0 Add Linux-native cTrader cBot build/run scaffold
Build cBots in C# and compile them to .algo entirely on Linux via the
official cTrader.Automate NuGet package + 'dotnet build' — no Windows and
no cTrader desktop app. Run/backtest headless through Spotware's official
cTrader console Docker image.

Includes:
- src/SampleCBot: example SMA-crossover cBot (SDK-style net6.0 class library)
- scripts/install-dotnet.sh: root-free local .NET SDK install (~/.dotnet)
- scripts/build.sh: dotnet build -> dist/<ProjectName>.algo, with a workaround
  for cTrader.Automate naming the .algo after the project's parent folder
- scripts/run-console.sh: wrapper over ghcr.io/spotware/ctrader-console
- docs/research-findings.md: sourced research; .algo verified as a proprietary
  'algo'-magic container (not a ZIP); build verified end to end on Linux
2026-06-18 20:54:56 +02:00

34 lines
1.7 KiB
Markdown

# cTrader cBot scaffold — project rules
A Linux-native toolchain for building cTrader cBots in C# and compiling them to
`.algo`, plus running/backtesting them headless via Spotware's official cTrader CLI
Docker image. No Windows, no cTrader desktop app. See `README.md` and
`docs/research-findings.md`.
## Domain facts (load-bearing, verified)
- cBots are .NET 6 class libraries referencing the **official** NuGet package
`cTrader.Automate` (owner **spotware**). Do **not** use the third-party `cAlgo.API`
package — it is not the Spotware SDK.
- `dotnet build` emits the `.algo`; the cTrader desktop app is not needed to compile.
- `.algo` is a proprietary, encrypted container (file magic = ASCII `algo`), not a ZIP.
- `cTrader.Automate` 1.0.17 names the `.algo` after the project's **parent folder**
(no override property); `scripts/build.sh` renames artifacts to `<ProjectName>.algo`.
- Run/backtest on Linux requires cTrader 5.4+ console image (`ghcr.io/spotware/ctrader-console`).
## Conventions
- Everything committed is **English** (code, comments, docs, commit messages).
- New cBots go under `src/<BotName>/`, one class-library project each.
## Skills plugin: project facts
- **Code roots:** `src/` (cBots/indicators), `scripts/` (toolchain).
- **Build command:** `./scripts/build.sh` (wraps `dotnet build -c Release`, collects
`dist/<ProjectName>.algo`). Requires the .NET SDK on PATH or in `~/.dotnet`
(`./scripts/install-dotnet.sh`).
- **Test command:** none yet (no test project). Build success + a valid `.algo`
(magic bytes `algo`) is the current acceptance check.
- **Run/backtest:** `./scripts/run-console.sh` (Docker, official cTrader console).
- **Issue tracker:** none yet.