Registered User Joined: 5/7/2011 Posts: 13
|
Hello,
Can you please help me with realcode for plotting two indicators for the active symbol showing the percentage displacement of the bar's price from its 52 week highs and lows. For example, today SPX is 15.58% from its 52 week low and 0.83% from its 52 week high. I would like to plot this so that I can get historical day for every bar in the chart.
Thanks. Appreciate it.
Charles
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Assuming you find 252-Daily bars to be a reasonable approximation of 52-Weeks, you could use the following RealCode Indicator in a Daily Time Frame for the high:
Plot = 100 * (Price.Last / Price.MaxHigh(252) - 1)
And the following RealCode Indicator in a Daily Time Frame for the low:
Plot = 100 * (Price.Last / Price.MinLow(252) - 1)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 5/7/2011 Posts: 13
|
Thanks Bruce
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|