本文整理汇总了Golang中github.com/thetruetrade/gotrade.DOHLCV.V方法的典型用法代码示例。如果您正苦于以下问题:Golang DOHLCV.V方法的具体用法?Golang DOHLCV.V怎么用?Golang DOHLCV.V使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/thetruetrade/gotrade.DOHLCV
的用法示例。
在下文中一共展示了DOHLCV.V方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ReceiveDOHLCVTick
// ReceiveDOHLCVTick consumes a source data DOHLCV price tick
func (ind *AdlWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int) {
moneyFlowMultiplier := ((tickData.C() - tickData.L()) - (tickData.H() - tickData.C())) / (tickData.H() - tickData.L())
moneyFlowVolume := moneyFlowMultiplier * tickData.V()
result := ind.previousAdl + moneyFlowVolume
ind.UpdateIndicatorWithNewValue(result, streamBarIndex)
ind.previousAdl = result
}
示例2: ReceiveDOHLCVTick
// ReceiveDOHLCVTick consumes a source data DOHLCV price tick
func (ind *ObvWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int) {
ind.periodCounter += 1
if ind.periodCounter <= 0 {
ind.previousObv = tickData.V()
ind.previousClose = tickData.C()
result := ind.previousObv
ind.UpdateIndicatorWithNewValue(result, streamBarIndex)
}
if ind.periodCounter > 0 {
closePrice := tickData.C()
if closePrice > ind.previousClose {
ind.previousObv += tickData.V()
} else if closePrice < ind.previousClose {
ind.previousObv -= tickData.V()
}
result := ind.previousObv
ind.UpdateIndicatorWithNewValue(result, streamBarIndex)
ind.previousClose = tickData.C()
}
}
示例3: ReceiveDOHLCVTick
// ReceiveDOHLCVTick consumes a source data DOHLCV price tick
func (ind *MfiWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int) {
ind.currentVolume = tickData.V()
ind.typicalPrice.ReceiveDOHLCVTick(tickData, streamBarIndex)
}