Versions in this module Expand all Collapse all v0 v0.1.2 Mar 27, 2019 v0.1.1 Mar 27, 2019 Changes in this version + const VmIdle + const VmRunning + const VmStart + const VmStoping + func DayDbCacheStatus() string + func DigitFromInt(v int, ndigit int) float64 + func DigitToInt(v float64, ndigit int) int + func DukasCacheStatus() string + func GetDB() *sql.DB + func InitSimBroker(startT, endT time.Time, defFund float64) + func IsEquity(code string) int + func LoadBarFX(pair string, period Period, startD, endD julian.JulianDay) (err error) + func LoadDayBar(symbol string, period Period, startD, endD julian.JulianDay) (err error) + func NewSlice(s Series) (res []float64) + func OpenDB() (*sql.DB, error) + func RegisterBroker(name string, inf Broker) error + func RegisterStrategy(name string, inf Strategyer) error + func TickFX2Bytes(buf *TickFX) []byte + func ValidateTick(sym string) error + type BarCache struct + type Bars struct + Close []float64 + Date []timeT64 + High []float64 + Low []float64 + Open []float64 + Volume []float64 + func (b *Bars) RowString(idx int) string + func (b *Bars) String() string + type Broker interface + Balance func() float64 + CancelOrder func(oID int) error + Cash func() float64 + CloseOrder func(oID int) + Equity func() float64 + FreeMargin func() float64 + GetOrder func(oID int) *OrderType + GetOrders func() []int + GetPosition func(sym string) PositionType + GetPositions func() []PositionType + Open func(ch chan<- QuoteEvent) (Broker, error) + SendOrder func(sym string, dir OrderDirT, qty int, prc float64, stopL float64) int + Start func(c Config) error + Stop func() error + SubscribeQuotes func([]QuoteSubT) error + TimeCurrent func() DateTimeMs + type Config map[string]interface + func (c Config) GetFloat64(key string, def float64) float64 + func (c Config) GetInt(key string, def int) int + func (c Config) GetString(key string, def string) string + func (c Config) GetStrings(key string) []string + func (c Config) Put(key string, v interface{}) + type Context struct + GetBars func(sym string, period Period) (res *Bars, err error) + type DateTimeMs int64 + func JulianToDateTimeMs(jDN julian.JulianDay) DateTimeMs + func TimeToDateTimeMs(dt time.Time) DateTimeMs + func (dtMs DateTimeMs) Millisecond() int + func (dtMs DateTimeMs) String() string + func (dtMs DateTimeMs) Time() time.Time + func (dtMs DateTimeMs) Unix() int64 + type DayTA struct + Close int32 + Date julian.JulianDay + High int32 + Low int32 + Open int32 + Turnover float32 + Volume int64 + func GetChart(sym string, startD, endD julian.JulianDay) (res []DayTA) + type MinFX struct + Close int32 + High int32 + Low int32 + Open int32 + SpreadMax uint16 + SpreadMin uint16 + Ticks int32 + Time timeT64 + Volume float32 + func LoadMinFX(pair string, startD, endD julian.JulianDay, maxCnt int) (res []MinFX, err error) + type MinTA struct + Close int32 + DownVol uint32 + High int32 + Low int32 + Open int32 + Time timeT32 + UpVol uint32 + Volume uint32 + type MinTAExt struct + Avg int32 + OpenInt uint32 + Time timeT32 + Turnover float32 + type OrderDirT int32 + const OrderDirBuy + const OrderDirClose + const OrderDirCover + const OrderDirSell + func (orDir OrderDirT) IsOffset() bool + func (orDir OrderDirT) Sign() int + func (orDir OrderDirT) String() string + type OrderStatusT int32 + const OrderAccept + const OrderCanceled + const OrderFilled + const OrderNew + const OrderNil + const OrderPartFilled + func (oSt OrderStatusT) String() string + type OrderType struct + AckTime DateTimeMs + AvgPrice float64 + Dir OrderDirT + DoneTime DateTimeMs + Magic int + Price float64 + Qty int + QtyFilled int + Status OrderStatusT + StopPrice float64 + Symbol string + type Parameter struct + Name string + Value interface{} + type Period int32 + const Daily + const Hour1 + const Hour2 + const Hour4 + const Hour8 + const Min1 + const Min15 + const Min3 + const Min30 + const Min5 + const Monthly + const Weekly + func (per Period) String() string + type PositionType struct + AvgPrice float64 + PosFreeze int + Positions int + type QuoteEvent struct + EventID int + Symbol string + type QuoteSubT struct + QuotesPtr *Quotes + Symbol string + type Quotes struct + Ask float64 + AskVol int64 + Bid float64 + BidVol int64 + Last float64 + Pclose float64 + TodayHigh float64 + TodayLow float64 + TodayOpen float64 + Turnover float64 + UpdateTime DateTimeMs + Volume int64 + type Series interface + DataAt func(i int) float64 + Len func() int + type Strategyer interface + DeInit func() + Init func(c *Context) (Strategyer, error) + OnBar func(sym string, period Period) + OnTick func(sym string) + ParamSet func() []Parameter + type Symbol struct + AutoCloseDate julian.JulianDay + EndDate julian.JulianDay + Exchange string + Name string + StartDate julian.JulianDay + Ticker string + func FindTicker(ticker string) *Symbol + type SymbolInfo struct + Lower float64 + Ticker string + Upper float64 + func GetSymbolInfo(sym string) (SymbolInfo, error) + func (s *SymbolInfo) CalcProfit(openP, closeP float64, volume int) float64 + func (s *SymbolInfo) CalcRiskVolume(amt float64, riskPrice float64) float64 + func (s *SymbolInfo) CalcVolume(amt float64, p float64) float64 + func (s *SymbolInfo) Digits() int + func (s *SymbolInfo) Divi() float64 + func (s *SymbolInfo) FastKey() SymbolKey + func (s *SymbolInfo) GetQuotes() Quotes + func (s *SymbolInfo) Multi() float64 + func (s *SymbolInfo) PriceNormal(p float64) float64 + func (s *SymbolInfo) String() (res string) + func (s *SymbolInfo) VolumeDigits() int + type SymbolKey int + func (fkey SymbolKey) SymbolInfo() (*SymbolInfo, error) + type TaSeries interface + BarValue func(i int) (Ti timeT64, Op, Hi, Lo, Cl float64, Vol float64) + Len func() int + type Tick struct + Last int32 + Time timeT32 + Volume uint32 + type TickExt struct + Ask int32 + AskDepth int32 + AskVol uint32 + AsksVol uint32 + Bid int32 + BidDepth int32 + BidVol uint32 + BidsVol uint32 + Time timeT32 + type TickFX struct + Ask int32 + Bid int32 + Time DateTimeMs + func Bytes2TickFX(buf []byte) *TickFX + func LoadTickFX(pair string, startD, endD julian.JulianDay, maxCnt int) (res []TickFX, err error) + type TickHead struct + BaseP int32 + BufSize int32 + Count int32 + Time timeT32 + func (tickHd *TickHead) DecodeMinTA(buf []byte) (ticks []MinTA, err error) + func (tickHd *TickHead) DecodeTick(buf []byte) (ticks []Tick, err error) + func (tickHd *TickHead) DecodeTickExt(buf []byte) (ticks []TickExt, err error) + func (tickHd *TickHead) EncodeMinTA(mins []MinTA) (buf []byte, err error) + func (tickHd *TickHead) EncodeTick(ticks []Tick) (buf []byte, err error) + func (tickHd *TickHead) EncodeTickExt(ticks []TickExt) (buf []byte, err error) + type TimeSeries interface + DataAt func(timeT64) float64 + Index func(timeT64) int + Len func() int