Skip to content

Plugin.Compiler

property · Plugin · cAlgo.API Since 5.1

DesktopCLICloud

Provides access to algo compiler.

Environment behaviour

CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.

Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.

Definition

public Compiler Compiler {get;}
api.Compiler: Compiler

Returns Compiler

Examples

var result = Compiler.Compile(@"C:\Users\Me\Documents\cAlgo\Sources\Robots\MyBot\MyBot.csproj");
Print("Compilation succeeded: {0}", result.Succeeded);
foreach (var error in result.Errors)
    Print(error);
result = api.Compiler.Compile(r"C:\Users\Me\Documents\cAlgo\Sources\Robots\MyBot\MyBot.csproj")
api.Print(f"Compilation succeeded: {result.Succeeded}")
for error in result.Errors:
    api.Print(error)