gocybos

package module
v0.0.0-...-d62a4d3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 7 Imported by: 0

README

gocybos

Cybos Go Wrapper

Documentation

Index

Constants

View Source
const (
	StockCurHeaderCode StockCurHeaderType = iota
	StockCurHeaderName
	StockCurHeaderDelta
	StockCurHeaderTimeHM
	StockCurHeaderOpen
	StockCurHeaderHigh
	StockCurHeaderLow
	StockCurHeaderAskPrice
	StockCurHeaderBidPrice
	StockCurHeaderVolumeTotal
	StockCurHeaderValueTotal
	StockCurHeaderClose = iota + 2

	StockCurHeaderConConclusionType
	StockCurHeaderVolumeConSellTotal
	StockCurHeaderVolumeConBuyTotal

	StockCurHeaderVolume = iota + 2
	StockCurHeaderTimeHMS

	StockCurHeaderPreMarketVolume   = iota + 4
	StockCurHeaderBidConclusionType = iota + 8
	StockCurHeaderVolumeBidSellTotal
	StockCurHeaderVolumeBidBuyTotal
)
View Source
const (
	KOSPI  = "001"
	KOSDAQ = "201"
)
View Source
const (
	StockCurInputCode = 0
)
View Source
const (
	StockWeekInputCode = 0
)

Variables

View Source
var (
	// IID_CpCybosEvents, _ = ole.CLSIDFromString("{17F70631-56E5-40FC-B94F-44ADD3A850B1}") Not working
	IID_DibEvents, _ = ole.CLSIDFromString("{B8944520-09C3-11D4-8232-00105A7C4F8C}")
)

Functions

func CastSlice

func CastSlice[T any](vArray []*ole.VARIANT, cast func(*ole.VARIANT) T) []T

func DateToUInt

func DateToUInt(date time.Time) uint64

func GetEventIID

func GetEventIID(name string) *ole.GUID

func InitCOM

func InitCOM()

func IsUserAnAdmin

func IsUserAnAdmin() (bool, error)

func NewDate

func NewDate(year int, month int, day int) time.Time

func ParseTimeHMSUInt

func ParseTimeHMSUInt(value uint64) (hour int, min int, sec int)

func ReleaseCOM

func ReleaseCOM()

func SafeArrayCreateVector

func SafeArrayCreateVector(variantType ole.VT, lowerBound int32, length uint32) (safearray *ole.SafeArray, err error)

func SafeArrayFromInt32Slice

func SafeArrayFromInt32Slice[T ~int32](slice []T) *ole.SafeArray

func SafeArrayPutElement

func SafeArrayPutElement(safeArray *ole.SafeArray, index int64, element uintptr)

func Stock

func Stock(stockCode string) string

func StockIndex

func StockIndex(indexCode string) string

func ToBool

func ToBool(r *ole.VARIANT) bool

func ToDate

func ToDate(value *ole.VARIANT) time.Time

func ToFloat32

func ToFloat32(r *ole.VARIANT) float32

func ToFloat64

func ToFloat64(r *ole.VARIANT) float64

func ToInt32

func ToInt32(r *ole.VARIANT) int32

func ToInt64

func ToInt64(r *ole.VARIANT) int64

func ToRune

func ToRune(r *ole.VARIANT) rune

func ToSS

func ToSS(r *ole.VARIANT) []string

func ToStr

func ToStr(r *ole.VARIANT) string

func ToTimeHM

func ToTimeHM(value *ole.VARIANT) time.Time

func ToTimeHMS

func ToTimeHMS(value *ole.VARIANT) time.Time

func ToUInt32

func ToUInt32(r *ole.VARIANT) uint32

func ToUInt64

func ToUInt64(r *ole.VARIANT) uint64

func UIntToDate

func UIntToDate(value uint64) time.Time

func UIntToTimeHM

func UIntToTimeHM(value uint64) time.Time

func UIntToTimeHMS

func UIntToTimeHMS(value uint64) time.Time

func VariantInt32Slice

func VariantInt32Slice[T ~int32](s []T) ole.VARIANT

Types

type ConclusionType

type ConclusionType rune
const (
	ConclusionTypeBuy  ConclusionType = '1'
	ConclusionTypeSell ConclusionType = '2'
)

func ToConclusionType

func ToConclusionType(value *ole.VARIANT) ConclusionType

type CpCybos

type CpCybos struct {
	CpTrait
}

func (*CpCybos) Create

func (c *CpCybos) Create()

func (*CpCybos) GetLimitRemainCount

func (c *CpCybos) GetLimitRemainCount(limitType LimitType) *ole.VARIANT

func (*CpCybos) GetLimitRemainTime

func (c *CpCybos) GetLimitRemainTime(limitType LimitType) *ole.VARIANT

func (*CpCybos) IsConnect

func (c *CpCybos) IsConnect() *ole.VARIANT

func (*CpCybos) LimitRequestRemainTime

func (c *CpCybos) LimitRequestRemainTime() *ole.VARIANT

func (*CpCybos) PlusDisconnect

func (c *CpCybos) PlusDisconnect()

func (*CpCybos) ServerType

func (c *CpCybos) ServerType() *ole.VARIANT

type CpReceiver

type CpReceiver interface {
	Received()
}

type CpStockChart

type CpStockChart struct {
	CpTrait
	// contains filtered or unexported fields
}

func (*CpStockChart) Create

func (c *CpStockChart) Create(fields *ole.VARIANT)

func (*CpStockChart) GetHeaderValue

func (c *CpStockChart) GetHeaderValue(hType StockChartHeaderType) *ole.VARIANT

func (*CpStockChart) SetInputCode

func (c *CpStockChart) SetInputCode(code string)

func (*CpStockChart) SetInputCount

func (c *CpStockChart) SetInputCount(count uint64)

func (*CpStockChart) SetInputCountType

func (c *CpStockChart) SetInputCountType(countType StockChartCountType)

func (*CpStockChart) SetInputDataType

func (c *CpStockChart) SetInputDataType(dataType StockChartDataType)

func (*CpStockChart) SetInputDateEnd

func (c *CpStockChart) SetInputDateEnd(date time.Time)

func (*CpStockChart) SetInputDateStart

func (c *CpStockChart) SetInputDateStart(date time.Time)

func (*CpStockChart) SetInputGapType

func (c *CpStockChart) SetInputGapType(gapType StockChartGapType)

func (*CpStockChart) SetInputPeriod

func (c *CpStockChart) SetInputPeriod(period uint16)

func (*CpStockChart) SetInputPriceType

func (c *CpStockChart) SetInputPriceType(priceType StockChartPriceType)

func (*CpStockChart) SetInputValue

func (c *CpStockChart) SetInputValue(iType stockChartInputType, value any)

func (*CpStockChart) SetInputVolumeType

func (c *CpStockChart) SetInputVolumeType(volumeType StockChartVolumeType)

type CpStockCur

type CpStockCur struct {
	CpTrait
}

func (*CpStockCur) Create

func (c *CpStockCur) Create()

func (*CpStockCur) GetHeaderValue

func (c *CpStockCur) GetHeaderValue(hType StockCurHeaderType) *ole.VARIANT

func (*CpStockCur) SetInputCode

func (c *CpStockCur) SetInputCode(code string)

type CpStockWeek

type CpStockWeek struct {
	CpTrait
}

func (*CpStockWeek) Create

func (c *CpStockWeek) Create()

func (*CpStockWeek) GetDataValue

func (c *CpStockWeek) GetDataValue(dType StockWeekDataType, index int32) *ole.VARIANT

func (*CpStockWeek) GetHeaderValue

func (c *CpStockWeek) GetHeaderValue(hType StockWeekHeaderType) *ole.VARIANT

func (*CpStockWeek) GetValue

func (c *CpStockWeek) GetValue(index int32) uint64

func (*CpStockWeek) SetInputCode

func (c *CpStockWeek) SetInputCode(code string)

type CpTrait

type CpTrait struct {
	Object *ole.Dispatch
	// contains filtered or unexported fields
}

func (*CpTrait) BindEvent

func (t *CpTrait) BindEvent(callback CpReceiver)

func (*CpTrait) BlockRequest

func (t *CpTrait) BlockRequest() (result *ole.VARIANT)

func (*CpTrait) BlockRequest2

func (t *CpTrait) BlockRequest2(option int16) *ole.VARIANT

func (*CpTrait) Continue

func (t *CpTrait) Continue() (result *ole.VARIANT)

func (*CpTrait) Create

func (t *CpTrait) Create(name string) (err error)

func (*CpTrait) Data

func (t *CpTrait) Data() *ole.VARIANT

func (*CpTrait) GetDataArray

func (t *CpTrait) GetDataArray(dType int32, total int32) []*ole.VARIANT

func (*CpTrait) GetDataValue

func (t *CpTrait) GetDataValue(dType int32, index int32) (result *ole.VARIANT)

func (*CpTrait) GetDibMsg1

func (t *CpTrait) GetDibMsg1() *ole.VARIANT

func (*CpTrait) GetDibStatus

func (t *CpTrait) GetDibStatus() *ole.VARIANT

func (*CpTrait) GetHeaderValue

func (t *CpTrait) GetHeaderValue(hType int32) (result *ole.VARIANT)

func (*CpTrait) Header

func (t *CpTrait) Header() *ole.VARIANT

func (*CpTrait) Release

func (t *CpTrait) Release()

func (*CpTrait) Request

func (t *CpTrait) Request()

func (*CpTrait) SetInputValue

func (t *CpTrait) SetInputValue(iType int32, value any)

func (*CpTrait) Subscribe

func (t *CpTrait) Subscribe()

func (*CpTrait) SubscribeLatest

func (t *CpTrait) SubscribeLatest()

func (*CpTrait) UnbindEvent

func (t *CpTrait) UnbindEvent()

func (*CpTrait) Unsubscribe

func (t *CpTrait) Unsubscribe()

type ICpEvent

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

type ICpEventVTable

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

type LimitType

type LimitType int16
const (
	LimitTypeTradeRequest LimitType = iota
	LimitTypeNonTradeRequest
	LimitTypeSubscribe
)

type StockChartCountType

type StockChartCountType rune
const (
	StockChartCountTypePeriod StockChartCountType = '1'
	StockChartCountTypeNum    StockChartCountType = '2'
)

type StockChartDataType

type StockChartDataType rune
const (
	StockChartDataTypeDay    StockChartDataType = 'D'
	StockChartDataTypeMonth  StockChartDataType = 'M'
	StockChartDataTypeMinute StockChartDataType = 'm'
	StockChartDataTypeWeek   StockChartDataType = 'W'
	StockChartDataTypeTick   StockChartDataType = 'T'
)

type StockChartField

type StockChartField int32
const (
	StockChartFieldDate StockChartField = iota
	StockChartFieldTime
	StockChartFieldOpen
	StockChartFieldHigh
	StockChartFieldLow
	StockChartFieldClose
	StockChartFieldPriceDelta
	StockChartFieldVolume StockChartField = 1 + iota
	StockChartFieldValue
	StockChartFieldVolumeBidSellTotal
	StockChartFieldVolumeBidBuyTotal
	StockChartFieldListedShare
	StockChartFieldMarketCap
	StockChartFieldPriceDeltaSign     = 37
	StockChartFieldVolumeConSellTotal = 62
	StockChartFieldVolumeConBuyTotal  = 63
)

type StockChartGapType

type StockChartGapType rune
const (
	StockChartGapNoCorrection StockChartGapType = '0'
	StockChartGapCorrection   StockChartGapType = '1'
)

type StockChartHeaderType

type StockChartHeaderType int32
const (
	StockChartHeaderCode          StockChartHeaderType = iota //string
	StockChartHeaderFieldCount                                //short
	StockChartHeaderFieldNames                                //string array
	StockChartHeaderDataCount                                 //long
	StockChartHeaderLastTickCount                             //ushort
	StockChartHeaderLastTradeDay                              //ulong
	StockChartHeaderPrevClose
	StockChartHeaderCurrentPrice
	StockChartHeaderPriceDeltaType
	StockChartHeaderPriceDelta
	StockChartHeaderVolume
	StockChartHeaderAskPrice
	StockChartHeaderBidPrice
	StockChartHeaderOpen
	StockChartHeaderHigh
	StockChartHeaderLow
	StockChartHeaderValue
	StockChartHeaderStatus
	StockChartHeaderListedShare
	StockChartHeaderCapital // 자본금
	StockChartHeaderPrevVolume
	StockChartHeaderLastUpdateTimeHM
	StockChartHeaderMaxPrice
	StockChartHeaderMinPrice
)

type StockChartPriceType

type StockChartPriceType rune
const (
	StockChartPriceNoAmend StockChartPriceType = '0'
	StockChartPriceAmend   StockChartPriceType = '1'
)

type StockChartVolumeType

type StockChartVolumeType rune
const (
	StockChartVolumeContainAll    StockChartVolumeType = '1'
	StockChartVolumeContainAfter  StockChartVolumeType = '2'
	StockChartVolumeOnlyMarket    StockChartVolumeType = '3'
	StockChartVolumeContainBefore StockChartVolumeType = '4'
)

type StockCurHeaderType

type StockCurHeaderType int32

type StockWeekDataType

type StockWeekDataType int32
const (
	StockWeekDataDate StockWeekDataType = iota
	StockWeekDataOpen
	StockWeekDataHigh
	StockWeekDataLow
	StockWeekDataClose
	StockWeekDataDelta
	StockWeekDataVolume
	StockWeekDataDeltaRatio = 10
	StockWeekDataValue      = 20
)

type StockWeekHeaderType

type StockWeekHeaderType int32
const (
	StockWeekHeaderCode StockWeekHeaderType = iota
	StockWeekHeaderCount
	StockWeekHeaderDate
)

Jump to

Keyboard shortcuts

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