Documentation
¶
Index ¶
- type CandleSubscriber
- type Option
- func WithBroker(broker broker.Broker) Option
- func WithCandleSubscription(subscriber CandleSubscriber) Option
- func WithCurrencyCode(currencyCode string) Option
- func WithFeedStoredCandles(strategy strategy.Strategy) Option
- func WithPersistCandleData(persist bool) Option
- func WithPersistTickData(persist bool) Option
- func WithPositionSubscription(subscriber PositionSubscriber) Option
- func WithStrategy(strategy strategy.Strategy) Option
- type OrderSubscriber
- type PerformanceRecord
- type PositionSubscriber
- type Trader
- func (tr *Trader) GetClosedPositions() ([]broker.Position, error)
- func (tr *Trader) GetPerformanceRecord(chartHTML string) (*PerformanceRecord, error)
- func (tr *Trader) GetPerformanceRecordByID(backtestingID string) (PerformanceRecord, error)
- func (tr *Trader) GetPerformanceRecords() ([]PerformanceRecord, error)
- func (tr *Trader) ID() string
- func (tr *Trader) SavePerformanceRecord(chartHTML string) error
- func (tr *Trader) Start() error
- func (tr *Trader) Stop() error
- func (tr *Trader) Summary()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CandleSubscriber ¶
type Option ¶
type Option func(*Trader)
func WithBroker ¶
func WithCandleSubscription ¶
func WithCandleSubscription(subscriber CandleSubscriber) Option
func WithCurrencyCode ¶
func WithFeedStoredCandles ¶
func WithPersistCandleData ¶
func WithPersistTickData ¶
func WithPositionSubscription ¶
func WithPositionSubscription(subscriber PositionSubscriber) Option
func WithStrategy ¶
type OrderSubscriber ¶
type PerformanceRecord ¶
type PerformanceRecord struct { gorm.Model BacktestingID string StrategyName string Strategy string Instrument string CandleDuration time.Duration TargetInPips float64 StopLossInPips float64 PerformanceTrigger float64 TotalPerformanceInPips float64 AVGPerformanceInPips float64 MaxAggregateDrawdownInPips float64 MaxLossInPips float64 MaxLossInPercent float64 MaxWinInPercent float64 MaxWinInPips float64 TradesWinRationInPercent float64 Trades int TradesWin int TradesLoss int TradesLossLong int TradesLossShort int TradesLong int TradesShort int MaxConsecutiveTradesLoss uint MaxConcurrentPositions int GitRev string Duration string FirstTrade time.Time LastTrade time.Time AVGTradeDurationInSeconds float64 TotalExposureInPercent float64 ChartHTML string BacktestingConfigJSON string ClosedPositions []broker.Position `gorm:"-"` TotalTimeInMarket time.Duration AVGTimeInMarket time.Duration }
type PositionSubscriber ¶
type Trader ¶
type Trader struct { StartTime time.Time Instrument string TickChan chan tick.Tick MaxAggregatedDrawdownInPips decimal.Decimal sync.Mutex // contains filtered or unexported fields }
func (*Trader) GetClosedPositions ¶
func (*Trader) GetPerformanceRecord ¶
func (tr *Trader) GetPerformanceRecord(chartHTML string) (*PerformanceRecord, error)
func (*Trader) GetPerformanceRecordByID ¶
func (tr *Trader) GetPerformanceRecordByID(backtestingID string) (PerformanceRecord, error)
func (*Trader) GetPerformanceRecords ¶
func (tr *Trader) GetPerformanceRecords() ([]PerformanceRecord, error)
func (*Trader) SavePerformanceRecord ¶
Click to show internal directories.
Click to hide internal directories.