Documentation
¶
Index ¶
- type OHLC
- func (o *OHLC) Age(now time.Time) time.Duration
- func (o *OHLC) CloseTick() tick.Tick
- func (o *OHLC) Closed() bool
- func (o *OHLC) ForceClose()
- func (o *OHLC) HasGaps() bool
- func (o *OHLC) HasPriceData() bool
- func (o *OHLC) HighTick() tick.Tick
- func (o *OHLC) LowTick() tick.Tick
- func (o *OHLC) NewPrice(price decimal.Decimal, now time.Time) bool
- func (o *OHLC) OpenTick() tick.Tick
- func (o *OHLC) PerformanceFromOpenToHighAbsolute() decimal.Decimal
- func (o *OHLC) PerformanceFromOpenToLowAbsolute() decimal.Decimal
- func (o *OHLC) PerformanceInPercentage() decimal.Decimal
- func (o *OHLC) ReversionPerformanceFromHighAbsolute() decimal.Decimal
- func (o *OHLC) Store(gormDB *gorm.DB) error
- func (o *OHLC) String() string
- func (o *OHLC) ToTicks() []tick.Tick
- func (o *OHLC) Validate() error
- func (o *OHLC) VolatilityInPercentage() decimal.Decimal
- type OHLCList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OHLC ¶
type OHLC struct { Instrument string Open decimal.Decimal `gorm:"type:decimal(13,6);"` High decimal.Decimal `gorm:"type:decimal(13,6);"` HighTime time.Time Low decimal.Decimal `gorm:"type:decimal(13,6);"` LowTime time.Time Close decimal.Decimal `gorm:"type:decimal(13,6);"` Start time.Time `gorm:"index"` End time.Time Duration time.Duration `gorm:"index"` Gaps bool // contains filtered or unexported fields }
OHLC represents a full candle
func ToHeikinAshi ¶
ToHeikinAshi calculates a Heikin Ashi candle from two OHLC candles
func (*OHLC) ForceClose ¶
func (o *OHLC) ForceClose()
func (*OHLC) HasPriceData ¶
func (*OHLC) NewPrice ¶
NewPrice handles new price data Returns true if data was considered Returns false if the candle is already closed.
func (*OHLC) PerformanceFromOpenToHighAbsolute ¶
func (*OHLC) PerformanceFromOpenToLowAbsolute ¶
func (*OHLC) PerformanceInPercentage ¶
func (*OHLC) ReversionPerformanceFromHighAbsolute ¶
func (*OHLC) ToTicks ¶
ToTicks converts the OHLC candle to 4 ticks. It ensures the correct chronological order of high and low.
func (*OHLC) VolatilityInPercentage ¶
Click to show internal directories.
Click to hide internal directories.