Documentation ¶
Index ¶
Constants ¶
View Source
const ( OrderStatePlaced OrderState = "ORDER_STATE_PLACED" OrderStateFilled OrderState = "ORDER_STATE_FILLED" OrderStateCancelled OrderState = "ORDER_STATE_CANCELED" OrderStateStarted OrderState = "ORDER_STATE_STARTED" OrderTypeBuy OrderType = "ORDER_TYPE_BUY" OrderTypeSell OrderType = "ORDER_TYPE_SELL" OrderTypeBuyLimit OrderType = "ORDER_TYPE_BUY_LIMIT" OrderTypeSellLimit OrderType = "ORDER_TYPE_SELL_LIMIT" OrderTypeBuyStop OrderType = "ORDER_TYPE_BUY_STOP" OrderTypeSellStop OrderType = "ORDER_TYPE_SELL_STOP" DealEntryIn DealEntry = "DEAL_ENTRY_IN" DealEntryOut DealEntry = "DEAL_ENTRY_OUT" DealReasonSL DealReason = "DEAL_REASON_SL" DealReasonTP DealReason = "DEAL_REASON_TP" DealReasonClient DealReason = "DEAL_REASON_CLIENT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) Sync ¶
func (a *Api) Sync(accountID string, req SyncRequest) (SyncResponse, error)
type DealReason ¶
type DealReason string
func (DealReason) IsStop ¶
func (r DealReason) IsStop() bool
type Mt5Order ¶
type Mt5Order struct { Symbol string Ticket string Volume float64 Type OrderType TakeProfit float64 StopLoss float64 Price float64 State OrderState }
func (Mt5Order) WithTicket ¶
type Mt5OrderHistory ¶
type Mt5OrderHistory struct { Ticket string State OrderState UpdatedAt time.Time }
func (Mt5OrderHistory) WithTicket ¶
func (m Mt5OrderHistory) WithTicket() string
type Mt5Position ¶
type Mt5Position struct { Symbol string Ticket string PositionTicket string Volume float64 TakeProfit float64 StopLoss float64 Price float64 }
func (Mt5Position) WithTicket ¶
func (m Mt5Position) WithTicket() string
type Mt5PositionHistory ¶
type Mt5PositionHistory struct { Symbol string Entry DealEntry Reason DealReason Ticket string PositionTicket string Volume float64 TakeProfit float64 StopLoss float64 Price float64 }
func (Mt5PositionHistory) ToHistory ¶
func (m Mt5PositionHistory) ToHistory() Mt5Position
func (Mt5PositionHistory) WithTicket ¶
func (m Mt5PositionHistory) WithTicket() string
type Mt5Requests ¶
type Mt5Requests interface {
WithTicket() string
}
type OrderState ¶
type OrderState string
type SyncRequest ¶
type SyncRequest struct { // for each position the program should: // 1. check if there is any empty state on State.ActivePositions ActivePositions []Mt5Position RecentInactivePositions []Mt5PositionHistory ActiveOrders []Mt5Order RecentInactiveOrders []Mt5Order }
type SyncResponse ¶
func (*SyncResponse) AddJournal ¶
func (sr *SyncResponse) AddJournal(txt string)
Click to show internal directories.
Click to hide internal directories.