CryptoLab 1.2.0

dotnet add package CryptoLab --version 1.2.0                
NuGet\Install-Package CryptoLab -Version 1.2.0                
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="CryptoLab" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CryptoLab --version 1.2.0                
#r "nuget: CryptoLab, 1.2.0"                
#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.
// Install CryptoLab as a Cake Addin
#addin nuget:?package=CryptoLab&version=1.2.0

// Install CryptoLab as a Cake Tool
#tool nuget:?package=CryptoLab&version=1.2.0                

Libraries Python for CryptoLab

Website: https://www.crypto-lab.io
Documentation: https://www.crypto-lab.io/documentation
Swagger: https://www.crypto-lab.io/swagger Git: https://github.com/crypto-lab-io/client-libraries

.NET

Available on Microsoft Nuget: https://www.nuget.org/packages/CryptoLab/
Sample to use it to replay data

using CryptoLab;

// Show the version lib
Console.WriteLine("Verison: " + CryptoLab.CryptoLabAPI.version().ToString());

// Init the client
CryptoLabAPI client = new CryptoLabAPI("YOUR_APPI_KEY", true);

// Get list of exchanges available and displayt it
List<Exchange> exchanges = client.get_exchanges();
foreach(Exchange exchange in exchanges)
    Console.WriteLine(exchange.exchange);

// Get list of markets available for binance
List<Market> markets = client.get_markets(new Exchange { exchange = "binance" });
Console.WriteLine(markets.Count + " markets available for Binance");
foreach (Market market in markets)
    Console.WriteLine("Market " + market.market + ": data available from " + market.first_record + " to " + market.last_record + ". Total size " + ConvertBytes(market.bytes));

// Init the replay data for
client.init_replay(callback, new Exchange { exchange = "binance" }, new Market { market = "btc_usdt" }, "2022-05-07", "2022-06-07", false);
client.start_replay();
Console.WriteLine("Strating replay for Binance btc_usdt (downloading data in " + client.get_cache_directory() + ". Could be long)");

// Callback on event (message or trade)
void  callback(object data)
{
    /* Add your trading algorithm here */


    // If you stop (not definitivly) the replay, the callback function is called but the trade is null
    if (data == null)
        return;

    // If data is a message
    if (data is string)
        Console.WriteLine("Message: " + data);

    // If data is trade
    if(data is Trade) {
        Trade? trade = data as Trade;
        Console.WriteLine("Trade id: " + trade.trade_id);
    }
}

Output: Logo

Logo

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.2.0 26 8/30/2024
1.1.0 29 8/30/2024
1.0.0 31 8/30/2024