Files
aitrade/pkg/model/trade.go
T
kaedwen ea141eb012
Build and Push Docker Image / build-and-push (push) Failing after 1m41s
initial
2026-07-02 20:09:44 +02:00

53 lines
1.0 KiB
Go

package model
import "time"
type TradeStatus string
const (
TradePending TradeStatus = "PENDING"
TradeApproved TradeStatus = "APPROVED"
TradeRejected TradeStatus = "REJECTED"
TradeSubmitted TradeStatus = "SUBMITTED"
TradeFilled TradeStatus = "FILLED"
TradeCompleted TradeStatus = "COMPLETED"
TradeStopped TradeStatus = "STOPPED"
)
type ActionType string
const (
ActionBuy ActionType = "BUY"
ActionSell ActionType = "SELL"
)
type Trade struct {
ID int64
Symbol string
Action ActionType
Quantity int
Status TradeStatus
Confidence float64
Reasoning string
TargetPrice *float64
ExecutedPrice *float64
StopLossPrice *float64
IBOrderID *int64
CreatedAt time.Time
PendingUtil *time.Time
ApprovedAt *time.Time
RejectedAt *time.Time
SubmittedAt *time.Time
FilledAt *time.Time
CompletedAt *time.Time
RejectionReason *string
ForcedByUser bool
// Dry run fields
IsDryRun bool
DryRunPnL *float64 // P&L for this trade in dry run
}