Wickra.Gym 0.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Wickra.Gym --version 0.1.2
                    
NuGet\Install-Package Wickra.Gym -Version 0.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wickra.Gym" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wickra.Gym" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="Wickra.Gym" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Wickra.Gym --version 0.1.2
                    
#r "nuget: Wickra.Gym, 0.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Wickra.Gym@0.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Wickra.Gym&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=Wickra.Gym&version=0.1.2
                    
Install as a Cake Tool

Wickra Gym — C#

A deterministic, Gymnasium-compatible backtest environment for .NET, over the Wickra C ABI. A rollout is byte-identical to every other language binding.

Install

dotnet add package Wickra.Gym

The native library for your runtime is packed under runtimes/<rid>/native/ and resolved automatically (a sentinel-export check rejects a wrong or stale library).

Usage

using System.Text.Json;
using Wickra.Gym;

const string spec = """
    {"dataset_ref":"demo","symbol":"BTCUSDT",
     "observation":{"features":[{"kind":"price","field":"close"}]},
     "action_space":{"type":"discrete","n":3},
     "reward":"pnl","episode":{"max_steps":256,"warmup":0}}
    """;

using var env = new Env(spec);

var candles = Enumerable.Range(0, 300).Select(i => new
{
    ts = i, open = 100.0 + i, high = 100.0 + i, low = 100.0 + i, close = 100.0 + i,
});
env.Command(JsonSerializer.Serialize(new { cmd = "load", candles }));

string reset = env.Command("""{"cmd":"reset","seed":0}""");
string step = env.Command("""{"cmd":"step","action":2}""");
Console.WriteLine(step);

Commands: load, reset, step, spec, version. Domain errors come back as {"ok":false,"error":...}; a bad spec throws ArgumentException at construction.

License

Dual-licensed under MIT or Apache-2.0, at your option.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 83 10/6/2026
0.1.6 125 9/27/2026
0.1.5 93 9/24/2026
0.1.4 102 9/23/2026
0.1.3 108 9/18/2026
0.1.2 118 9/14/2026
0.1.1 125 9/14/2026
0.1.0 139 9/14/2026