traders

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinancePaperTrader

type BinancePaperTrader struct {
	Trades trade_knife.Trades

	Wallet           float64
	BuyScoreTrigger  float64
	SellScoreTrigger float64
	CloseOnOpposite  bool
	Cross            bool
	Debug            bool
	ActiveTrade      *trade_knife.Trade
	// contains filtered or unexported fields
}

BinancePaperTrader is a Binance-Exchange-PaperTrader trade_knife.Trader

func NewBinancePaperTrader

func NewBinancePaperTrader(candleChannel trade_knife.CandleChannel, entryChannel trade_knife.EnterChannel, exitChannel trade_knife.ExitChannel, openTrades trade_knife.TradesChannel, doneTrades trade_knife.TradesChannel, wallet, buyScoreTrigger, sellScoreTrigger float64, closeOnOpposite, cross, debug bool, logger trade_knife.Logger) *BinancePaperTrader

NewBinancePaperTrader returns a pointer to fresh BinancePaperTrader's trade_knife.Trader.

func (*BinancePaperTrader) Close

func (pt *BinancePaperTrader) Close(id string, exit float64, closeCandle *trade_knife.Candle)

Close closes the chosen trade

func (*BinancePaperTrader) CloseWatcher

func (pt *BinancePaperTrader) CloseWatcher()

CloseWatcher watches for close signals and close the trade immediately.

func (*BinancePaperTrader) EntryWatcher

func (pt *BinancePaperTrader) EntryWatcher()

EntryWatcher watches for entry signals and open proper positions.

func (*BinancePaperTrader) ExitWatcher

func (pt *BinancePaperTrader) ExitWatcher()

ExitWatcher watches for exit signals and fire proper close signals.

func (*BinancePaperTrader) Open

func (pt *BinancePaperTrader) Open(currency goex.CurrencyPair, position trade_knife.PositionType, quote, entry, sl, tp float64, openCandle *trade_knife.Candle) *trade_knife.Trade

Open creates a new trade immediately.

func (*BinancePaperTrader) Start

func (pt *BinancePaperTrader) Start() trade_knife.TradeError

Start launches all watchers of the driver.

type Okex

type Okex struct {
	Trades           trade_knife.Trades
	ActiveTrade      *trade_knife.Trade
	Lever            float64
	BuyScoreTrigger  float64
	SellScoreTrigger float64
	CloseOnOpposite  bool
	Cross            bool
	Debug            bool
	Market           trade_knife.MarketType

	Api *okex.OKExSwap
	// contains filtered or unexported fields
}

Okex is an Okay-Exchange trade_knife.Trader

func NewOkex

func NewOkex(apiKey, secretKey, passphrase string, candleChannel trade_knife.CandleChannel, entryChannel trade_knife.EnterChannel, exitChannel trade_knife.ExitChannel, openTrades trade_knife.TradesChannel, doneTrades trade_knife.TradesChannel, lever, buyScoreTrigger, sellScoreTrigger float64, closeOnOpposite, cross, debug bool, logger *trade_knife.Logger) *Okex

NewOkex returns a pointer to a fresh Okex's trade_knife.Trader.

func (*Okex) Close

func (ok *Okex) Close(id, exit float64, closeCandle *trade_knife.Candle)

func (*Okex) CloseWatcher

func (ok *Okex) CloseWatcher()

func (*Okex) EntryWatcher

func (ok *Okex) EntryWatcher()

func (*Okex) ExitWatcher

func (ok *Okex) ExitWatcher()

func (*Okex) Open

func (ok *Okex) Open(id string, currency goex.CurrencyPair, position trade_knife.PositionType, quote, entry float64, sl, tp float64, openCandle *trade_knife.Candle) *trade_knife.Trade

func (*Okex) Start

func (ok *Okex) Start() trade_knife.TradeError

Jump to

Keyboard shortcuts

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