models

package
v0.0.0-...-91881de Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	// User's api key and secret
	User User
	// User's Order
	Order Order
}

Bot represents a bot order

type Order

type Order struct {
	// Type of order:
	// 	MARKET requires percentage
	//	LIMIT
	//	STOP_LOSS (SL) (or in the Binance API STOP_MARKET)
	Type futures.OrderType `json:"type"`

	// Symbol of the asset
	Symbol string `json:"symbol"`

	// Side or either buy or sell
	Side futures.SideType `json:"side"`

	// Used by LIMIT and MARKET
	// Percentage of futures balance to trade. Used by LIMIT and MARKET orders.
	Percentage float64 `json:"percentage"`

	// Used by LIMIT
	// Price to buy underlying asset. Used by LIMIT orders.
	Price string `json:"price"`

	// TimeInForce
	// 	GTC - Good Till Cancel
	// 	IOC - Immediate or Cancel
	// 	FOK - Fill or Kill
	// 	GTX - Good Till Crossing (Post Only)
	TimeInForce futures.TimeInForceType `json:"timeInForce"`

	// Used by STOP_MARKET
	// StopPrice closes the position at the market price
	StopPrice string `json:"stopPrice"`
}

Order represents the Limit/Take Profit, Market, or Stop Loss orders presented in the trading signal

type User

type User struct {
	// APIKey is the user's futures api key
	APIKey string `json:"api_key"`

	// APISecret is the user's futures api secret
	APISecret string `json:"api_secret"`
}

User represents the telegram bot user and is identified by their binance futures api credentials

Jump to

Keyboard shortcuts

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