Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
- Code of Conduct
- Getting Started
- Development Workflow
- Code Style
- Commit Conventions
- Pull Request Process
- Issue Guidelines
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. See CODE_OF_CONDUCT.md.
- .NET 9.0 SDK or later
- Git
- A code editor (VS Code, Visual Studio, JetBrains Rider)
# Fork via GitHub UI, then:
git clone https://github.com/YOUR_USERNAME/High-Performance-Backtest.Net.git
cd High-Performance-Backtest.Net
git remote add upstream https://github.com/islero/High-Performance-Backtest.Net.git# Restore dependencies
dotnet restore
# Build all projects
dotnet build
# Run tests
dotnet test
# Run benchmarks (optional)
cd benchmarks/Backtest.Net.Benchmarks
dotnet run -c Release| Branch | Purpose |
|---|---|
master |
Stable releases only |
dev |
Integration branch for features |
feature/* |
New features |
fix/* |
Bug fixes |
perf/* |
Performance improvements |
- Sync your fork with upstream
dev - Create a feature branch from
dev - Implement your changes with tests
- Test locally:
dotnet test - Push your branch and open a PR against
dev
# Sync with upstream
git fetch upstream
git checkout dev
git merge upstream/dev
# Create feature branch
git checkout -b feature/my-feature
# Make changes, then push
git push origin feature/my-feature- Follow existing patterns in the codebase
- Use meaningful names for variables, methods, and classes
- Keep methods focused - single responsibility
- Add XML documentation for public APIs
// DO: Use explicit types for clarity in complex scenarios
List<SymbolDataV2> symbolData = GetSymbolData();
// DO: Use var when type is obvious
var engine = new EngineV10(warmupCandlesCount: 100, sortCandlesInDescOrder: false, useFullCandleForCurrent: false);
// DO: Use expression-bodied members for simple properties/methods
public decimal GetProgress() => (decimal)Index / MaxIndex * 100;
// DO: Use primary constructors for simple classes (C# 12+)
public sealed class EngineV10(int warmupCandlesCount, bool sortDesc, bool useFullCandle)
: EngineV8(warmupCandlesCount, useFullCandle)
// DON'T: Leave commented-out code
// DON'T: Use magic numbers without explanation
// DON'T: Suppress warnings without justificationWhen contributing to hot paths:
// DO: Use Span<T> for zero-allocation iteration
var span = CollectionsMarshal.AsSpan(list);
// DO: Mark hot methods for inlining
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void ProcessCandle(...)
// DO: Prefer for loops over LINQ in hot paths
for (var i = 0; i < span.Length; i++) { ... }
// DO: Use sealed classes where inheritance isn't needed
public sealed class CandlestickV2 { ... }- Use 4 spaces for indentation (no tabs)
- Use
dotnet formatbefore committing - Keep lines under 120 characters when reasonable
Follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
perf |
Performance improvement |
refactor |
Code change that neither fixes a bug nor adds a feature |
test |
Adding or updating tests |
docs |
Documentation only |
chore |
Build process, dependencies, tooling |
feat(engine): add EngineV11 with improved memory pooling
fix(splitter): correct index calculation for edge case
perf(engine): reduce allocations in OHLC handling
test(engine): add coverage for cancellation scenarios
docs: update quickstart example in README- Tests pass locally:
dotnet test - Code formatted:
dotnet format - No new warnings introduced
- Changes are documented (if applicable)
- Commit messages follow conventions
Your PR should include:
- Summary: What does this PR do?
- Motivation: Why is this change needed?
- Testing: How was this tested?
- Breaking Changes: Any breaking changes? (if applicable)
- Maintainers will review within 3-5 business days
- Address feedback in new commits (don't force-push during review)
- Once approved, maintainer will squash-merge
Include:
- .NET SDK version (
dotnet --version) - Operating system
- Minimal reproduction steps
- Expected vs actual behavior
- Stack trace (if applicable)
Include:
- Use case description
- Proposed API (if applicable)
- Alternatives considered
- Open a Discussion
- Check existing Issues
Thank you for contributing!