stats

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: 4 Imported by: 0

README

GoCryptoTrader package Stats

Build Status Software License GoDoc Coverage Status Go Report Card

This stats 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

Current Features for stats

  • This stats package services the exchanges package by providing stats on enabled exchanges i.e.
    • Sort by largest volume
    • Sort by best price for currency
    • Others will be added soon
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 Items []Item

Items var array

Functions

func Add

func Add(exchange string, p currency.Pair, a asset.Item, price, volume float64) error

Add adds or updates the item stats

func AlreadyExists

func AlreadyExists(exchange string, p currency.Pair, assetType asset.Item, price, volume float64) bool

AlreadyExists checks to see if item info already exists for a specific currency pair and asset type

func Append

func Append(exchange string, p currency.Pair, a asset.Item, price, volume float64)

Append adds or updates the item stats for a specific currency pair and asset type

Types

type ByPrice

type ByPrice []Item

ByPrice allows sorting by price

func (ByPrice) Len

func (b ByPrice) Len() int

func (ByPrice) Less

func (b ByPrice) Less(i, j int) bool

func (ByPrice) Swap

func (b ByPrice) Swap(i, j int)

type ByVolume

type ByVolume []Item

ByVolume allows sorting by volume

func (ByVolume) Len

func (b ByVolume) Len() int

func (ByVolume) Less

func (b ByVolume) Less(i, j int) bool

func (ByVolume) Swap

func (b ByVolume) Swap(i, j int)

type Item

type Item struct {
	Exchange  string
	Pair      currency.Pair
	AssetType asset.Item
	Price     float64
	Volume    float64
}

Item holds various fields for storing currency pair stats

func SortExchangesByPrice

func SortExchangesByPrice(p currency.Pair, assetType asset.Item, reverse bool) []Item

SortExchangesByPrice sorts item info by volume for a specific currency pair and asset type. Reverse will reverse the order from lowest to highest

func SortExchangesByVolume

func SortExchangesByVolume(p currency.Pair, assetType asset.Item, reverse bool) []Item

SortExchangesByVolume sorts item info by volume for a specific currency pair and asset type. Reverse will reverse the order from lowest to highest

Jump to

Keyboard shortcuts

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