how to draw buy/sell signals on financial charts?
how to draw buy/sell signals on financial charts?
Is there any way to draw buy/sell signals on financial charts?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Repka, you can easily draw buy and sell signals in a financial chart using arrow series, for example:
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
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |