command

package
v0.0.0-...-41ec502 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2017 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const BTC_BUY_AMOUNT = 0.01
View Source
const BUY_COOLOFF = 0
View Source
const LIVE_DB = "sftbot-live.db"
View Source
const PLX_FEE = 0.00025
View Source
const PROFIT_FACTOR = 1.06
View Source
const PROSPECT_DB = "sftbot-prospect.db"
View Source
const SELL_COOLOFF = 0
View Source
const TIME_VAR_FORMAT = "2006-01-02 15:04:05 MST"
View Source
const TRADE_INTERVAL = 300 // 5 minutes
View Source
const VOLATILITY = 1.02
View Source
const WINDOW = 24 * 60 * 60
View Source
const XRP_SELL_AMOUNT = 90
View Source
const XRP_SELL_PCT = 0.5

Variables

This section is empty.

Functions

func Balances

func Balances() (cli.Command, error)

func CalcPercentiles

func CalcPercentiles(prices []float64) map[int]float64

func ChartDataImport

func ChartDataImport() (cli.Command, error)

func ChartDataList

func ChartDataList() (cli.Command, error)

func MyTrades

func MyTrades() (cli.Command, error)

func OpenOrders

func OpenOrders() (cli.Command, error)

func Prospect

func Prospect() (cli.Command, error)

func Simulate

func Simulate() (cli.Command, error)

func Ticker

func Ticker() (cli.Command, error)

func Trade

func Trade() (cli.Command, error)

func TradeHistory

func TradeHistory() (cli.Command, error)

Types

type BalancesCommand

type BalancesCommand struct {
}

func (*BalancesCommand) Help

func (c *BalancesCommand) Help() string

func (*BalancesCommand) Run

func (c *BalancesCommand) Run(args []string) int

func (*BalancesCommand) Synopsis

func (c *BalancesCommand) Synopsis() string

type ByVolumeDesc

type ByVolumeDesc []plx.TickerEntry

func (ByVolumeDesc) Len

func (a ByVolumeDesc) Len() int

func (ByVolumeDesc) Less

func (a ByVolumeDesc) Less(i, j int) bool

func (ByVolumeDesc) Swap

func (a ByVolumeDesc) Swap(i, j int)

type ChartDataImportCommand

type ChartDataImportCommand struct {
	Flags *flag.FlagSet

	CurrencyPair string

	Continuous bool
	Days       int64
	Resolution int64
}

func (*ChartDataImportCommand) Help

func (c *ChartDataImportCommand) Help() string

func (*ChartDataImportCommand) InitFlags

func (c *ChartDataImportCommand) InitFlags() *flag.FlagSet

func (*ChartDataImportCommand) Parse

func (c *ChartDataImportCommand) Parse(args []string) error

func (*ChartDataImportCommand) Run

func (c *ChartDataImportCommand) Run(args []string) int

func (*ChartDataImportCommand) Synopsis

func (c *ChartDataImportCommand) Synopsis() string

type ChartDataListCommand

type ChartDataListCommand struct {
	Flags  *flag.FlagSet
	Market string

	StartTimeVar string
	StartTime    time.Time

	EndTimeVar string
	EndTime    time.Time
}

func (*ChartDataListCommand) Help

func (c *ChartDataListCommand) Help() string

func (*ChartDataListCommand) InitFlags

func (c *ChartDataListCommand) InitFlags() *flag.FlagSet

func (*ChartDataListCommand) Run

func (c *ChartDataListCommand) Run(args []string) int

func (*ChartDataListCommand) Synopsis

func (c *ChartDataListCommand) Synopsis() string

func (*ChartDataListCommand) Validate

func (c *ChartDataListCommand) Validate()

type Command

type Command interface {
	InitFlags() *flag.FlagSet
}

type MyTradesCommand

type MyTradesCommand struct {
	Flags  *flag.FlagSet
	Market string

	StartTimeVar string
	StartTime    time.Time

	EndTimeVar string
	EndTime    time.Time
}

func (*MyTradesCommand) Help

func (c *MyTradesCommand) Help() string

func (*MyTradesCommand) InitFlags

func (c *MyTradesCommand) InitFlags() *flag.FlagSet

func (*MyTradesCommand) Run

func (c *MyTradesCommand) Run(args []string) int

func (*MyTradesCommand) Synopsis

func (c *MyTradesCommand) Synopsis() string

func (*MyTradesCommand) Validate

func (c *MyTradesCommand) Validate() (err error)

type OpenOrdersCommand

type OpenOrdersCommand struct {
}

func (*OpenOrdersCommand) Help

func (c *OpenOrdersCommand) Help() string

func (*OpenOrdersCommand) Run

func (c *OpenOrdersCommand) Run(args []string) int

func (*OpenOrdersCommand) Synopsis

func (c *OpenOrdersCommand) Synopsis() string

type ProspectCommand

type ProspectCommand struct {
	Flags *flag.FlagSet

	Config string

	DBStore db.Store
}

func (*ProspectCommand) Help

func (c *ProspectCommand) Help() string

func (*ProspectCommand) InitDB

func (c *ProspectCommand) InitDB()

func (*ProspectCommand) InitFlags

func (c *ProspectCommand) InitFlags() *flag.FlagSet

func (*ProspectCommand) InitTrader

func (c *ProspectCommand) InitTrader(marketName string) (*trading.Trader, error)

func (*ProspectCommand) LoadTraderConfig

func (c *ProspectCommand) LoadTraderConfig() (*trading.TraderConfig, error)

func (*ProspectCommand) Run

func (c *ProspectCommand) Run(args []string) int

func (*ProspectCommand) Synopsis

func (c *ProspectCommand) Synopsis() string

type SimulateCommand

type SimulateCommand struct {
	DB    *data.Store
	Flags *flag.FlagSet

	BTC_Balance   float64
	XRP_Balance   float64
	PLX_Balance   float64
	Bids          []float64
	LastBuyTime   int64
	LastSellTime  int64
	BuyThreshold  int
	SellThreshold float64

	CurrencyPair string

	StartTimeVar string
	StartTime    time.Time

	EndTimeVar string
	EndTime    time.Time
}

func (*SimulateCommand) Buy

func (c *SimulateCommand) Buy(price float64, d *data.ChartData) bool

func (*SimulateCommand) ForTimeRange

func (c *SimulateCommand) ForTimeRange(startTime, endTime time.Time, callback func(d *data.ChartData)) error

func (*SimulateCommand) GetPrices

func (c *SimulateCommand) GetPrices(startTime, endTime time.Time) []float64

func (*SimulateCommand) Help

func (c *SimulateCommand) Help() string

func (*SimulateCommand) InitFlags

func (c *SimulateCommand) InitFlags() *flag.FlagSet

func (*SimulateCommand) Run

func (c *SimulateCommand) Run(args []string) int

func (*SimulateCommand) Sell

func (c *SimulateCommand) Sell(price float64, d *data.ChartData, force bool) bool

func (*SimulateCommand) ShouldBuy

func (c *SimulateCommand) ShouldBuy(price float64, prices []float64, percentiles map[int]float64) bool

func (*SimulateCommand) ShouldSell

func (c *SimulateCommand) ShouldSell(price float64, prices []float64, percentiles map[int]float64) bool

func (*SimulateCommand) Synopsis

func (c *SimulateCommand) Synopsis() string

func (*SimulateCommand) Validate

func (c *SimulateCommand) Validate() error

type TickerCommand

type TickerCommand struct {
	Flags   *flag.FlagSet
	Markets string
}

func (*TickerCommand) Help

func (c *TickerCommand) Help() string

func (*TickerCommand) InitFlags

func (c *TickerCommand) InitFlags() *flag.FlagSet

func (*TickerCommand) Run

func (c *TickerCommand) Run(args []string) int

func (*TickerCommand) Synopsis

func (c *TickerCommand) Synopsis() string

type TradeCommand

type TradeCommand struct {
	Flags *flag.FlagSet

	Market string
	Config string
	Offset int64

	DBStore db.Store
}

func (*TradeCommand) Help

func (c *TradeCommand) Help() string

func (*TradeCommand) InitDB

func (c *TradeCommand) InitDB()

func (*TradeCommand) InitFlags

func (c *TradeCommand) InitFlags() *flag.FlagSet

func (*TradeCommand) InitTrader

func (c *TradeCommand) InitTrader(marketName string) (*trading.Trader, error)

func (*TradeCommand) LoadTraderConfig

func (c *TradeCommand) LoadTraderConfig() (*trading.TraderConfig, error)

func (*TradeCommand) Run

func (c *TradeCommand) Run(args []string) int

func (*TradeCommand) Synopsis

func (c *TradeCommand) Synopsis() string

func (*TradeCommand) TradeContinuously

func (c *TradeCommand) TradeContinuously(interval int64)

func (*TradeCommand) TradeOnce

func (c *TradeCommand) TradeOnce() error

type TradeHistoryCommand

type TradeHistoryCommand struct {
	Flags  *flag.FlagSet
	Market string
}

func (*TradeHistoryCommand) Help

func (c *TradeHistoryCommand) Help() string

func (*TradeHistoryCommand) InitFlags

func (c *TradeHistoryCommand) InitFlags() *flag.FlagSet

func (*TradeHistoryCommand) Run

func (c *TradeHistoryCommand) Run(args []string) int

func (*TradeHistoryCommand) Synopsis

func (c *TradeHistoryCommand) Synopsis() string

Jump to

Keyboard shortcuts

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