Private Sub DrawKLine(picBroad As PictureBox, CurJL As Long, ts As Long, maxhigh As Double, minlow As Double)
'画K线
Dim DrawColor As Long
Dim i As Long
Dim MaxJL As Long
picBroad.Cls
picBroad.Scale
If CurJL + ts > UBound(hq) Then
MaxJL = UBound(hq)
Else
MaxJL = CurJL + ts
End If
picBroad.Scale (CurJL, maxhigh)-(CurJL + ts + 1, minlow)
For i = CurJL To MaxJL
If hq(i).spj > hq(i).kpj Then
DrawColor = QBColor(12)
ElseIf hq(i).spj < hq(i).kpj Then
DrawColor = QBColor(10)
Else
DrawColor = QBColor(15)
End If
picBroad.Line (i + 0.2, hq(i).kpj)-(i + 0.8, hq(i).spj), DrawColor, BF
picBroad.Line (i + 0.5, hq(i).zgj)-(i + 0.5, hq(i).zdj), DrawColor
Next
End Sub
Private Sub DrawVolume(picBroad As PictureBox, CurJL As Long, ts As Long, maxhigh As Double, minlow As Double) '画K线
'画成交量
Dim DrawColor As Long
Dim i As Long
Dim MaxJL As Long
picBroad.Cls
picBroad.Scale
If CurJL + ts > UBound(hq) Then
MaxJL = UBound(hq)
Else
MaxJL = CurJL + ts
End If
picBroad.Scale (CurJL, maxhigh)-(CurJL + ts + 1, minlow)
For i = CurJL To MaxJL
If hq(i).spj > hq(i).kpj Then
DrawColor = QBColor(12)
ElseIf hq(i).spj < hq(i).kpj Then
DrawColor = QBColor(10)
Else
DrawColor = QBColor(15)
End If
picBroad.Line (i + 0.2, hq(i).cjl)-(i + 0.8, minlow), DrawColor, BF
Next
End Sub
Private Sub DrawAvangeKline(picBroad As PictureBox, CurJL As Long, ts As Long, maxhigh As Double, minlow As Double, AvangeTs As Long, DrawColor As Long) '画K线
'画均线
Dim i As Long
Dim MaxJL As Long
Dim PointValue() As Double
Dim j As Long
Dim StartX As Double, StartY As Double
picBroad.Scale
If CurJL + ts > UBound(hq) Then
MaxJL = UBound(hq)
Else
MaxJL = CurJL + ts
End If
ReDim PointValue(CurJL To MaxJL)
picBroad.Scale (CurJL, maxhigh)-(CurJL + ts + 1, minlow)
For i = CurJL To MaxJL
If i >= AvangeTs Then
PointValue(i) = 0
For j = i - AvangeTs + 1 To i
PointValue(i) = PointValue(i) + hq(j).spj
Next
PointValue(i) = PointValue(i) / AvangeTs
If i > CurJL Then
picBroad.Line (StartX, StartY)-(i + 0.8, PointValue(i)), DrawColor
StartX = i + 0.8
StartY = PointValue(i)
Else
StartX = i
StartY = PointValue(i)
End If
Else
PointValue(i) = 0
End If
Next
End Sub