Documentation
¶
Index ¶
- type BybitRepository
- func (r *BybitRepository) CalculateTPSL(req domain.TV, value interface{}, isType string) (float64, error)
- func (r *BybitRepository) CreateOrder(req domain.TV) (string, error)
- func (r *BybitRepository) FetchOrder(req *domain.TV, orderID string) error
- func (r *BybitRepository) GetActiveOrderCount(req *domain.TV, positions *[]rest.LinearPosition) int
- func (r *BybitRepository) GetClosedOrderLast(symbol string) (*domain.BybitLinearClosedPnLResponse, error)
- func (r *BybitRepository) GetPositions(symbol string) (*[]rest.LinearPosition, error)
- func (r *BybitRepository) GetWalletInfoDeriv() (*rest.Balance, error)
- func (r *BybitRepository) GetWalletInfoUSDC() (*domain.BybitWallet, error)
- func (r *BybitRepository) Set(req domain.TV)
- type SettingRepository
- type TVRepository
- func (r *TVRepository) GetPLNullOrders(settingID uint64) (*[]domain.TVOrder, error)
- func (r *TVRepository) GetSetting(apiKey, apiSecretKey string) (*domain.Setting, error)
- func (r *TVRepository) GetSettings() ([]domain.Setting, error)
- func (r *TVRepository) SaveOrder(req domain.TV, order *domain.TVOrder) error
- func (r *TVRepository) SaveWalletHistories(histories []domain.WalletHistory) error
- func (r *TVRepository) UpdateOrder(order *domain.TVOrder) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BybitRepository ¶ added in v1.5.0
type BybitRepository struct { BaseURL string APIKey string APISecretKey string HTTPClient *http.Client Client *rest.ByBit }
func (*BybitRepository) CalculateTPSL ¶ added in v1.5.0
func (*BybitRepository) CreateOrder ¶ added in v1.5.0
func (r *BybitRepository) CreateOrder(req domain.TV) (string, error)
func (*BybitRepository) FetchOrder ¶ added in v1.7.0
func (r *BybitRepository) FetchOrder(req *domain.TV, orderID string) error
FetchOrder is set entry price
func (*BybitRepository) GetActiveOrderCount ¶ added in v1.7.2
func (r *BybitRepository) GetActiveOrderCount(req *domain.TV, positions *[]rest.LinearPosition) int
func (*BybitRepository) GetClosedOrderLast ¶ added in v1.8.0
func (r *BybitRepository) GetClosedOrderLast(symbol string) (*domain.BybitLinearClosedPnLResponse, error)
func (*BybitRepository) GetPositions ¶ added in v1.7.2
func (r *BybitRepository) GetPositions(symbol string) (*[]rest.LinearPosition, error)
GetPositions return an array of positions. This func uses deep copy if the symbol is PERP/USDC so return positions are not exactly but only used for GetActiveOrderCount
func (*BybitRepository) GetWalletInfoDeriv ¶ added in v1.7.0
func (r *BybitRepository) GetWalletInfoDeriv() (*rest.Balance, error)
func (*BybitRepository) GetWalletInfoUSDC ¶ added in v1.6.0
func (r *BybitRepository) GetWalletInfoUSDC() (*domain.BybitWallet, error)
func (*BybitRepository) Set ¶ added in v1.5.0
func (r *BybitRepository) Set(req domain.TV)
type SettingRepository ¶ added in v1.1.0
type TVRepository ¶
func (*TVRepository) GetPLNullOrders ¶ added in v1.8.0
func (r *TVRepository) GetPLNullOrders(settingID uint64) (*[]domain.TVOrder, error)
func (*TVRepository) GetSetting ¶ added in v1.7.2
func (r *TVRepository) GetSetting(apiKey, apiSecretKey string) (*domain.Setting, error)
func (*TVRepository) GetSettings ¶ added in v1.6.0
func (r *TVRepository) GetSettings() ([]domain.Setting, error)
func (*TVRepository) SaveWalletHistories ¶ added in v1.6.0
func (r *TVRepository) SaveWalletHistories(histories []domain.WalletHistory) error
func (*TVRepository) UpdateOrder ¶ added in v1.8.0
func (r *TVRepository) UpdateOrder(order *domain.TVOrder) error
Click to show internal directories.
Click to hide internal directories.