Registered User Joined: 5/27/2011 Posts: 45
|
Hi Bruce,
Does your vs indicator give a reading from data at the beginning or end of the current time bar. For instace, with 5-min candles on the chart, and the curser over the 5-min bar, is the indicator below showing the value of your vs indicator at the beinning or end of the 5-min candle?
Your formula was given on the forum April 27, 2009.
Thanks, Ed
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If you are talking about the RealCode given in the Above Average Volume topic, all past volume bars used in the calculations use the volume through the end of the bar. The current intraday bar uses the volume so far in the bar at the time of calculation.
While the number of bars used for previous days matches the number of bars used for the current day, no attempt is made to account for differences resulting from the current bar possibly being only a partial bar.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 5/27/2011 Posts: 45
|
Bruce, Your VS Formula given April 27, 2009 is:
If Time Frame.TotalDays<=1 AndAlso Period>=2 Then
Dim Start(Period-1) As Integr
Dim DayCount As Integer = -1
Dim Bar Count As Singe = 0
Dim Sum(1) As Single
Dim SMA As New System.Collections.Generic.List(Of Single)
For i As Integer = 1 To Volume.Line.Count -1
If Volume.Line.DateValue(i).DayOfYear <> Volume.Line.Date Value(i-1).DayOf Year Then
DayCount += 1
BarCount =0
Sum(0)= 0
Sum(1) = 0
If DayCount >= Period Then
Dim j As Integer =0
For k As Integer= Start(DayCount Mod Period) To
Start((DayCount +1) Mod Period) -1
SMA(j) -= Volume.Line.Value(k)
j+= 1
Next
End If
Start(DayCount Mod Period) = i
End If
If DayCount >= 0 Then
If BarCount >SMA.Count Then
SMA.Add(Volume.Line.Value(i))
Else
SMA(BarCount) += Volume.Line.Value(i)
End If
End If
If DayCount >= Period -1 Then
Sum(0) += Volume.Line.Value(i)
Sum(1) += SMA(BarCount)
If Sum(1) > 0 Then
Add ToOuput(Volume.Line.DateValue(i), Sum(0)/ (Sum(1) / Period))
End If
End If
BarCount += 1
Next
End If
If it possible to utilize the block access for the VS indicator to feed data from another time source, so that the data feed is other than your primary chart? That way the VS could accumulate from a smaller or larger time-data feed, independent from the primary chart.
Thanks, Ed
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The original Above Average Volume topic starts talking about having the indicator use a different time frame than the chart in its Wednesday, June 01, 2011 12:56:27 PM ET post and includes attached indicators allowing you to do this.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 5/27/2011 Posts: 45
|
Thanks for your help.
Ed
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|