how to draw buy/sell signals on financial charts?
Posted: Mon Nov 27, 2006 2:08 pm
Is there any way to draw buy/sell signals on financial charts?
Steema Software - Customer Support Forums
http://216.92.243.79/support/
Code: Select all
Private Sub Form_Load()
TeeCommander1.Chart = TChart1
'Populate candle (OHLC) series
TChart1.Series(0).FillSampleValues 40
With TChart1.Series(0)
For i = 2 To .Count - 1
If ((.asCandle.CloseValues.Value(i) > .asCandle.CloseValues.Value(i - 1)) And _
(.asCandle.CloseValues.Value(i) > .asCandle.CloseValues.Value(i - 2))) Then
'Sell signal
TChart1.Series(1).asArrow.AddArrow .XValues.Value(i), .asCandle.HighValues.Value(i) + 5, _
.XValues.Value(i), .asCandle.HighValues.Value(i) + 1, _
"Sell Signal", vbRed
Else
If ((.asCandle.CloseValues.Value(i) < .asCandle.CloseValues.Value(i - 1)) And _
(.asCandle.CloseValues.Value(i) < .asCandle.CloseValues.Value(i - 2))) Then
'Buy signal
TChart1.Series(1).asArrow.AddArrow .XValues.Value(i), .asCandle.LowValues.Value(i) - 5, _
.XValues.Value(i), .asCandle.LowValues.Value(i) - 1, _
"Buy Signal", vbGreen
End If
End If
Next
End With
End Sub