Versions in this module Expand all Collapse all v0 v0.0.1 May 4, 2024 Changes in this version + const AccountTypeFutures + const AccountTypeIsolatedMargin + const AccountTypeMargin + const AccountTypeSpot + const AggTradeChannel + const BUSD + const Black + const BookChannel + const BookTickerChannel + const ContractInfoChannel + const DateFormat + const DepositCancelled + const DepositCredited + const DepositPending + const DepositRejected + const DepositSuccess + const DirectionDown + const DirectionNone + const DirectionUp + const ForceOrderChannel + const KLineChannel + const LiquidationOrderChannel + const MarkPriceChannel + const MarketTradeChannel + const NoClientOrderID + const PositionClosed + const PositionLong + const PositionShort + const Red + const RewardAirdrop + const RewardCommission + const RewardHolding + const RewardMining + const RewardReferralKickback + const RewardTrading + const RewardVipRebate + const SideTypeBoth + const SideTypeBuy + const SideTypeSelf + const SideTypeSell + const USDC + const USDT + var BNB = wrapper + var BTC = wrapper + var ErrInvalidBalanceType = errors.New("invalid balance type") + var ErrInvalidPriceType = errors.New("invalid price type") + var ErrInvalidSideType = errors.New("invalid side type") + var ErrNotSimpleDuration = errors.New(...) + var FiatCurrencies = []string + var Four fixedpoint.Value = fixedpoint.NewFromInt(4) + var Interval12h = Interval("12h") + var Interval15m = Interval("15m") + var Interval1d = Interval("1d") + var Interval1h = Interval("1h") + var Interval1m = Interval("1m") + var Interval1mo = Interval("1mo") + var Interval1s = Interval("1s") + var Interval1w = Interval("1w") + var Interval2h = Interval("2h") + var Interval2w = Interval("2w") + var Interval30m = Interval("30m") + var Interval3d = Interval("3d") + var Interval3m = Interval("3m") + var Interval4h = Interval("4h") + var Interval5m = Interval("5m") + var Interval6h = Interval("6h") + var QuantityDelta = fixedpoint.MustNewFromString("0.00000000001") + var SupportedExchanges = []ExchangeName + var SupportedIntervals = IntervalMap + var Three = fixedpoint.NewFromInt(3) + var Two = fixedpoint.NewFromInt(2) + var USD = wrapper + var USDFiatCurrencies = []string + func Array(a Series, limit ...int) (result []float64) + func AutoCorrelation(a Series, length int, lags ...int) float64 + func BeginningOfTheDay(t time.Time) time.Time + func Correlation(a Series, b Series, length int, method ...CorrFunc) float64 + func Covariance(a Series, b Series, length int) float64 + func CrossEntropy(a, b Series, window int) (e float64) + func Dot(a interface{}, b interface{}, limit ...int) float64 + func Entropy(a Series, window int) (e float64) + func ExchangeFooterIcon(exName ExchangeName) string + func FormatPrice(price fixedpoint.Value, tickSize fixedpoint.Value) string + func Highest(a Series, lookback int) float64 + func IsActiveOrder(o Order) bool + func IsFiatCurrency(currency string) bool + func IsUSDFiatCurrency(currency string) bool + func KLineClosePriceMapper(k KLine) float64 + func KLineHLC3Mapper(k KLine) float64 + func KLineHighPriceMapper(k KLine) float64 + func KLineLowPriceMapper(k KLine) float64 + func KLineOpenPriceMapper(k KLine) float64 + func KLinePriceVolumeMapper(k KLine) float64 + func KLineTypicalPriceMapper(k KLine) float64 + func KLineVolumeMapper(k KLine) float64 + func Kendall(a, b Series, length int) float64 + func LinearRegression(a Series, lookback int) (alpha float64, beta float64) + func Lowest(a Series, lookback int) float64 + func MapKLinePrice(kLines []KLine, f KLineValueMapper) (prices []float64) + func Mean(a Series, limit ...int) (mean float64) + func MustParseUnixTimestamp(a string) time.Time + func NewOrderError(e error, o Order) error + func NextCross(a Series, b Series, lookback int) (int, float64, bool) + func Omega(returns Series, returnThresholds ...float64) float64 + func OrdersAll(orders []Order, f func(o Order) bool) bool + func OrdersAny(orders []Order, f func(o Order) bool) bool + func Over24Hours(since time.Time) bool + func ParseInterval(input Interval) int + func ParseTimeWithFormats(strTime string, formats []string) (time.Time, error) + func Pearson(a, b Series, length int) float64 + func Predict(a Series, lookback int, offset ...int) float64 + func Reverse(a Series, limit ...int) (result floats.Slice) + func Sharpe(returns Series, periods int, annualize bool, smart bool) float64 + func SideToColorName(side SideType) string + func Skew(a Series, length int) float64 + func Sortino(returns Series, riskFreeReturns float64, periods int, annualize bool, ...) float64 + func Spearman(a, b Series, length int) float64 + func Stdev(a Series, params ...int) float64 + func Sum(a Series, limit ...int) (sum float64) + func TradeWith(symbol string, f func(trade Trade)) func(trade Trade) + func Variance(a Series, length int) float64 + type AbsResult struct + func (a *AbsResult) Index(i int) float64 + func (a *AbsResult) Last(i int) float64 + func (a *AbsResult) Length() int + type Acc = accounting.Accounting + type Account struct + AccountType AccountType + BorrowEnabled bool + CanDeposit bool + CanTrade bool + CanWithdraw bool + FuturesInfo *FuturesAccountInfo + IsolatedMarginInfo *IsolatedMarginAccountInfo + LiquidationPrice fixedpoint.Value + LiquidationRate fixedpoint.Value + MakerFeeRate fixedpoint.Value + MarginInfo *MarginAccountInfo + MarginLevel fixedpoint.Value + MarginRatio fixedpoint.Value + MarginTolerance fixedpoint.Value + TakerFeeRate fixedpoint.Value + TotalAccountValue fixedpoint.Value + TransferEnabled bool + func NewAccount() *Account + func (a *Account) AddBalance(currency string, fund fixedpoint.Value) + func (a *Account) Balance(currency string) (balance Balance, ok bool) + func (a *Account) Balances() (d BalanceMap) + func (a *Account) LockBalance(currency string, locked fixedpoint.Value) error + func (a *Account) Print() + func (a *Account) UnlockBalance(currency string, unlocked fixedpoint.Value) error + func (a *Account) UpdateBalances(balances BalanceMap) + func (a *Account) UseLockedBalance(currency string, fund fixedpoint.Value) error + type AccountType string + type AddSeriesResult struct + func (a *AddSeriesResult) Index(i int) float64 + func (a *AddSeriesResult) Last(i int) float64 + func (a *AddSeriesResult) Length() int + type Asset struct + Available fixedpoint.Value + Borrowed fixedpoint.Value + Currency string + InBTC fixedpoint.Value + InUSD fixedpoint.Value + Interest fixedpoint.Value + Locked fixedpoint.Value + NetAsset fixedpoint.Value + PriceInUSD fixedpoint.Value + Time time.Time + Total fixedpoint.Value + type AssetMap map[string]Asset + func (m AssetMap) InUSD() (total fixedpoint.Value) + func (m AssetMap) PlainText() (o string) + func (m AssetMap) SlackAttachment() slack.Attachment + func (m AssetMap) Slice() (assets []Asset) + type BacktestStream struct + func (s *BacktestStream) Close() error + func (s *BacktestStream) Connect(ctx context.Context) error + type Balance struct + Available fixedpoint.Value + Borrowed fixedpoint.Value + Currency string + Interest fixedpoint.Value + Locked fixedpoint.Value + MaxWithdrawAmount fixedpoint.Value + NetAsset fixedpoint.Value + func (b Balance) Add(b2 Balance) Balance + func (b Balance) Debt() fixedpoint.Value + func (b Balance) Net() fixedpoint.Value + func (b Balance) String() (o string) + func (b Balance) Total() fixedpoint.Value + func (b Balance) ValueString() (o string) + type BalanceMap map[string]Balance + func (m BalanceMap) Add(bm BalanceMap) BalanceMap + func (m BalanceMap) Assets(prices PriceMap, priceTime time.Time) AssetMap + func (m BalanceMap) Copy() (d BalanceMap) + func (m BalanceMap) Currencies() (currencies []string) + func (m BalanceMap) Debts() BalanceMap + func (m BalanceMap) NotZero() BalanceMap + func (m BalanceMap) Print() + func (m BalanceMap) SlackAttachment() slack.Attachment + func (m BalanceMap) String() string + type BalanceSnapshot struct + Balances BalanceMap + Session string + Time time.Time + func (m BalanceSnapshot) CsvHeader() []string + func (m BalanceSnapshot) CsvRecords() [][]string + type BalanceType string + const BalanceTypeAvailable + const BalanceTypeBorrowed + const BalanceTypeDebt + const BalanceTypeInterest + const BalanceTypeLocked + const BalanceTypeNet + const BalanceTypeTotal + func ParseBalanceType(s string) (b BalanceType, err error) + func (b *BalanceType) UnmarshalJSON(data []byte) error + func (b BalanceType) Map(balance Balance) fixedpoint.Value + type BeforeConnect func(ctx context.Context) error + type BollingerSetting struct + BandWidth float64 + type BookSignal struct + Time time.Time + Type BookSignalType + type BookSignalType int + const BookSignalSnapshot + const BookSignalUpdate + type BookTicker struct + Buy fixedpoint.Value + BuySize fixedpoint.Value + Sell fixedpoint.Value + SellSize fixedpoint.Value + Symbol string + func (b BookTicker) String() string + type BoolSeries interface + Index func(int) bool + Last func() bool + Length func() int + func CrossOver(a Series, b Series) BoolSeries + func CrossUnder(a Series, b Series) BoolSeries + type CancelReplaceModeType string + var AllowFailure CancelReplaceModeType = "ALLOW_FAILURE" + var StopOnFailure CancelReplaceModeType = "STOP_ON_FAILURE" + type Canvas struct + Interval Interval + func NewCanvas(title string, intervals ...Interval) *Canvas + func (canvas *Canvas) Plot(tag string, a Series, endTime Time, length int, intervals ...Interval) + func (canvas *Canvas) PlotRaw(tag string, a Series, length int) + type ChangeResult struct + func (c *ChangeResult) Index(i int) float64 + func (c *ChangeResult) Last(i int) float64 + func (c *ChangeResult) Length() int + type Channel string + type Color bool + type CorrFunc func(Series, Series, int) float64 + type CrossResult struct + func (c *CrossResult) Index(i int) bool + func (c *CrossResult) Last() bool + func (c *CrossResult) Length() int + type CsvFormatter interface + CsvHeader func() []string + CsvRecords func() [][]string + type CustomIntervalProvider interface + IsSupportedInterval func(interval Interval) bool + SupportedInterval func() map[Interval]int + type Deposit struct + Address string + AddressTag string + Amount fixedpoint.Value + Asset string + Confirmation string + Exchange ExchangeName + GID int64 + Status DepositStatus + Time Time + TransactionID string + UnlockConfirm int + func (d Deposit) EffectiveTime() time.Time + func (d Deposit) GetCurrentConfirmation() (current int, required int) + func (d Deposit) String() (o string) + type DepositStatus string + type Depth string + const DepthLevel1 + const DepthLevel10 + const DepthLevel15 + const DepthLevel20 + const DepthLevel200 + const DepthLevel400 + const DepthLevel5 + const DepthLevel50 + const DepthLevelFull + const DepthLevelMedium + type Direction int + type Dispatcher func(e interface{}) + type DivSeriesResult struct + func (a *DivSeriesResult) Index(i int) float64 + func (a *DivSeriesResult) Last(i int) float64 + func (a *DivSeriesResult) Length() int + type Duration time.Duration + func (d *Duration) Duration() time.Duration + func (d *Duration) UnmarshalJSON(data []byte) error + type EndpointCreator func(ctx context.Context) (string, error) + type Exchange interface + type ExchangeAccountService interface + QueryAccount func(ctx context.Context) (*Account, error) + QueryAccountBalances func(ctx context.Context) (BalanceMap, error) + type ExchangeAmountFeeProtect interface + SetModifyOrderAmountForFee func(ExchangeFee) + type ExchangeBasic = Exchange + type ExchangeDefaultFeeRates interface + DefaultFeeRates func() ExchangeFee + type ExchangeFee struct + MakerFeeRate fixedpoint.Value + TakerFeeRate fixedpoint.Value + type ExchangeMarketDataService interface + NewStream func() Stream + QueryKLines func(ctx context.Context, symbol string, interval Interval, ...) ([]KLine, error) + QueryMarkets func(ctx context.Context) (MarketMap, error) + QueryTicker func(ctx context.Context, symbol string) (*Ticker, error) + QueryTickers func(ctx context.Context, symbol ...string) (map[string]Ticker, error) + type ExchangeMinimal interface + Name func() ExchangeName + PlatformFeeCurrency func() string + type ExchangeName string + const ExchangeBacktest + const ExchangeBinance + const ExchangeBitget + const ExchangeBybit + const ExchangeKucoin + const ExchangeMax + const ExchangeOKEx + func ValidExchangeName(a string) (ExchangeName, error) + func (n *ExchangeName) UnmarshalJSON(data []byte) error + func (n *ExchangeName) Value() (driver.Value, error) + func (n ExchangeName) IsValid() bool + func (n ExchangeName) String() string + type ExchangeOrderQueryService interface + QueryOrder func(ctx context.Context, q OrderQuery) (*Order, error) + QueryOrderTrades func(ctx context.Context, q OrderQuery) ([]Trade, error) + type ExchangePublic interface + type ExchangeRewardService interface + QueryRewards func(ctx context.Context, startTime time.Time) ([]Reward, error) + type ExchangeTradeHistoryService interface + QueryClosedOrders func(ctx context.Context, symbol string, since, until time.Time, lastOrderID uint64) (orders []Order, err error) + QueryTrades func(ctx context.Context, symbol string, options *TradeQueryOptions) ([]Trade, error) + type ExchangeTradeService interface + CancelOrders func(ctx context.Context, orders ...Order) error + QueryOpenOrders func(ctx context.Context, symbol string) (orders []Order, err error) + SubmitOrder func(ctx context.Context, order SubmitOrder) (createdOrder *Order, err error) + type ExchangeTransferService interface + QueryDepositHistory func(ctx context.Context, asset string, since, until time.Time) (allDeposits []Deposit, err error) + QueryWithdrawHistory func(ctx context.Context, asset string, since, until time.Time) (allWithdraws []Withdraw, err error) + type ExchangeWithdrawalService interface + Withdraw func(ctx context.Context, asset string, amount fixedpoint.Value, address string, ...) error + type FilterResult struct + func (f *FilterResult) Index(j int) float64 + func (f *FilterResult) Last(j int) float64 + func (f *FilterResult) Length() int + type Float64Calculator interface + Calculate func(x float64) float64 + PushAndEmit func(x float64) + type Float64Indicator interface + Last func(i int) float64 + type Float64Series struct + Slice floats.Slice + func NewFloat64Series(v ...float64) *Float64Series + func (f *Float64Series) AddSubscriber(fn func(v float64)) + func (f *Float64Series) Bind(source Float64Source, target Float64Calculator) + func (f *Float64Series) Index(i int) float64 + func (f *Float64Series) Last(i int) float64 + func (f *Float64Series) Length() int + func (f *Float64Series) Push(x float64) + func (f *Float64Series) PushAndEmit(x float64) + func (f *Float64Series) Subscribe(source Float64Source, c func(x float64)) + type Float64Source interface + OnUpdate func(f func(v float64)) + type Float64Subscription interface + AddSubscriber func(f func(v float64)) + type Float64Truncator interface + Truncate func() + type Float64Updater struct + func (F *Float64Updater) EmitUpdate(v float64) + func (F *Float64Updater) OnUpdate(cb func(v float64)) + type FundingRate struct + FundingRate fixedpoint.Value + FundingTime time.Time + Time time.Time + type FuturesAccountInfo struct + Assets FuturesAssetMap + Positions FuturesPositionMap + TotalInitialMargin fixedpoint.Value + TotalMaintMargin fixedpoint.Value + TotalMarginBalance fixedpoint.Value + TotalOpenOrderInitialMargin fixedpoint.Value + TotalPositionInitialMargin fixedpoint.Value + TotalUnrealizedProfit fixedpoint.Value + TotalWalletBalance fixedpoint.Value + UpdateTime int64 + type FuturesAssetMap map[string]FuturesUserAsset + type FuturesExchange interface + GetFuturesSettings func() FuturesSettings + UseFutures func() + UseIsolatedFutures func(symbol string) + type FuturesPosition struct + ApproximateAverageCost fixedpoint.Value + AverageCost fixedpoint.Value + Base fixedpoint.Value + BaseCurrency string + ExchangeFeeRates map[ExchangeName]ExchangeFee + FeeRate *ExchangeFee + Isolated bool + Market Market + PositionRisk *PositionRisk + Quote fixedpoint.Value + QuoteCurrency string + Symbol string + UpdateTime int64 + type FuturesPositionMap map[string]FuturesPosition + type FuturesSettings struct + IsFutures bool + IsIsolatedFutures bool + IsolatedFuturesSymbol string + func (s *FuturesSettings) UseFutures() + func (s *FuturesSettings) UseIsolatedFutures(symbol string) + func (s FuturesSettings) GetFuturesSettings() FuturesSettings + type FuturesUserAsset struct + Asset string + InitialMargin fixedpoint.Value + MaintMargin fixedpoint.Value + MarginBalance fixedpoint.Value + MaxWithdrawAmount fixedpoint.Value + OpenOrderInitialMargin fixedpoint.Value + PositionInitialMargin fixedpoint.Value + UnrealizedProfit fixedpoint.Value + WalletBalance fixedpoint.Value + type HeartBeat func(conn *websocket.Conn) error + type HeikinAshiStream struct + LastOrigin map[string]map[Interval]*KLine + func (s *HeikinAshiStream) EmitKLine(kline KLine) + func (s *HeikinAshiStream) EmitKLineClosed(kline KLine) + type InstanceIDProvider interface + InstanceID func() string + type Interval string + func (i *Interval) UnmarshalJSON(b []byte) (err error) + func (i Interval) Duration() time.Duration + func (i Interval) Milliseconds() int + func (i Interval) Minutes() int + func (i Interval) Seconds() int + func (i Interval) String() string + type IntervalMap map[Interval]int + func (m IntervalMap) Slice() (slice IntervalSlice) + type IntervalProfitCollector struct + Interval Interval + Profits *floats.Slice + Timestamp *floats.Slice + func NewIntervalProfitCollector(i Interval, startTime time.Time) *IntervalProfitCollector + func (s *IntervalProfitCollector) GetNonProfitableIntervals() (result []ProfitReport) + func (s *IntervalProfitCollector) GetNumOfNonProfitableIntervals() (nonprofit int) + func (s *IntervalProfitCollector) GetNumOfProfitableIntervals() (profit int) + func (s *IntervalProfitCollector) GetOmega() float64 + func (s *IntervalProfitCollector) GetProfitableIntervals() (result []ProfitReport) + func (s *IntervalProfitCollector) GetSharpe() float64 + func (s *IntervalProfitCollector) GetSortino() float64 + func (s *IntervalProfitCollector) Update(profit *Profit) + func (s IntervalProfitCollector) MarshalYAML() (interface{}, error) + type IntervalSlice []Interval + func (s IntervalSlice) Sort() + func (s IntervalSlice) StringSlice() (slice []string) + type IntervalWindow struct + Interval Interval + RightWindow *int + Window int + func (iw IntervalWindow) String() string + type IntervalWindowBandWidth struct + BandWidth float64 + type IsolatedMarginAccount struct + Assets IsolatedMarginAssetMap + TotalAssetOfBTC fixedpoint.Value + TotalLiabilityOfBTC fixedpoint.Value + TotalNetAssetOfBTC fixedpoint.Value + type IsolatedMarginAccountInfo struct + Assets IsolatedMarginAssetMap + TotalAssetOfBTC fixedpoint.Value + TotalLiabilityOfBTC fixedpoint.Value + TotalNetAssetOfBTC fixedpoint.Value + type IsolatedMarginAsset struct + BaseAsset IsolatedUserAsset + IndexPrice fixedpoint.Value + IsolatedCreated bool + LiquidatePrice fixedpoint.Value + LiquidateRate fixedpoint.Value + MarginLevel fixedpoint.Value + MarginLevelStatus string + MarginRatio fixedpoint.Value + QuoteAsset IsolatedUserAsset + Symbol string + TradeEnabled bool + type IsolatedMarginAssetMap map[string]IsolatedMarginAsset + type IsolatedUserAsset struct + Asset string + BorrowEnabled bool + Borrowed fixedpoint.Value + Free fixedpoint.Value + Interest fixedpoint.Value + Locked fixedpoint.Value + NetAsset fixedpoint.Value + NetAssetOfBtc fixedpoint.Value + RepayEnabled bool + TotalAsset fixedpoint.Value + type JsonArr []JsonStruct + func (a JsonArr) Len() int + func (a JsonArr) Less(i, j int) bool + func (a JsonArr) Swap(i, j int) + type JsonStruct struct + Json string + Key string + Type string + Value interface{} + type KLine struct + Close fixedpoint.Value + Closed bool + EndTime Time + Exchange ExchangeName + GID uint64 + High fixedpoint.Value + Interval Interval + LastTradeID uint64 + Low fixedpoint.Value + NumberOfTrades uint64 + Open fixedpoint.Value + QuoteVolume fixedpoint.Value + StartTime Time + Symbol string + TakerBuyBaseAssetVolume fixedpoint.Value + TakerBuyQuoteAssetVolume fixedpoint.Value + Volume fixedpoint.Value + func SortKLinesAscending(klines []KLine) []KLine + func (k *KLine) BounceDown() bool + func (k *KLine) BounceUp() bool + func (k *KLine) Color() string + func (k *KLine) Direction() Direction + func (k *KLine) GetAmplification() fixedpoint.Value + func (k *KLine) GetBody() fixedpoint.Value + func (k *KLine) GetChange() fixedpoint.Value + func (k *KLine) GetClose() fixedpoint.Value + func (k *KLine) GetEndTime() Time + func (k *KLine) GetHigh() fixedpoint.Value + func (k *KLine) GetInterval() Interval + func (k *KLine) GetLow() fixedpoint.Value + func (k *KLine) GetLowerShadowHeight() fixedpoint.Value + func (k *KLine) GetLowerShadowRatio() fixedpoint.Value + func (k *KLine) GetMaxChange() fixedpoint.Value + func (k *KLine) GetOpen() fixedpoint.Value + func (k *KLine) GetStartTime() Time + func (k *KLine) GetThickness() fixedpoint.Value + func (k *KLine) GetUpperShadowHeight() fixedpoint.Value + func (k *KLine) GetUpperShadowRatio() fixedpoint.Value + func (k *KLine) Merge(o *KLine) + func (k *KLine) Mid() fixedpoint.Value + func (k *KLine) PlainText() string + func (k *KLine) Set(o *KLine) + func (k *KLine) SlackAttachment() slack.Attachment + func (k *KLine) String() string + type KLineCallback func(k KLine) + func KLineWith(symbol string, interval Interval, callback KLineCallback) KLineCallback + type KLineOrWindow interface + BounceDown func() bool + BounceUp func() bool + Direction func() Direction + GetChange func() fixedpoint.Value + GetClose func() fixedpoint.Value + GetHigh func() fixedpoint.Value + GetInterval func() string + GetLow func() fixedpoint.Value + GetLowerShadowRatio func() fixedpoint.Value + GetMaxChange func() fixedpoint.Value + GetOpen func() fixedpoint.Value + GetThickness func() fixedpoint.Value + GetUpperShadowRatio func() fixedpoint.Value + Mid func() fixedpoint.Value + SlackAttachment func() slack.Attachment + type KLineQueryOptions struct + EndTime *time.Time + Limit int + StartTime *time.Time + type KLineSeries struct + func (k *KLineSeries) Index(i int) float64 + func (k *KLineSeries) Last(i int) float64 + func (k *KLineSeries) Length() int + type KLineValueMapper func(k KLine) float64 + type KLineWindow []KLine + func (k *KLineWindow) Add(line KLine) + func (k *KLineWindow) Close() Series + func (k *KLineWindow) High() Series + func (k *KLineWindow) Low() Series + func (k *KLineWindow) Open() Series + func (k *KLineWindow) Truncate(size int) + func (k *KLineWindow) Volume() Series + func (k KLineWindow) AllDrop() bool + func (k KLineWindow) AllRise() bool + func (k KLineWindow) BounceDown() bool + func (k KLineWindow) BounceUp() bool + func (k KLineWindow) Color() string + func (k KLineWindow) First() KLine + func (k KLineWindow) GetAmplification() fixedpoint.Value + func (k KLineWindow) GetBody() fixedpoint.Value + func (k KLineWindow) GetChange() fixedpoint.Value + func (k KLineWindow) GetClose() fixedpoint.Value + func (k KLineWindow) GetHigh() fixedpoint.Value + func (k KLineWindow) GetInterval() Interval + func (k KLineWindow) GetLow() fixedpoint.Value + func (k KLineWindow) GetLowerShadowHeight() fixedpoint.Value + func (k KLineWindow) GetLowerShadowRatio() fixedpoint.Value + func (k KLineWindow) GetMaxChange() fixedpoint.Value + func (k KLineWindow) GetOpen() fixedpoint.Value + func (k KLineWindow) GetThickness() fixedpoint.Value + func (k KLineWindow) GetTrend() int + func (k KLineWindow) GetUpperShadowHeight() fixedpoint.Value + func (k KLineWindow) GetUpperShadowRatio() fixedpoint.Value + func (k KLineWindow) Last() KLine + func (k KLineWindow) Len() int + func (k KLineWindow) Mid() fixedpoint.Value + func (k KLineWindow) ReduceClose() fixedpoint.Value + func (k KLineWindow) SlackAttachment() slack.Attachment + func (k KLineWindow) Tail(size int) KLineWindow + func (k KLineWindow) Take(size int) KLineWindow + type KValueType int + type LiquidationInfo struct + AveragePrice fixedpoint.Value + OrderStatus OrderStatus + OrderType OrderType + Price fixedpoint.Value + Quantity fixedpoint.Value + Side SideType + Symbol string + TimeInForce TimeInForce + TradeTime Time + type LogisticRegressionModel struct + Gradient float64 + LearningRate float64 + Weight []float64 + func LogisticRegression(x []Series, y Series, lookback, iterations int, learningRate float64) *LogisticRegressionModel + func (l *LogisticRegressionModel) Predict(x []float64) float64 + type LooseFormatTime time.Time + func ParseLooseFormatTime(s string) (LooseFormatTime, error) + func (t *LooseFormatTime) UnmarshalJSON(data []byte) error + func (t *LooseFormatTime) UnmarshalYAML(unmarshal func(interface{}) error) error + func (t LooseFormatTime) MarshalJSON() ([]byte, error) + func (t LooseFormatTime) Time() time.Time + type MarginAccount struct + BorrowEnabled bool + MarginLevel fixedpoint.Value + TotalAssetOfBTC fixedpoint.Value + TotalLiabilityOfBTC fixedpoint.Value + TotalNetAssetOfBTC fixedpoint.Value + TradeEnabled bool + TransferEnabled bool + UserAssets []MarginUserAsset + type MarginAccountInfo struct + Assets MarginAssetMap + BorrowEnabled bool + MarginLevel fixedpoint.Value + TotalAssetOfBTC fixedpoint.Value + TotalLiabilityOfBTC fixedpoint.Value + TotalNetAssetOfBTC fixedpoint.Value + TradeEnabled bool + TransferEnabled bool + type MarginAssetMap map[string]MarginUserAsset + type MarginBorrowRepayService interface + BorrowMarginAsset func(ctx context.Context, asset string, amount fixedpoint.Value) error + QueryMarginAssetMaxBorrowable func(ctx context.Context, asset string) (amount fixedpoint.Value, err error) + RepayMarginAsset func(ctx context.Context, asset string, amount fixedpoint.Value) error + type MarginExchange interface + GetMarginSettings func() MarginSettings + UseIsolatedMargin func(symbol string) + UseMargin func() + type MarginHistoryService interface + QueryInterestHistory func(ctx context.Context, asset string, startTime, endTime *time.Time) ([]MarginInterest, error) + QueryLiquidationHistory func(ctx context.Context, startTime, endTime *time.Time) ([]MarginLiquidation, error) + QueryLoanHistory func(ctx context.Context, asset string, startTime, endTime *time.Time) ([]MarginLoan, error) + QueryRepayHistory func(ctx context.Context, asset string, startTime, endTime *time.Time) ([]MarginRepay, error) + type MarginInterest struct + Asset string + Exchange ExchangeName + GID uint64 + Interest fixedpoint.Value + InterestRate fixedpoint.Value + IsolatedSymbol string + Principle fixedpoint.Value + Time Time + type MarginLiquidation struct + AveragePrice fixedpoint.Value + Exchange ExchangeName + ExecutedQuantity fixedpoint.Value + GID uint64 + IsIsolated bool + OrderID uint64 + Price fixedpoint.Value + Quantity fixedpoint.Value + Side SideType + Symbol string + TimeInForce TimeInForce + UpdatedTime Time + type MarginLoan struct + Asset string + Exchange ExchangeName + GID uint64 + IsolatedSymbol string + Principle fixedpoint.Value + Time Time + TransactionID uint64 + type MarginOrderSideEffectType string + var SideEffectTypeAutoRepay MarginOrderSideEffectType = "AUTO_REPAY" + var SideEffectTypeMarginBuy MarginOrderSideEffectType = "MARGIN_BUY" + var SideEffectTypeNoSideEffect MarginOrderSideEffectType = "NO_SIDE_EFFECT" + func (t *MarginOrderSideEffectType) UnmarshalJSON(data []byte) error + type MarginRepay struct + Asset string + Exchange ExchangeName + GID uint64 + IsolatedSymbol string + Principle fixedpoint.Value + Time Time + TransactionID uint64 + type MarginSettings struct + IsIsolatedMargin bool + IsMargin bool + IsolatedMarginSymbol string + func (e *MarginSettings) GetMarginSettings() MarginSettings + func (e *MarginSettings) UseIsolatedMargin(symbol string) + func (e *MarginSettings) UseMargin() + type MarginUserAsset struct + Asset string + Borrowed fixedpoint.Value + Free fixedpoint.Value + Interest fixedpoint.Value + Locked fixedpoint.Value + NetAsset fixedpoint.Value + type Market struct + BaseCurrency string + ContractType string + Exchange ExchangeName + LocalSymbol string + MaxPrice fixedpoint.Value + MaxQuantity fixedpoint.Value + MinAmount fixedpoint.Value + MinNotional fixedpoint.Value + MinPrice fixedpoint.Value + MinQuantity fixedpoint.Value + PricePrecision int + QuoteCurrency string + StepSize fixedpoint.Value + Symbol string + TickSize fixedpoint.Value + VolumePrecision int + func (m Market) AdjustQuantityByMinNotional(quantity, currentPrice fixedpoint.Value) fixedpoint.Value + func (m Market) AdjustQuantityByMinQuantity(quantity fixedpoint.Value) fixedpoint.Value + func (m Market) BaseCurrencyFormatter() *accounting.Accounting + func (m Market) CanonicalizeVolume(val fixedpoint.Value) float64 + func (m Market) FormatPrice(val fixedpoint.Value) string + func (m Market) FormatPriceCurrency(val fixedpoint.Value) string + func (m Market) FormatQuantity(val fixedpoint.Value) string + func (m Market) FormatVolume(val fixedpoint.Value) string + func (m Market) GreaterThanMinimalOrderQuantity(side SideType, price, available fixedpoint.Value) (fixedpoint.Value, bool) + func (m Market) IsDustQuantity(quantity, price fixedpoint.Value) bool + func (m Market) QuoteCurrencyFormatter() *accounting.Accounting + func (m Market) RoundDownQuantityByPrecision(quantity fixedpoint.Value) fixedpoint.Value + func (m Market) RoundUpQuantityByPrecision(quantity fixedpoint.Value) fixedpoint.Value + func (m Market) TruncatePrice(price fixedpoint.Value) fixedpoint.Value + func (m Market) TruncateQuantity(quantity fixedpoint.Value) fixedpoint.Value + func (m Market) TruncateQuoteQuantity(quantity fixedpoint.Value) fixedpoint.Value + type MarketMap map[string]Market + func (m MarketMap) Add(market Market) + func (m MarketMap) Has(symbol string) bool + type MillisecondTimestamp time.Time + func MustParseMillisecondTimestamp(a string) MillisecondTimestamp + func NewMillisecondTimestampFromInt(i int64) MillisecondTimestamp + func (t *MillisecondTimestamp) UnmarshalJSON(data []byte) error + func (t MillisecondTimestamp) String() string + func (t MillisecondTimestamp) Time() time.Time + type MinusSeriesResult struct + func (a *MinusSeriesResult) Index(i int) float64 + func (a *MinusSeriesResult) Last(i int) float64 + func (a *MinusSeriesResult) Length() int + type MulSeriesResult struct + func (a *MulSeriesResult) Index(i int) float64 + func (a *MulSeriesResult) Last(i int) float64 + func (a *MulSeriesResult) Length() int + type MutexOrderBook struct + Symbol string + func NewMutexOrderBook(symbol string) *MutexOrderBook + func (b *MutexOrderBook) BestAsk() (pv PriceVolume, ok bool) + func (b *MutexOrderBook) BestBid() (pv PriceVolume, ok bool) + func (b *MutexOrderBook) BestBidAndAsk() (bid, ask PriceVolume, ok bool) + func (b *MutexOrderBook) Copy() (ob OrderBook) + func (b *MutexOrderBook) CopyDepth(depth int) (ob OrderBook) + func (b *MutexOrderBook) IsValid() (ok bool, err error) + func (b *MutexOrderBook) LastUpdateTime() time.Time + func (b *MutexOrderBook) Load(book SliceOrderBook) + func (b *MutexOrderBook) Reset() + func (b *MutexOrderBook) SideBook(sideType SideType) PriceVolumeSlice + func (b *MutexOrderBook) Update(update SliceOrderBook) + type NanosecondTimestamp time.Time + func (t *NanosecondTimestamp) UnmarshalJSON(data []byte) error + func (t NanosecondTimestamp) Time() time.Time + type NumberSeries float64 + func (a NumberSeries) Clone() NumberSeries + func (a NumberSeries) Index(_ int) float64 + func (a NumberSeries) Last(_ int) float64 + func (a NumberSeries) Length() int + type Order struct + CreationTime Time + Exchange ExchangeName + ExecutedQuantity fixedpoint.Value + GID uint64 + IsFutures bool + IsIsolated bool + IsMargin bool + IsWorking bool + OrderID uint64 + OriginalStatus string + Status OrderStatus + UUID string + UpdateTime Time + func OrdersActive(in []Order) []Order + func OrdersFilled(in []Order) (out []Order) + func OrdersFilter(in []Order, f func(o Order) bool) (out []Order) + func SortOrdersAscending(orders []Order) []Order + func SortOrdersByPrice(orders []Order, descending bool) []Order + func SortOrdersDescending(orders []Order) []Order + func SortOrdersUpdateTimeAscending(orders []Order) []Order + func (o Order) Backup() SubmitOrder + func (o Order) CsvHeader() []string + func (o Order) CsvRecords() [][]string + func (o Order) PlainText() string + func (o Order) SlackAttachment() slack.Attachment + func (o Order) String() string + type OrderBook interface + BestAsk func() (PriceVolume, bool) + BestBid func() (PriceVolume, bool) + Copy func() OrderBook + CopyDepth func(depth int) OrderBook + IsValid func() (bool, error) + LastUpdateTime func() time.Time + Load func(book SliceOrderBook) + Reset func() + SideBook func(sideType SideType) PriceVolumeSlice + Spread func() (fixedpoint.Value, bool) + Update func(book SliceOrderBook) + type OrderError struct + func (e *OrderError) Error() string + func (e *OrderError) Order() Order + type OrderMap map[uint64]Order + func NewOrderMap(os ...Order) OrderMap + func (m OrderMap) Add(os ...Order) + func (m OrderMap) Backup() (orderForms []SubmitOrder) + func (m OrderMap) Canceled() OrderSlice + func (m OrderMap) Exists(orderID uint64) bool + func (m OrderMap) Filled() OrderSlice + func (m OrderMap) FindByStatus(status OrderStatus) (orders OrderSlice) + func (m OrderMap) Get(orderID uint64) (Order, bool) + func (m OrderMap) IDs() (ids []uint64) + func (m OrderMap) Lookup(f func(o Order) bool) *Order + func (m OrderMap) Orders() (orders OrderSlice) + func (m OrderMap) Remove(orderID uint64) + func (m OrderMap) Update(o Order) + type OrderQuery struct + ClientOrderID string + OrderID string + Symbol string + type OrderSlice []Order + func (s *OrderSlice) Add(o Order) + func (s OrderSlice) Map() OrderMap + func (s OrderSlice) Print() + func (s OrderSlice) SeparateBySide() (buyOrders, sellOrders []Order) + type OrderStatus string + const OrderStatusCanceled + const OrderStatusFilled + const OrderStatusNew + const OrderStatusPartiallyFilled + const OrderStatusRejected + func (o OrderStatus) Closed() bool + type OrderType string + const OrderTypeLimit + const OrderTypeLimitMaker + const OrderTypeMarket + const OrderTypeStopLimit + const OrderTypeStopMarket + type PCA struct + func (pca *PCA) Fit(x []SeriesExtend, lookback int) error + func (pca *PCA) FitTransform(x []SeriesExtend, lookback, feature int) ([]SeriesExtend, error) + func (pca *PCA) Transform(x []SeriesExtend, lookback int, features int) (result []SeriesExtend) + type Parser func(message []byte) (interface{}, error) + type PercentageChangeResult struct + func (c *PercentageChangeResult) Index(i int) float64 + func (c *PercentageChangeResult) Last(i int) float64 + func (c *PercentageChangeResult) Length() int + type PeriodProfitStats struct + EndTime time.Time + GrossLoss fixedpoint.Value + GrossProfit fixedpoint.Value + LastTradeTime time.Time + MakerVolume fixedpoint.Value + NetProfit fixedpoint.Value + PnL fixedpoint.Value + StartTime time.Time + TakerVolume fixedpoint.Value + Volume fixedpoint.Value + VolumeInQuote fixedpoint.Value + type PersistenceTTL struct + func (p *PersistenceTTL) Expiration() time.Duration + func (p *PersistenceTTL) SetTTL(ttl time.Duration) + type PlainText interface + PlainText func() string + type Position struct + AccumulatedProfit fixedpoint.Value + ApproximateAverageCost fixedpoint.Value + AverageCost fixedpoint.Value + Base fixedpoint.Value + BaseCurrency string + ChangedAt time.Time + ExchangeFeeRates map[ExchangeName]ExchangeFee + FeeRate *ExchangeFee + Market Market + OpenedAt time.Time + Quote fixedpoint.Value + QuoteCurrency string + Strategy string + StrategyInstanceID string + Symbol string + TotalFee map[string]fixedpoint.Value + func NewPosition(symbol, base, quote string) *Position + func NewPositionFromMarket(market Market) *Position + func (p *Position) AddTrade(td Trade) (profit fixedpoint.Value, netProfit fixedpoint.Value, madeProfit bool) + func (p *Position) AddTrades(trades []Trade) (fixedpoint.Value, fixedpoint.Value, bool) + func (p *Position) BindStream(stream Stream) + func (p *Position) CsvHeader() []string + func (p *Position) CsvRecords() [][]string + func (p *Position) EmitModify(baseQty fixedpoint.Value, quoteQty fixedpoint.Value, price fixedpoint.Value) + func (p *Position) GetBase() (base fixedpoint.Value) + func (p *Position) GetQuantity() fixedpoint.Value + func (p *Position) IsClosed() bool + func (p *Position) IsClosing() (c bool) + func (p *Position) IsDust(a ...fixedpoint.Value) bool + func (p *Position) IsLong() bool + func (p *Position) IsOpened(currentPrice fixedpoint.Value) bool + func (p *Position) IsShort() bool + func (p *Position) ModifyAverageCost(price fixedpoint.Value) error + func (p *Position) ModifyBase(qty fixedpoint.Value) error + func (p *Position) ModifyQuote(qty fixedpoint.Value) error + func (p *Position) NewMarketCloseOrder(percentage fixedpoint.Value) *SubmitOrder + func (p *Position) NewProfit(trade Trade, profit, netProfit fixedpoint.Value) Profit + func (p *Position) OnModify(...) + func (p *Position) PlainText() (msg string) + func (p *Position) ROI(price fixedpoint.Value) fixedpoint.Value + func (p *Position) Reset() + func (p *Position) SetClosing(c bool) bool + func (p *Position) SetExchangeFeeRate(ex ExchangeName, exchangeFee ExchangeFee) + func (p *Position) SetFeeRate(exchangeFee ExchangeFee) + func (p *Position) SlackAttachment() slack.Attachment + func (p *Position) String() string + func (p *Position) Type() PositionType + func (p *Position) UnrealizedProfit(price fixedpoint.Value) fixedpoint.Value + func (s *Position) Expiration() time.Duration + func (s *Position) SetTTL(ttl time.Duration) + type PositionMap map[string]Position + type PositionRisk struct + Leverage fixedpoint.Value + LiquidationPrice fixedpoint.Value + type PositionType string + type PremiumIndex struct + LastFundingRate fixedpoint.Value + MarkPrice fixedpoint.Value + NextFundingTime time.Time + Symbol string + Time time.Time + func (i *PremiumIndex) String() string + type PriceHeartBeat struct + func NewPriceHeartBeat(timeout time.Duration) *PriceHeartBeat + func (b *PriceHeartBeat) Last() PriceVolume + func (b *PriceHeartBeat) Update(current PriceVolume) (bool, error) + type PriceMap map[string]fixedpoint.Value + type PriceType string + const PriceTypeBuy + const PriceTypeLast + const PriceTypeMaker + const PriceTypeMid + const PriceTypeSell + const PriceTypeTaker + func ParsePriceType(s string) (p PriceType, err error) + func (p *PriceType) UnmarshalJSON(data []byte) error + func (p PriceType) Map(ticker *Ticker, side SideType) fixedpoint.Value + type PriceVolume struct + Price fixedpoint.Value + Volume fixedpoint.Value + func (p PriceVolume) Equals(b PriceVolume) bool + func (p PriceVolume) InQuote() fixedpoint.Value + func (p PriceVolume) String() string + type PriceVolumeSlice []PriceVolume + func ParsePriceVolumeSliceJSON(b []byte) (slice PriceVolumeSlice, err error) + func (slice *PriceVolumeSlice) UnmarshalJSON(b []byte) error + func (slice PriceVolumeSlice) Copy() PriceVolumeSlice + func (slice PriceVolumeSlice) CopyDepth(depth int) PriceVolumeSlice + func (slice PriceVolumeSlice) Find(price fixedpoint.Value, descending bool) (pv PriceVolume, idx int) + func (slice PriceVolumeSlice) First() (PriceVolume, bool) + func (slice PriceVolumeSlice) IndexByQuoteVolumeDepth(requiredQuoteVolume fixedpoint.Value) int + func (slice PriceVolumeSlice) IndexByVolumeDepth(requiredVolume fixedpoint.Value) int + func (slice PriceVolumeSlice) InsertAt(idx int, pv PriceVolume) PriceVolumeSlice + func (slice PriceVolumeSlice) Len() int + func (slice PriceVolumeSlice) Less(i, j int) bool + func (slice PriceVolumeSlice) Remove(price fixedpoint.Value, descending bool) PriceVolumeSlice + func (slice PriceVolumeSlice) Second() (PriceVolume, bool) + func (slice PriceVolumeSlice) SumDepth() fixedpoint.Value + func (slice PriceVolumeSlice) SumDepthInQuote() fixedpoint.Value + func (slice PriceVolumeSlice) Swap(i, j int) + func (slice PriceVolumeSlice) Trim() (pvs PriceVolumeSlice) + func (slice PriceVolumeSlice) Upsert(pv PriceVolume, descending bool) PriceVolumeSlice + type PrivateChannelSetter interface + SetPrivateChannels func(channels []string) + type PrivateChannelSymbolSetter interface + SetPrivateChannelSymbols func(symbols []string) + type Profit struct + AverageCost fixedpoint.Value + BaseCurrency string + Exchange ExchangeName + Fee fixedpoint.Value + FeeCurrency string + FeeInUSD fixedpoint.Value + IsBuyer bool + IsFutures bool + IsIsolated bool + IsMaker bool + IsMargin bool + NetProfit fixedpoint.Value + NetProfitMargin fixedpoint.Value + OrderID uint64 + PositionOpenedAt time.Time + Price fixedpoint.Value + Profit fixedpoint.Value + ProfitMargin fixedpoint.Value + Quantity fixedpoint.Value + QuoteCurrency string + QuoteQuantity fixedpoint.Value + Side SideType + Strategy string + StrategyInstanceID string + Symbol string + Trade *Trade + TradeID uint64 + TradedAt time.Time + func (p *Profit) PlainText() string + func (p *Profit) SlackAttachment() slack.Attachment + type ProfitReport struct + Interval Interval + Profit float64 + StartTime time.Time + func (s ProfitReport) String() string + type ProfitStats struct + AccumulatedGrossLoss fixedpoint.Value + AccumulatedGrossProfit fixedpoint.Value + AccumulatedNetProfit fixedpoint.Value + AccumulatedPnL fixedpoint.Value + AccumulatedSince int64 + AccumulatedVolume fixedpoint.Value + BaseCurrency string + QuoteCurrency string + Symbol string + TodayGrossLoss fixedpoint.Value + TodayGrossProfit fixedpoint.Value + TodayNetProfit fixedpoint.Value + TodayPnL fixedpoint.Value + TodaySince int64 + func NewProfitStats(market Market) *ProfitStats + func (s *ProfitStats) AddProfit(profit Profit) + func (s *ProfitStats) AddTrade(trade Trade) + func (s *ProfitStats) Init(market Market) + func (s *ProfitStats) IsOver24Hours() bool + func (s *ProfitStats) PlainText() string + func (s *ProfitStats) ResetToday(t time.Time) + func (s *ProfitStats) SlackAttachment() slack.Attachment + type Queue struct + func NewQueue(size int) *Queue + func (inc *Queue) Clone() *Queue + func (inc *Queue) Index(i int) float64 + func (inc *Queue) Last(i int) float64 + func (inc *Queue) Length() int + func (inc *Queue) Update(v float64) + type RBNode struct + func NewNil() *RBNode + type RBTOrderBook struct + Asks *RBTree + Bids *RBTree + Symbol string + func NewRBOrderBook(symbol string) *RBTOrderBook + func (b *RBTOrderBook) BestAsk() (PriceVolume, bool) + func (b *RBTOrderBook) BestBid() (PriceVolume, bool) + func (b *RBTOrderBook) Copy() OrderBook + func (b *RBTOrderBook) CopyDepth(limit int) OrderBook + func (b *RBTOrderBook) EmitLoad(book *RBTOrderBook) + func (b *RBTOrderBook) EmitUpdate(book *RBTOrderBook) + func (b *RBTOrderBook) IsValid() (bool, error) + func (b *RBTOrderBook) LastUpdateTime() time.Time + func (b *RBTOrderBook) Load(book SliceOrderBook) + func (b *RBTOrderBook) OnLoad(cb func(book *RBTOrderBook)) + func (b *RBTOrderBook) OnUpdate(cb func(book *RBTOrderBook)) + func (b *RBTOrderBook) Print() + func (b *RBTOrderBook) Reset() + func (b *RBTOrderBook) SideBook(sideType SideType) PriceVolumeSlice + func (b *RBTOrderBook) Spread() (fixedpoint.Value, bool) + func (b *RBTOrderBook) Update(book SliceOrderBook) + type RBTree struct + Root *RBNode + func NewRBTree() *RBTree + func (tree *RBTree) CopyInorder(limit int) *RBTree + func (tree *RBTree) CopyInorderReverse(limit int) *RBTree + func (tree *RBTree) Delete(key fixedpoint.Value) bool + func (tree *RBTree) DeleteFixup(current *RBNode) + func (tree *RBTree) Inorder(cb func(n *RBNode) bool) + func (tree *RBTree) InorderOf(current *RBNode, cb func(n *RBNode) bool) + func (tree *RBTree) InorderReverse(cb func(n *RBNode) bool) + func (tree *RBTree) InorderReverseOf(current *RBNode, cb func(n *RBNode) bool) + func (tree *RBTree) Insert(key, val fixedpoint.Value) + func (tree *RBTree) InsertFixup(current *RBNode) + func (tree *RBTree) Leftmost() *RBNode + func (tree *RBTree) LeftmostOf(current *RBNode) *RBNode + func (tree *RBTree) Postorder(cb func(n *RBNode) bool) + func (tree *RBTree) PostorderOf(current *RBNode, cb func(n *RBNode) bool) + func (tree *RBTree) Preorder(cb func(n *RBNode)) + func (tree *RBTree) PreorderOf(current *RBNode, cb func(n *RBNode)) + func (tree *RBTree) Print() + func (tree *RBTree) Rightmost() *RBNode + func (tree *RBTree) RightmostOf(current *RBNode) *RBNode + func (tree *RBTree) RotateLeft(x *RBNode) + func (tree *RBTree) RotateRight(y *RBNode) + func (tree *RBTree) Search(key fixedpoint.Value) *RBNode + func (tree *RBTree) Size() int + func (tree *RBTree) Successor(current *RBNode) *RBNode + func (tree *RBTree) Upsert(key, val fixedpoint.Value) + type Reward struct + CreatedAt Time + Currency string + Exchange ExchangeName + GID int64 + Note string + Quantity fixedpoint.Value + Spent bool + State string + Type RewardType + UUID string + func (r Reward) String() (s string) + type RewardSlice []Reward + func (s RewardSlice) Len() int + func (s RewardSlice) Swap(i, j int) + type RewardSliceByCreationTime RewardSlice + func (s RewardSliceByCreationTime) Len() int + func (s RewardSliceByCreationTime) Less(i, j int) bool + func (s RewardSliceByCreationTime) Swap(i, j int) + type RewardType string + type RollingResult struct + func Rolling(a Series, window int) *RollingResult + func (r *RollingResult) Index(i int) SeriesExtend + func (r *RollingResult) Last() SeriesExtend + func (r *RollingResult) Length() int + type Series interface + Index func(i int) float64 + Last func(i int) float64 + Length func() int + type SeriesBase struct + func (s *SeriesBase) Abs() SeriesExtend + func (s *SeriesBase) Add(b interface{}) SeriesExtend + func (s *SeriesBase) Array(limit ...int) []float64 + func (s *SeriesBase) AutoCorrelation(length int, lag ...int) float64 + func (s *SeriesBase) Change(offset ...int) SeriesExtend + func (s *SeriesBase) Correlation(b Series, length int, method ...CorrFunc) float64 + func (s *SeriesBase) Covariance(b Series, length int) float64 + func (s *SeriesBase) CrossEntropy(b Series, window int) float64 + func (s *SeriesBase) CrossOver(b Series) BoolSeries + func (s *SeriesBase) CrossUnder(b Series) BoolSeries + func (s *SeriesBase) Div(b interface{}) SeriesExtend + func (s *SeriesBase) Dot(b interface{}, limit ...int) float64 + func (s *SeriesBase) Entropy(window int) float64 + func (s *SeriesBase) Filter(b func(int, float64) bool, length int) SeriesExtend + func (s *SeriesBase) Highest(lookback int) float64 + func (s *SeriesBase) Index(i int) float64 + func (s *SeriesBase) Last(i int) float64 + func (s *SeriesBase) Length() int + func (s *SeriesBase) Lowest(lookback int) float64 + func (s *SeriesBase) Mean(limit ...int) float64 + func (s *SeriesBase) Minus(b interface{}) SeriesExtend + func (s *SeriesBase) Mul(b interface{}) SeriesExtend + func (s *SeriesBase) NextCross(b Series, lookback int) (int, float64, bool) + func (s *SeriesBase) PercentageChange(offset ...int) SeriesExtend + func (s *SeriesBase) Predict(lookback int, offset ...int) float64 + func (s *SeriesBase) Rank(length int) SeriesExtend + func (s *SeriesBase) Reverse(limit ...int) floats.Slice + func (s *SeriesBase) Rolling(window int) *RollingResult + func (s *SeriesBase) Shift(offset int) SeriesExtend + func (s *SeriesBase) Sigmoid() SeriesExtend + func (s *SeriesBase) Skew(length int) float64 + func (s *SeriesBase) Softmax(window int) SeriesExtend + func (s *SeriesBase) Stdev(params ...int) float64 + func (s *SeriesBase) Sum(limit ...int) float64 + func (s *SeriesBase) Variance(length int) float64 + type SeriesExtend interface + Abs func() SeriesExtend + Add func(b interface{}) SeriesExtend + Array func(limit ...int) (result []float64) + AutoCorrelation func(length int, lag ...int) float64 + Change func(offset ...int) SeriesExtend + Correlation func(b Series, length int, method ...CorrFunc) float64 + Covariance func(b Series, length int) float64 + CrossEntropy func(b Series, window int) float64 + CrossOver func(b Series) BoolSeries + CrossUnder func(b Series) BoolSeries + Div func(b interface{}) SeriesExtend + Dot func(b interface{}, limit ...int) float64 + Entropy func(window int) float64 + Filter func(b func(i int, value float64) bool, length int) SeriesExtend + Highest func(lookback int) float64 + Lowest func(lookback int) float64 + Mean func(limit ...int) float64 + Minus func(b interface{}) SeriesExtend + Mul func(b interface{}) SeriesExtend + NextCross func(b Series, lookback int) (int, float64, bool) + PercentageChange func(offset ...int) SeriesExtend + Predict func(lookback int, offset ...int) float64 + Rank func(length int) SeriesExtend + Reverse func(limit ...int) (result floats.Slice) + Rolling func(window int) *RollingResult + Shift func(offset int) SeriesExtend + Sigmoid func() SeriesExtend + Skew func(length int) float64 + Softmax func(window int) SeriesExtend + Stdev func(params ...int) float64 + Sum func(limit ...int) float64 + Variance func(length int) float64 + func Abs(a Series) SeriesExtend + func Add(a interface{}, b interface{}) SeriesExtend + func Change(a Series, offset ...int) SeriesExtend + func Div(a interface{}, b interface{}) SeriesExtend + func Filter(a Series, b func(i int, value float64) bool, length int) SeriesExtend + func Mul(a interface{}, b interface{}) SeriesExtend + func NewSeries(a Series) SeriesExtend + func PercentageChange(a Series, offset ...int) SeriesExtend + func Rank(a Series, length int) SeriesExtend + func Shift(a Series, offset int) SeriesExtend + func Sigmoid(a Series) SeriesExtend + func Softmax(a Series, window int) SeriesExtend + func Sub(a interface{}, b interface{}) SeriesExtend + type ShiftResult struct + func (inc *ShiftResult) Index(i int) float64 + func (inc *ShiftResult) Last(i int) float64 + func (inc *ShiftResult) Length() int + type SideType string + func StrToSideType(s string) (side SideType, err error) + func (side *SideType) UnmarshalJSON(data []byte) error + func (side SideType) Color() string + func (side SideType) Reverse() SideType + func (side SideType) String() string + type SigmoidResult struct + func (s *SigmoidResult) Index(i int) float64 + func (s *SigmoidResult) Last(i int) float64 + func (s *SigmoidResult) Length() int + type SimpleDuration struct + Duration Duration + Num int + Unit string + func ParseSimpleDuration(s string) (*SimpleDuration, error) + func (d *SimpleDuration) Interval() Interval + func (d *SimpleDuration) String() string + func (d *SimpleDuration) UnmarshalJSON(data []byte) error + type SlackAttachmentCreator interface + SlackAttachment func() slack.Attachment + type SliceOrderBook struct + Asks PriceVolumeSlice + Bids PriceVolumeSlice + LastUpdateId int64 + Symbol string + Time time.Time + func NewSliceOrderBook(symbol string) *SliceOrderBook + func (b *SliceOrderBook) BestAsk() (PriceVolume, bool) + func (b *SliceOrderBook) BestBid() (PriceVolume, bool) + func (b *SliceOrderBook) Copy() OrderBook + func (b *SliceOrderBook) CopyDepth(limit int) OrderBook + func (b *SliceOrderBook) EmitLoad(book *SliceOrderBook) + func (b *SliceOrderBook) EmitUpdate(book *SliceOrderBook) + func (b *SliceOrderBook) IsValid() (bool, error) + func (b *SliceOrderBook) LastUpdateTime() time.Time + func (b *SliceOrderBook) Load(book SliceOrderBook) + func (b *SliceOrderBook) OnLoad(cb func(book *SliceOrderBook)) + func (b *SliceOrderBook) OnUpdate(cb func(book *SliceOrderBook)) + func (b *SliceOrderBook) PriceVolumesBySide(side SideType) PriceVolumeSlice + func (b *SliceOrderBook) Print() + func (b *SliceOrderBook) Reset() + func (b *SliceOrderBook) SideBook(sideType SideType) PriceVolumeSlice + func (b *SliceOrderBook) Spread() (fixedpoint.Value, bool) + func (b *SliceOrderBook) String() string + func (b *SliceOrderBook) Update(book SliceOrderBook) + type SliceView struct + func (s *SliceView) Index(i int) float64 + func (s *SliceView) Last(i int) float64 + func (s *SliceView) Length() int + type Speed string + const SpeedHigh + const SpeedLow + const SpeedMedium + type StandardStream struct + CloseC chan struct{} + Conn *websocket.Conn + ConnCancel context.CancelFunc + ConnCtx context.Context + ConnLock sync.Mutex + FuturesPositionSnapshotCallbacks []func(futuresPositions FuturesPositionMap) + FuturesPositionUpdateCallbacks []func(futuresPositions FuturesPositionMap) + PublicOnly bool + ReconnectC chan struct{} + Subscriptions []Subscription + func NewStandardStream() StandardStream + func (s *StandardStream) Close() error + func (s *StandardStream) Connect(ctx context.Context) error + func (s *StandardStream) Dial(ctx context.Context, args ...string) (*websocket.Conn, error) + func (s *StandardStream) DialAndConnect(ctx context.Context) error + func (s *StandardStream) EmitAggTrade(trade Trade) + func (s *StandardStream) EmitAuth() + func (s *StandardStream) EmitBalanceSnapshot(balances BalanceMap) + func (s *StandardStream) EmitBalanceUpdate(balances BalanceMap) + func (s *StandardStream) EmitBookSnapshot(book SliceOrderBook) + func (s *StandardStream) EmitBookTickerUpdate(bookTicker BookTicker) + func (s *StandardStream) EmitBookUpdate(book SliceOrderBook) + func (s *StandardStream) EmitConnect() + func (s *StandardStream) EmitDisconnect() + func (s *StandardStream) EmitForceOrder(info LiquidationInfo) + func (s *StandardStream) EmitFuturesPositionSnapshot(futuresPositions FuturesPositionMap) + func (s *StandardStream) EmitFuturesPositionUpdate(futuresPositions FuturesPositionMap) + func (s *StandardStream) EmitKLine(kline KLine) + func (s *StandardStream) EmitKLineClosed(kline KLine) + func (s *StandardStream) EmitMarketTrade(trade Trade) + func (s *StandardStream) EmitOrderUpdate(order Order) + func (s *StandardStream) EmitRawMessage(raw []byte) + func (s *StandardStream) EmitStart() + func (s *StandardStream) EmitTradeUpdate(trade Trade) + func (s *StandardStream) GetPublicOnly() bool + func (s *StandardStream) GetSubscriptions() []Subscription + func (s *StandardStream) OnAggTrade(cb func(trade Trade)) + func (s *StandardStream) OnAuth(cb func()) + func (s *StandardStream) OnBalanceSnapshot(cb func(balances BalanceMap)) + func (s *StandardStream) OnBalanceUpdate(cb func(balances BalanceMap)) + func (s *StandardStream) OnBookSnapshot(cb func(book SliceOrderBook)) + func (s *StandardStream) OnBookTickerUpdate(cb func(bookTicker BookTicker)) + func (s *StandardStream) OnBookUpdate(cb func(book SliceOrderBook)) + func (s *StandardStream) OnConnect(cb func()) + func (s *StandardStream) OnDisconnect(cb func()) + func (s *StandardStream) OnForceOrder(cb func(info LiquidationInfo)) + func (s *StandardStream) OnFuturesPositionSnapshot(cb func(futuresPositions FuturesPositionMap)) + func (s *StandardStream) OnFuturesPositionUpdate(cb func(futuresPositions FuturesPositionMap)) + func (s *StandardStream) OnKLine(cb func(kline KLine)) + func (s *StandardStream) OnKLineClosed(cb func(kline KLine)) + func (s *StandardStream) OnMarketTrade(cb func(trade Trade)) + func (s *StandardStream) OnOrderUpdate(cb func(order Order)) + func (s *StandardStream) OnRawMessage(cb func(raw []byte)) + func (s *StandardStream) OnStart(cb func()) + func (s *StandardStream) OnTradeUpdate(cb func(trade Trade)) + func (s *StandardStream) Read(ctx context.Context, conn *websocket.Conn, cancel context.CancelFunc) + func (s *StandardStream) Reconnect() + func (s *StandardStream) Resubscribe(fn func(old []Subscription) (new []Subscription, err error)) error + func (s *StandardStream) SetBeforeConnect(fn BeforeConnect) + func (s *StandardStream) SetConn(ctx context.Context, conn *websocket.Conn) (context.Context, context.CancelFunc) + func (s *StandardStream) SetDispatcher(dispatcher Dispatcher) + func (s *StandardStream) SetEndpointCreator(creator EndpointCreator) + func (s *StandardStream) SetHeartBeat(fn HeartBeat) + func (s *StandardStream) SetParser(parser Parser) + func (s *StandardStream) SetPingInterval(interval time.Duration) + func (s *StandardStream) SetPublicOnly() + func (s *StandardStream) Subscribe(channel Channel, symbol string, options SubscribeOptions) + type StandardStreamEmitter interface + EmitAggTrade func(Trade) + EmitAuth func() + EmitBalanceSnapshot func(BalanceMap) + EmitBalanceUpdate func(BalanceMap) + EmitBookSnapshot func(SliceOrderBook) + EmitBookTickerUpdate func(BookTicker) + EmitBookUpdate func(SliceOrderBook) + EmitConnect func() + EmitDisconnect func() + EmitForceOrder func(LiquidationInfo) + EmitFuturesPositionSnapshot func(FuturesPositionMap) + EmitFuturesPositionUpdate func(FuturesPositionMap) + EmitKLine func(KLine) + EmitKLineClosed func(KLine) + EmitMarketTrade func(Trade) + EmitOrderUpdate func(Order) + EmitStart func() + EmitTradeUpdate func(Trade) + type StandardStreamEventHub interface + OnAggTrade func(cb func(trade Trade)) + OnAuth func(cb func()) + OnBalanceSnapshot func(cb func(balances BalanceMap)) + OnBalanceUpdate func(cb func(balances BalanceMap)) + OnBookSnapshot func(cb func(book SliceOrderBook)) + OnBookTickerUpdate func(cb func(bookTicker BookTicker)) + OnBookUpdate func(cb func(book SliceOrderBook)) + OnConnect func(cb func()) + OnDisconnect func(cb func()) + OnForceOrder func(cb func(info LiquidationInfo)) + OnFuturesPositionSnapshot func(cb func(futuresPositions FuturesPositionMap)) + OnFuturesPositionUpdate func(cb func(futuresPositions FuturesPositionMap)) + OnKLine func(cb func(kline KLine)) + OnKLineClosed func(cb func(kline KLine)) + OnMarketTrade func(cb func(trade Trade)) + OnOrderUpdate func(cb func(order Order)) + OnRawMessage func(cb func(raw []byte)) + OnStart func(cb func()) + OnTradeUpdate func(cb func(trade Trade)) + type StrInt64 int64 + func (s *StrInt64) MarshalJSON() ([]byte, error) + func (s *StrInt64) String() string + func (s *StrInt64) UnmarshalJSON(body []byte) error + type StrategyStatus string + const StrategyStatusRunning + const StrategyStatusStopped + const StrategyStatusUnknown + type Stream interface + Close func() error + Connect func(ctx context.Context) error + GetPublicOnly func() bool + GetSubscriptions func() []Subscription + Reconnect func() + Resubscribe func(func(oldSubs []Subscription) (newSubs []Subscription, err error)) error + SetPublicOnly func() + Subscribe func(channel Channel, symbol string, options SubscribeOptions) + type StreamOrderBook struct + C chan *BookSignal + func NewStreamBook(symbol string) *StreamOrderBook + func (sb *StreamOrderBook) BindStream(stream Stream) + func (sb *StreamOrderBook) EmitSnapshot(snapshot SliceOrderBook) + func (sb *StreamOrderBook) EmitUpdate(update SliceOrderBook) + func (sb *StreamOrderBook) OnSnapshot(cb func(snapshot SliceOrderBook)) + func (sb *StreamOrderBook) OnUpdate(cb func(update SliceOrderBook)) + type Stringer interface + String func() string + type SubmitOrder struct + AveragePrice fixedpoint.Value + ClientOrderID string + ClosePosition bool + GroupID uint32 + MarginSideEffect MarginOrderSideEffectType + Market Market + Price fixedpoint.Value + Quantity fixedpoint.Value + ReduceOnly bool + Side SideType + StopPrice fixedpoint.Value + Symbol string + Tag string + TimeInForce TimeInForce + Type OrderType + func (o *SubmitOrder) In() (fixedpoint.Value, string) + func (o *SubmitOrder) Out() (fixedpoint.Value, string) + func (o *SubmitOrder) PlainText() string + func (o *SubmitOrder) SlackAttachment() slack.Attachment + func (o *SubmitOrder) String() string + type SubscribeOptions struct + Depth Depth + Interval Interval + Speed Speed + func (o SubscribeOptions) String() string + type Subscription struct + Channel Channel + Options SubscribeOptions + Symbol string + type SyncGroup struct + func NewSyncGroup() SyncGroup + func (w *SyncGroup) Add(fn syncGroupFunc) + func (w *SyncGroup) Run() + func (w *SyncGroup) WaitAndClear() + type SyncOrderMap struct + func NewSyncOrderMap() *SyncOrderMap + func (m *SyncOrderMap) Add(o Order) + func (m *SyncOrderMap) AnyFilled() (order Order, ok bool) + func (m *SyncOrderMap) Backup() (orders []SubmitOrder) + func (m *SyncOrderMap) Canceled() OrderSlice + func (m *SyncOrderMap) Exists(orderID uint64) (exists bool) + func (m *SyncOrderMap) Filled() OrderSlice + func (m *SyncOrderMap) FindByStatus(status OrderStatus) OrderSlice + func (m *SyncOrderMap) Get(orderID uint64) (Order, bool) + func (m *SyncOrderMap) IDs() (ids []uint64) + func (m *SyncOrderMap) Iterate(it func(id uint64, order Order) bool) + func (m *SyncOrderMap) Len() int + func (m *SyncOrderMap) Lookup(f func(o Order) bool) *Order + func (m *SyncOrderMap) Orders() (slice OrderSlice) + func (m *SyncOrderMap) Remove(orderID uint64) (exists bool) + func (m *SyncOrderMap) Update(o Order) + type Ticker struct + Buy fixedpoint.Value + High fixedpoint.Value + Last fixedpoint.Value + Low fixedpoint.Value + Open fixedpoint.Value + Sell fixedpoint.Value + Time time.Time + Volume fixedpoint.Value + func (t *Ticker) String() string + type Time time.Time + func NewTimeFromUnix(sec int64, nsec int64) Time + func (t *Time) Scan(src interface{}) error + func (t *Time) UnmarshalJSON(data []byte) error + func (t Time) After(time2 time.Time) bool + func (t Time) Before(time2 time.Time) bool + func (t Time) Equal(time2 time.Time) bool + func (t Time) MarshalJSON() ([]byte, error) + func (t Time) String() string + func (t Time) Time() time.Time + func (t Time) Unix() int64 + func (t Time) UnixMilli() int64 + func (t Time) Value() (driver.Value, error) + type TimeInForce string + var TimeInForceFOK TimeInForce = "FOK" + var TimeInForceGTC TimeInForce = "GTC" + var TimeInForceIOC TimeInForce = "IOC" + type Timestamp time.Time + func (t *Timestamp) UnmarshalJSON(o []byte) error + func (t Timestamp) Format(layout string) string + func (t Timestamp) MarshalJSON() ([]byte, error) + func (t Timestamp) String() string + func (t Timestamp) Time() time.Time + type Trade struct + Exchange ExchangeName + Fee fixedpoint.Value + FeeCurrency string + FeeDiscounted bool + FeeProcessing bool + GID int64 + ID uint64 + IsBuyer bool + IsFutures bool + IsIsolated bool + IsMaker bool + IsMargin bool + OrderID uint64 + PnL sql.NullFloat64 + Price fixedpoint.Value + Quantity fixedpoint.Value + QuoteQuantity fixedpoint.Value + Side SideType + StrategyID sql.NullString + Symbol string + Time Time + func SortTradesAscending(trades []Trade) []Trade + func (trade Trade) CsvHeader() []string + func (trade Trade) CsvRecords() [][]string + func (trade Trade) Key() TradeKey + func (trade Trade) Liquidity() (o string) + func (trade Trade) PlainText() string + func (trade Trade) PositionChange() fixedpoint.Value + func (trade Trade) SlackAttachment() slack.Attachment + func (trade Trade) String() string + type TradeKey struct + Exchange ExchangeName + ID uint64 + Side SideType + func (k TradeKey) String() string + type TradeQueryOptions struct + EndTime *time.Time + LastTradeID uint64 + Limit int64 + StartTime *time.Time + type TradeSlice struct + Trades []Trade + func (s *TradeSlice) Append(t Trade) + func (s *TradeSlice) Copy() []Trade + func (s *TradeSlice) Reverse() + func (s *TradeSlice) Truncate(size int) + type TradeStats struct + AverageLossTrade fixedpoint.Value + AverageProfitTrade fixedpoint.Value + GrossLoss fixedpoint.Value + GrossProfit fixedpoint.Value + IntervalProfits map[Interval]*IntervalProfitCollector + LargestLossTrade fixedpoint.Value + LargestProfitTrade fixedpoint.Value + Losses []fixedpoint.Value + MaximumConsecutiveLoss fixedpoint.Value + MaximumConsecutiveLosses int + MaximumConsecutiveProfit fixedpoint.Value + MaximumConsecutiveWins int + NumOfLossTrade int + NumOfProfitTrade int + ProfitFactor fixedpoint.Value + Profits []fixedpoint.Value + Symbol string + TotalNetProfit fixedpoint.Value + WinningRatio fixedpoint.Value + func NewTradeStats(symbol string) *TradeStats + func (s *TradeStats) Add(profit *Profit) + func (s *TradeStats) BriefString() string + func (s *TradeStats) CsvHeader() []string + func (s *TradeStats) CsvRecords() [][]string + func (s *TradeStats) Recalculate() + func (s *TradeStats) SetIntervalProfitCollector(c *IntervalProfitCollector) + func (s *TradeStats) String() string + type TransferDirection int + const TransferIn + const TransferOut + type Unsubscriber interface + Unsubscribe func() + type UpdatableSeries interface + Update func(float64) + type UpdatableSeriesExtend interface + Update func(float64) + func Clone(u UpdatableSeriesExtend) UpdatableSeriesExtend + func TestUpdate(u UpdatableSeriesExtend, input float64) UpdatableSeriesExtend + type ValueMap map[string]fixedpoint.Value + func (m ValueMap) Add(n ValueMap) ValueMap + func (m ValueMap) AddScalar(x fixedpoint.Value) ValueMap + func (m ValueMap) Div(n ValueMap) ValueMap + func (m ValueMap) DivScalar(x fixedpoint.Value) ValueMap + func (m ValueMap) Eq(n ValueMap) bool + func (m ValueMap) Mul(n ValueMap) ValueMap + func (m ValueMap) MulScalar(x fixedpoint.Value) ValueMap + func (m ValueMap) Normalize() ValueMap + func (m ValueMap) Sub(n ValueMap) ValueMap + func (m ValueMap) SubScalar(x fixedpoint.Value) ValueMap + func (m ValueMap) Sum() fixedpoint.Value + type WebsocketPongEvent struct + type Withdraw struct + Address string + AddressTag string + Amount fixedpoint.Value + ApplyTime Time + Asset string + Exchange ExchangeName + GID int64 + Network string + Status string + TransactionFee fixedpoint.Value + TransactionFeeCurrency string + TransactionID string + WithdrawOrderID string + func (w Withdraw) EffectiveTime() time.Time + func (w Withdraw) String() (o string) + type WithdrawalOptions struct + AddressTag string + Network string + type ZeroAssetError struct + func NewZeroAssetError(e error) ZeroAssetError