package
0.0.1
Repository: https://github.com/puper/bbgo.git
Documentation: pkg.go.dev

# Packages

Package mocks is a generated GoMock package.

# Functions

Return series that having all the elements positive.
Add two series, result[i] = a[i] + b[i].
Array extracts elements from the Series to a float64 array, following the order of Index(0..limit) if limit is given, will only take the first limit numbers (a.Index[0..limit]) otherwise will operate on all elements.
similar to pandas.Series.autocorr() function.
No description provided by the author
Difference between current value and previous, a - a[offset] offset: if not given, offset is 1.
No description provided by the author
similar to pandas.Series.corr() function.
similar to pandas.Series.cov() function with ddof=0 Compute covariance with Series.
CrossEntropy computes the cross-entropy between the two distributions.
a series cross above b series.
a series cross under b series.
Divid two series, result[i] = a[i] / b[i].
Calculate (a dot b).
Entropy computes the Shannon entropy of a distribution or the distance between two distributions.
No description provided by the author
Filter function filters Series by using a boolean function.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Calculate the average value of the series if limit is given, will only calculate the average of first limit numbers (a.Index[0..limit]) otherwise will operate on all elements.
Multiple two series, result[i] = a[i] * b[i].
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
This will make prediction using Linear Regression to get the next cross point Return (offset from latest, crossed value, could cross) offset from latest should always be positive lookback param is to use at most `lookback` points to determine linear regression functions You may also refer to excel's FORECAST function.
Determines the Omega ratio of a strategy See https://en.wikipedia.org/wiki/Omega_ratio for more details @param returns (Series): Series of profit/loss percentage every specific interval @param returnThresholds(float64): threshold for returns filtering @return Omega ratio for give return series and threshold.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ParsePriceVolumeSliceJSON tries to parse a 2 dimensional string array into a PriceVolumeSlice [["9000", "10"], ["9900", "10"], ..
No description provided by the author
No description provided by the author
No description provided by the author
Percentage change between current and a prior element, a / a[offset] - 1.
No description provided by the author
No description provided by the author
Similar to Array but in reverse order.
No description provided by the author
Sharpe: Calcluates the sharpe ratio of access returns @param returns (Series): Series of profit/loss percentage every specific interval @param periods (int): Freq.
No description provided by the author
No description provided by the author
Sigmoid returns the input values in range of -1 to 1 along the sigmoid or s-shaped curve.
similar to pandas.Series.skew() function.
SoftMax returns the input value in the range of 0 to 1 with sum of all the probabilities being equal to one.
Sortino: Calcluates the sotino ratio of access returns ROI_excess E[ROI] - ROI_risk_free sortino = ---------- = ----------------------- risk sqrt(E[ROI_drawdown^2]) @param returns (Series): Series of profit/loss percentage every specific interval @param riskFreeReturns (float): risk-free return rate of year @param periods (int): Freq.
No description provided by the author
SortOrdersAscending sorts by creation time ascending-ly.
SortOrdersByPrice sorts by creation time ascending-ly.
SortOrdersDescending sorts by creation time descending-ly.
SortOrdersAscending sorts by update time ascending-ly.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Sub two series, result[i] = a[i] - b[i].
Calculate sum of the series if limit is given, will only sum first limit numbers (a.Index[0..limit]) otherwise will sum all elements.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ContractInfoChannel is the contract info provided by the exchange.
No description provided by the author
No description provided by the author
created but can not withdraw.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
channels for futures.
No description provided by the author
OrderStatusCanceled means the order is canceled without partially filled or filled.
OrderStatusFilled means the order is fully-filled, it's an end state.
OrderStatusNew means the order is active on the orderbook without any filling.
OrderStatusPartiallyFilled means the order is partially-filled, it's an end state, the order might be canceled in the end.
OrderStatusRejected means the order is not placed successfully, it's rejected by the api.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
BID.
No description provided by the author
No description provided by the author
No description provided by the author
ASK.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SideTypeBoth is only used for the configuration context.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
USDFiatCurrencies lists the USD stable coins.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
BollingerSetting contains the bollinger indicator setting propers Interval, Window and BandWidth.
No description provided by the author
BookTicker time exists in ftx, not in binance last exists in ftx, not in binance.
No description provided by the author
No description provided by the author
The result structure that maps to the crossing result of `CrossOver` and `CrossUnder` Accessible through BoolSeries interface.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
go:generate callbackgen -type Float64Updater.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FuturesUserAsset define cross/isolated futures account asset.
No description provided by the author
No description provided by the author
IntervalWindow is used by the indicators.
No description provided by the author
IsolatedMarginAccount defines isolated user assets of margin account.
No description provided by the author
IsolatedMarginAsset defines isolated margin asset information, like margin level, liquidation price..
IsolatedUserAsset defines isolated user assets of the margin account.
No description provided by the author
KLine uses binance's kline as the standard structure.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MarginAccount is for the cross margin account.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MarginUserAsset define user assets of margin account.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PeriodProfitStats defined the profit stats for a period TODO: replace AccumulatedPnL and TodayPnL fields from the ProfitStats struct.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PriceHeartBeat is used for monitoring the price volume update.
No description provided by the author
Profit struct stores the PnL information.
No description provided by the author
No description provided by the author
Super basic Series type that simply holds the float64 data with size limit (the only difference compare to float64slice).
RBNode A red node always has black children.
go:generate callbackgen -type RBTOrderBook.
No description provided by the author
No description provided by the author
No description provided by the author
SeriesBase is a wrapper of the Series interface You can assign a data container that implements the Series interface And this SeriesBase struct provides the implemented methods for manipulating your data.
No description provided by the author
No description provided by the author
No description provided by the author
SliceOrderBook is a general order book structure which could be used for RESTful responses and websocket stream parsing go:generate callbackgen -type SliceOrderBook.
No description provided by the author
go:generate callbackgen -type StandardStream -interface.
StreamOrderBook receives streaming data from websocket connection and update the order book with mutex lock, so you can safely access it.
No description provided by the author
SubscribeOptions provides the standard stream options.
No description provided by the author
SyncGroup is essentially a wrapper around sync.WaitGroup, designed for ease of use.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TODO: Add more stats from the reference: See https://www.metatrader5.com/en/terminal/help/algotrading/testing_report.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

The interface maps to pinescript basic type `series` for bool type Access the internal historical data from the latest to the oldest Index(0) always maps to Last().
CsvFormatter is an interface used for dumping object into csv file.
No description provided by the author
go:generate mockgen -destination=mocks/mock_exchange.go -package=mocks .
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ExchangeOrderQueryService provides an interface for querying the order status via order ID or client order ID go:generate mockgen -destination=mocks/mock_exchange_order_query.go -package=mocks .
go:generate mockgen -destination=mocks/mock_exchange_public.go -package=mocks .
No description provided by the author
go:generate mockgen -destination=mocks/mock_exchange_trade_history.go -package=mocks .
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Float64Indicator is the indicators (SMA and EWMA) that we want to use are returning float64 data.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MarginBorrowRepayService provides repay and borrow actions of an crypto exchange.
No description provided by the author
MarginHistoryService provides the service of querying loan history and repay history.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The interface maps to pinescript basic type `series` Access the internal historical data from the latest to the oldest Index(0) always maps to Last().
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Color is the RB Tree color.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Duration.
No description provided by the author
ExchangeBasic is the new type for replacing the original Exchange interface.
No description provided by the author
No description provided by the author
No description provided by the author
HeartBeat keeps connection alive by sending the ping packet.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LooseFormatTime parses date time string with a wide range of formats.
No description provided by the author
MarginOrderSideEffectType define side effect type for orders.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OrderMap is used for storing orders by their order id.
No description provided by the author
No description provided by the author
OrderType define order type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SideType define side type of order.
No description provided by the author
StrategyStatus define strategy status.
No description provided by the author
Time type implements the driver value for sqlite.
No description provided by the author
Timestamp is used for parsing unix timestamp (seconds).
No description provided by the author
No description provided by the author