Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 9/14/2016 Posts: 24
|
I'd like to create an indicator which shows the relationship between 2 moving averages. If both moving averages are moving up then the display value is 1, if both are moving down then display -1. Just for example a 5 period SMA and a 9 period SMA. I have no interest in detecting crosses, just the moving in the same direction.
I have built 2 indicators, one for the +1 condition and the other for the -1 condition. Both displaying one above the other at the bottom of my charts.
However is it posible to build just one indicator? If so can I have an example?
Thanks!
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
This should work.
Use regular PCF not % true.
ABS(AVGC5 > AVGC5.1 AND AVGC9 > AVGC9.1) + ABS(AVGC5 < AVGC5.1 AND AVGC9 < AVGC9.1) * -1
Thanks
|
|
Registered User Joined: 9/14/2016 Posts: 24
|
That's nice math, sadly I get "error : Must be boolean formula" when I code it into a plot window so it displays below a chart. I guess it's a limitation of TC2000 latest version.
It does however work great as a column or filter in an easy scan, which is very helpful.
Thanks!
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
QUOTE (RedEagle9)
sadly I get "error : Must be boolean formula"
Thanks!
You can plot below chart.
Use a Custom PCF, not Percent True PCF.
Thanks
|
|
Registered User Joined: 9/14/2016 Posts: 24
|
Excellent ! fwiw I simply tried plotting the formula and it worked. It was created and saved last evening and after a restart today it works.
Thanks for sharing!
|
|
Guest-1 |