Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Pivot point Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
cdrapeau
Posted : Monday, January 10, 2011 10:24:24 AM
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
Bruce_L
Posted : Monday, January 10, 2011 11:15:51 AM


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
cdrapeau
Posted : Monday, January 10, 2011 11:56:55 PM
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?
Bruce_L
Posted : Tuesday, January 11, 2011 8:50:22 AM


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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.