trackingcurrencies

package
v0.0.0-...-83dca6d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: MIT Imports: 5 Imported by: 0

README

GoCryptoTrader Backtester: Trackingcurrencies package

Build Status Software License GoDoc Coverage Status Go Report Card

This trackingcurrencies 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 this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.

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

Trackingcurrencies package overview

What does the tracking currencies package do?

The tracking currencies package is responsible breaking up a user's strategy currencies into pairs with a USD equivalent pair in order to track strategy performance against a singular currency. For example, you are wanting to backtest on Binance using XRP/DOGE, the tracking currencies will also retrieve XRP/BUSD and DOGE/BUSD pair data for use in calculating how much a currency is worth at every candle point.

What if the exchange does not support USD?

The tracking currencies package will check supported currencies against a list of USD equivalent USD backed stablecoins. So if your select exchange only supports BUSD or USDT based pairs, then the GoCryptoTrader Backtester will break up config pairs into the equivalent. See below list for currently supported stablecoin equivalency

Currency
USD
USDT
BUSD
USDC
DAI
TUSD
ZUSD
PAX
How do I disable this?

If you need to disable this functionality, for example, you are using Live, Database or CSV based trade data, then under strategy-settings in your config, set disable-usd-tracking to true

Can I supply my own list of equivalent currencies instead of USD?

This is currently not supported. If this is a feature you would like to have, please raise an issue on GitHub or in our Slack channel

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCurrencyContainsUSD is raised when the currency already contains a USD equivalent
	ErrCurrencyContainsUSD = errors.New("currency already contains a USD equivalent")
	// ErrCurrencyDoesNotContainsUSD is raised when the currency does not contain a USD equivalent
	ErrCurrencyDoesNotContainsUSD = errors.New("currency does not contains a USD equivalent")
)

Functions

func CurrencyIsUSDTracked

func CurrencyIsUSDTracked(code currency.Code) bool

CurrencyIsUSDTracked checks if the currency passed in tracks against USD value, ie is in rankedUSDs

Types

type TrackingPair

type TrackingPair struct {
	Exchange string
	Asset    string
	Base     string
	Quote    string
}

TrackingPair is basic pair data used to create more pairs based whether they contain a USD equivalent

func CreateUSDTrackingPairs

func CreateUSDTrackingPairs(tp []TrackingPair, em *engine.ExchangeManager) ([]TrackingPair, error)

CreateUSDTrackingPairs is responsible for loading exchanges, ensuring the exchange have the latest currency pairs and if a pair doesn't have a USD currency to track price, to add those settings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL