Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 8/3/2009 Posts: 8
|
I would like to create an indicator for a line that would render the following in Stockfinder 5 :
(previous day's close + previous day's high + previous day's low) / 3
I have tried very hard .... without success !!!!
Many thanks
Christian Drapeau
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Pivot Point
'|******************************************************************
Static DayHigh(1) As Single
Static DayLow(1) As Single
Static DayClose(1) As Single
If isFirstBar Then
For i As Integer = 0 To 1
DayHigh(i) = Single.NaN
DayLow(i) = Single.NaN
DayClose(i) = Single.NaN
Next
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
DayHigh(1) = DayHigh(0)
DayHigh(0) = Price.High
DayLow(1) = DayLow(0)
DayLow(0) = Price.Low
DayClose(1) = Price.Last(1)
End If
DayHigh(0) = System.Math.Max(DayHigh(0), Price.High)
DayLow(0) = System.Math.Min(DayLow(0), Price.Low)
Plot = (DayHigh(1) + DayLow(1) + DayClose(1)) / 3
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 8/3/2009 Posts: 8
|
Thanks Bruce. This is what I was looking for .... but the line of the indicator, when overlaid over price, is not located exactly where it should be .... e.g. on AFL, today, the value of the indicator is 55.97.... and the line is at the level of 56.25 more or less .... is there any way that I can resolve that?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Right-click on the Indicator and select Scaling | Scale With | Price History.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |