hst

package
v0.0.0-...-a52a137 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BarData

type BarData struct {
	CTM        uint64  //   0   8   current time in seconds, MQL4 datetime
	Open       float64 //   8   8   OHLCV
	High       float64 //  24   8   H
	Low        float64 //  16   8   L
	Close      float64 //  32   8   C
	Volume     uint64  //  40   8   V
	Spread     uint32  //  48   4
	RealVolume uint64  //  52   8
}

BarData wrap the bar data inside hst (60 Bytes)

func (*BarData) String

func (b *BarData) String() string

func (*BarData) Strings

func (b *BarData) Strings() []string

func (*BarData) ToBytes

func (b *BarData) ToBytes() ([]byte, error)

ToBytes convert bar data to fix bytes array

type HST401

type HST401 struct {
	// contains filtered or unexported fields
}

HST401 MT4 history data format .hst with version 401

func NewHST

func NewHST(timefame, spread uint32, instrument *instrument.Metadata, dest string) *HST401

NewHST create a HST convertor

func (*HST401) Finish

func (h *HST401) Finish() error

Finish HST file convert

func (*HST401) PackTicks

func (h *HST401) PackTicks(barTimestamp uint32, ticks []*tickdata.TickData) error

PackTicks aggregate ticks with timeframe

type Header struct {
	Version   uint32   //   0    4   HST version (401)
	Copyright [64]byte //   4   64   Copyright info
	Symbol    [12]byte //  68   12   Forex symbol
	Period    uint32   //  80    4   Symbol timeframe
	Digits    uint32   //  84    4   The amount of digits after decimal point in the symbol
	TimeSign  uint32   //  88    4   Time of sign (database creation)
	LastSync  uint32   //  92    4   Time of last synchronization
	// contains filtered or unexported fields
}

Header structure for hst version 401 (148 bytes).

func NewHeader

func NewHeader(timeframe uint32, instrument *instrument.Metadata) *Header

NewHeader for hst version 401

func (*Header) ToBytes

func (h *Header) ToBytes() ([]byte, error)

ToBytes convert header to fix bytes array

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL