package
0.0.0-20250311023717-5c21e974eed8
Repository: https://github.com/thrasher-corp/gocryptotrader.git
Documentation: pkg.go.dev

# README

GoCryptoTrader Backtester: Common package

Build Status Software License GoDoc Coverage Status Go Report Card

This common package is part of the GoCryptoTrader codebase.

This is still in active development

You can track ideas, planned features and what's in progress on our GoCryptoTrader Kanban board.

Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack

Common package overview

Common contains some basic data types which are used throughout.

Please click GoDocs chevron above to view current GoDoc information for this package

Contribution

Please feel free to submit any pull requests or suggest any desired features to be added.

When submitting a PR, please abide by our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Code must adhere to our coding style.
  • Pull requests need to be based on and opened against the master branch.

Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:

bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc

# Functions

CanTransact checks whether an order side is valid to the backtester's standards.
DataTypeToInt converts the config string value into an int.
FitStringToLimit ensures a string is of the length of the limit either by truncating the string with ellipses or padding with the spacer.
GenerateFileName will convert a proposed filename into something that is more OS friendly.
Logo returns the logo.
PurgeColours removes colour information.
RegisterBacktesterSubLoggers sets up all custom Backtester sub-loggers.
SetColours sets cmd output colours at startup.

# Constants

ASCIILogo is a sweet logo that is optionally printed to the command line window.
CandleStr is a config readable data type to tell the backtester to retrieve candle data.
DataCandle is an int64 representation of a candle data type.
DataTrade is an int64 representation of a trade data type.
TradeStr is a config readable data type to tell the backtester to retrieve trade data.

# Variables

custom subloggers for backtester use.
CMDColours holds colour information for CMD output.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.
ErrFileNotFound returned when the file is not found.
ErrInvalidDataType occurs when an invalid data type is defined in the config.
ErrNilEvent is a common error for whenever a nil event occurs when it shouldn't have.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.
custom subloggers for backtester use.

# Structs

Colours defines colour types for CMD output.

# Interfaces

Directioner dictates the side of an order.
Event interface implements required GetTime() & Pair() return.