Can someone help with this problem? I'd like show the change of bid
and
ask
price with different colours: higher prices = green, lower prices =
red.
I've written the following code, which, unfortunately, doesn't work
properly. Sometimes the showing of colours is correct and other times
it's
not.
Here is my code:
Private Sub AxTws1_tickSize(ByVal sender As System.Object, ByVal e As
AxTWSLib._DTwsEvents_tickSizeEvent) Handles AxTws1.tickSize
Select Case e.tickType
Case Is = 0
LabelBidSize.Text = CStr(e.size)
If CInt(LabelBidSize.Text) > e.size Then
LabelBidSize.ForeColor = Color.Red
ElseIf CInt(LabelBidSize.Text) < e.size Then
LabelBidSize.ForeColor = Color.Green
Else
LabelBidSize.ForeColor = Color.Black
End If
Case Is = 3
LabelAskSize.Text = CStr(e.size)
If CInt(LabelAskSize.Text) > e.size Then
LabelAskSize.ForeColor = Color.Red
ElseIf CInt(LabelAskSize.Text) < e.size Then
LabelAskSize.ForeColor = Color.Green
Else
LabelAskSize.ForeColor = Color.Black
End If
Case Is = 5
LabelLastSize.Text = CStr(e.size)
End Select
End Sub
Does anyone know the mistake? I work with VB.Net.
Thank you.