Documentation ¶
Index ¶
- func NewPosition(exchangeID models.ExchangeID, assetDistributionRate float64, ptrate float64, ...) *models.Position
- type ChartRepositoryGorm
- func (r *ChartRepositoryGorm) Create(chart *models.Chart) error
- func (r *ChartRepositoryGorm) Find(exchangeId models.ExchangeID, duration int, trading string, settlement string) (models.Chart, error)
- func (r *ChartRepositoryGorm) FindN(exchangeId models.ExchangeID, duration int, trading string, settlement string, ...) ([]models.Chart, error)
- func (r *ChartRepositoryGorm) FindRange(exchangeId models.ExchangeID, duration int, trading string, settlement string, ...) ([]models.Chart, error)
- func (r *ChartRepositoryGorm) Truncate() error
- type OrderDataStorage
- type OrderGormRepository
- type PositionStorage
- func (d *PositionStorage) FindAll() ([]models.Position, error)
- func (d *PositionStorage) FindNByTraderID(traderID uint) ([]models.Position, error)
- func (d *PositionStorage) FindNUnclosedByTraderID(traderID uint) ([]models.Position, error)
- func (d *PositionStorage) Insert(position *models.Position, traderID uint) (uint, error)
- func (t *PositionStorage) Truncate() error
- func (t *PositionStorage) UpdateEntryOrder(positionID uint, orderID uint) error
- func (t *PositionStorage) UpdateExitOrder(positionID uint, orderID uint) error
- func (t *PositionStorage) UpdateToClosed(positionID uint) error
- func (t *PositionStorage) UpdateToMade(positionID uint) error
- type TraderGormRepository
- func (t *TraderGormRepository) Find(traderID uint) (*models.TraderGorm, error)
- func (t *TraderGormRepository) FindAll() ([]*models.TraderGorm, error)
- func (t *TraderGormRepository) FindAllByStatus(status string) ([]*models.TraderGorm, error)
- func (t *TraderGormRepository) FindNByStatus(status string, limit int, offset int) ([]*models.TraderGorm, error)
- func (t *TraderGormRepository) Insert(traderConfig *models.TraderGorm) (uint, error)
- func (t *TraderGormRepository) Truncate() error
- func (t *TraderGormRepository) UpdateStatusByID(traderID uint, status string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPosition ¶
Types ¶
type ChartRepositoryGorm ¶
func (*ChartRepositoryGorm) Create ¶
func (r *ChartRepositoryGorm) Create(chart *models.Chart) error
func (*ChartRepositoryGorm) Find ¶
func (r *ChartRepositoryGorm) Find(exchangeId models.ExchangeID, duration int, trading string, settlement string) (models.Chart, error)
func (*ChartRepositoryGorm) FindN ¶
func (r *ChartRepositoryGorm) FindN(exchangeId models.ExchangeID, duration int, trading string, settlement string, num int) ([]models.Chart, error)
func (*ChartRepositoryGorm) Truncate ¶
func (r *ChartRepositoryGorm) Truncate() error
type OrderDataStorage ¶
func (*OrderDataStorage) Find ¶
func (d *OrderDataStorage) Find(orderID uint) (*models.OrderGorm, error)
func (*OrderDataStorage) FindNByPositionID ¶
func (d *OrderDataStorage) FindNByPositionID(positionID uint) ([]*models.OrderGorm, error)
func (*OrderDataStorage) Insert ¶
func (d *OrderDataStorage) Insert(orderData *models.OrderGorm) (uint, error)
func (*OrderDataStorage) Truncate ¶
func (d *OrderDataStorage) Truncate() error
type OrderGormRepository ¶
type PositionStorage ¶
func (*PositionStorage) FindNByTraderID ¶
func (d *PositionStorage) FindNByTraderID(traderID uint) ([]models.Position, error)
func (*PositionStorage) FindNUnclosedByTraderID ¶
func (d *PositionStorage) FindNUnclosedByTraderID(traderID uint) ([]models.Position, error)
func (*PositionStorage) Truncate ¶
func (t *PositionStorage) Truncate() error
func (*PositionStorage) UpdateEntryOrder ¶
func (t *PositionStorage) UpdateEntryOrder(positionID uint, orderID uint) error
func (*PositionStorage) UpdateExitOrder ¶
func (t *PositionStorage) UpdateExitOrder(positionID uint, orderID uint) error
func (*PositionStorage) UpdateToClosed ¶
func (t *PositionStorage) UpdateToClosed(positionID uint) error
func (*PositionStorage) UpdateToMade ¶
func (t *PositionStorage) UpdateToMade(positionID uint) error
type TraderGormRepository ¶
func (*TraderGormRepository) Find ¶
func (t *TraderGormRepository) Find(traderID uint) (*models.TraderGorm, error)
func (*TraderGormRepository) FindAll ¶
func (t *TraderGormRepository) FindAll() ([]*models.TraderGorm, error)
func (*TraderGormRepository) FindAllByStatus ¶
func (t *TraderGormRepository) FindAllByStatus(status string) ([]*models.TraderGorm, error)
func (*TraderGormRepository) FindNByStatus ¶
func (t *TraderGormRepository) FindNByStatus(status string, limit int, offset int) ([]*models.TraderGorm, error)
func (*TraderGormRepository) Insert ¶
func (t *TraderGormRepository) Insert(traderConfig *models.TraderGorm) (uint, error)
func (*TraderGormRepository) Truncate ¶
func (t *TraderGormRepository) Truncate() error
func (*TraderGormRepository) UpdateStatusByID ¶
func (t *TraderGormRepository) UpdateStatusByID(traderID uint, status string) error
Click to show internal directories.
Click to hide internal directories.