cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlertLogger *log.Logger

AlertLogger for harpun

View Source
var ErrorLogger *log.Logger

ErrorLogger for harpun

View Source
var Hook bool

Hook configuration to be used

View Source
var InfoLogger *log.Logger

InfoLogger for harpun

View Source
var Multiplier int64

Multiplier defining large trades

View Source
var WarningLogger *log.Logger

WarningLogger for harpun

Functions

func AddStock

func AddStock(s Stock)

AddStock to db

func AddStocks

func AddStocks(s []Stock)

AddStocks from a trading platform

func AlertHook

func AlertHook(s Stock, t Trade, tp float64)

AlertHook to external hook

func DetectWhale

func DetectWhale(s Stock, t Trade)

DetectWhale aka unusual large trade

func GetDailyTrades

func GetDailyTrades(s Stock)

GetDailyTrades for a ticker, current limit is 100 trades per fetch

func GetFirstNorth

func GetFirstNorth()

GetFirstNorth stocks from Avanza

func Main

func Main()

Main for harpun app

func UpdateAverageAmounts

func UpdateAverageAmounts(s Stock)

UpdateAverageAmounts for stocks

Types

type Config

type Config struct {
	DbUser     string `yaml:"user"`
	DbPassword string `yaml:"password"`
	DbSchema   string `yaml:"schema"`
	Hook       bool   `yaml:"hook"`
	LogPath    string `yaml:"log"`
	Multiplier int64  `yaml:"multiplier"`
}

Config to use

func (*Config) GetConfig

func (c *Config) GetConfig(config string) *Config

GetConfig of user

type Stock

type Stock struct {
	ID     string
	Name   string
	Ticker string
}

Stock to fetch data for

func GetStocks

func GetStocks() []Stock

GetStocks from db

type Trade

type Trade struct {
	Ticker string
	Buyer  string
	Seller string
	Amount int64
	Price  string
	Time   string
}

Trade fetched for a ticker

Jump to

Keyboard shortcuts

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