VB计算MACD指标详细编码
MACD指标的含义、用法及计算原理,请自己百度不啰嗦,直接上干货-代码如下: Set rstStockHistroy = dbsDatabase.OpenRecordset("SELECT...... ", dbOpenDynaset) rstStockHistroy.MoveLast intrecordcounter = rstStockHistroy.RecordCount rstStockHistroy.MoveFirst 'MsgBox ("记录:" & rstStockHistroy(0).Value) For intcounter = 1 To intrecordcounter '从上市首日开始计算 If intcounter = 1 Then '上市首日 rstStockHistroy.Edit rstStockHistroy(9) = 0 'DIFF rstStockHistroy(10) = 0 'DEA rstStockHistroy(11) = 0 'BAR rstStockHistroy.Update End If If intcounter = 2 Then '上市次日 rstStockHistroy.MovePrevious sigPreClose = rstStockHistroy(2) sigPreDEA = rstStockHistroy(10)