Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Change color of Moving Ave based on direction Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
tradermeister
Posted : Thursday, June 14, 2018 11:27:21 AM
Registered User
Joined: 1/24/2010
Posts: 3

I was looking to see if there is a way to change the color of a moving average depending on the direction. I examined the possibility that you could have two averages, on that would only print if the move is up and another if there is another down. However, my programming experience with TC2000 PCF's is still limited and I don't know if this functionality actually possible. If there is a way to do this then any help would be appreciated. Thanks !

Bruce_L
Posted : Thursday, June 14, 2018 11:31:47 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

There is no way to actually change the color of the moving average.

You can however create two (or three if you want a color for not changing direction) Custom PCF Indicators using different colors and the Dots Plot Style and plot them in the same pane and scale as the moving average.

So for example, with a 10 period simple moving average, you could use the following Formula setting in the Custom PCF Indicator for the up dots.

IIF(AVGC10 > AVGC10.1, AVGC10, 1 / 0)

And the following Formula setting for the Custom PCF Indicator plotting the down dots.

IIF(AVGC10 < AVGC10.1, AVGC10, 1 / 0)

Note that the 1 / 0 creating division by zero error on purpose in order to make it so the formula doesn't plot a dot when false. 



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Al_Gorithm
Posted : Thursday, June 14, 2018 2:57:29 PM

Registered User
Joined: 6/30/2017
Posts: 1,227

I swear I saw someone using TC2000 in some online event with either a moving average or some other oscillating plot that alternated colors based on direction, without using dots, ... but it could just be the summer heat.

We now return to our ice cream ...

Bruce_L
Posted : Thursday, June 14, 2018 3:10:41 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I can't think of a way to do so (which doesn't mean it isn't possible).

You can't use the 1 / 0 trick to force a division by zero error in a line chart like you can with the Dots and Histogram Plot Styles. Well you can, but it will still connect the the value which do plot with lines.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Al_Gorithm
Posted : Thursday, June 14, 2018 6:34:30 PM

Registered User
Joined: 6/30/2017
Posts: 1,227

No worries, it's just eye candy, IMO. The smarter I get, the simpler my charts get.

tradermeister
Posted : Thursday, June 14, 2018 8:20:42 PM
Registered User
Joined: 1/24/2010
Posts: 3

I thought that I had seen this as well but couldn't think how they had done it. Anyhow this will work fine and if I find another way then I'll update this thread.

Thanks Bruce !

traderc
Posted : Friday, June 15, 2018 5:56:11 AM
Registered User
Joined: 10/7/2004
Posts: 86

Bruce, what  about using  the technique you developed for the ttm squeeze?

Thinking out loud.

rctrade

Bruce_L
Posted : Friday, June 15, 2018 8:56:53 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

The TTM Squeeze technique is essentially the same as the Dots technique presented except that it uses the Histogram Plot Style instead of the Dots Plot Style.

The reason to use the Dots Plot Style in this case is that my assumption was that the moving average is being applied to something (such as price) that you would not want to cover up with a histogram.



-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.