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

home made oscillator from 2 SMA Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
RedEagle9
Posted : Saturday, January 7, 2017 11:15:17 AM
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!

diceman
Posted : Saturday, January 7, 2017 2:20:31 PM
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


 

RedEagle9
Posted : Tuesday, January 10, 2017 1:10:47 AM
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!

 

 

diceman
Posted : Tuesday, January 10, 2017 1:27:43 AM
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

 

RedEagle9
Posted : Wednesday, January 11, 2017 11:19:29 PM
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!

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.