Documentation ¶
Index ¶
Constants ¶
View Source
const ( StyleBar = "bar" StyleScatter = "scatter" StyleLine = "line" StyleHistogram = "histogram" StyleWaterfall = "waterfall" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChartIndicator ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewStrategyController ¶
func NewStrategyController(pair string, strategy Strategy, broker service.Broker) *Controller
func (*Controller) OnCandle ¶
func (s *Controller) OnCandle(candle model.Candle)
func (*Controller) OnPartialCandle ¶
func (s *Controller) OnPartialCandle(candle model.Candle)
func (*Controller) Start ¶
func (s *Controller) Start()
type HighFrequencyStrategy ¶
type IndicatorMetric ¶
type MetricStyle ¶
type MetricStyle string
type Strategy ¶
type Strategy interface { // Timeframe is the time interval in which the strategy will be executed. eg: 1h, 1d, 1w Timeframe() string // WarmupPeriod is the necessary time to wait before executing the strategy, to load data for indicators. // This time is measured in the period specified in the `Timeframe` function. WarmupPeriod() int // Indicators will be executed for each new candle, in order to fill indicators before `OnCandle` function is called. Indicators(df *model.Dataframe) []ChartIndicator // OnCandle will be executed for each new candle, after indicators are filled, here you can do your trading logic. // OnCandle is executed after the candle close. OnCandle(df *model.Dataframe, broker service.Broker) }
Click to show internal directories.
Click to hide internal directories.