Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 5/23/2018 Posts: 2
|
I am trying to program Hull moving average such that it changes color with a change of direction. Blue while moving up and Red while moving down. How can someone create a custom indicator?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I would probably leave the moving average on the chart as a line and plot different dots on that line when moving moving up versus moving down. You will need two Custom PCF Indicators overlayed into the same pane and scale as price in order to do this.
The following settings are based on a 50 period Hull moving average. You can change any instances of 50 in the formulas to adjust the settings. For the blue dots:
- Plot Style: Dots
- Plot Color: Blue
- Period: 1
- Average Type: Doesn't matter (because the Period is 1).
- Formula: IIF(HAVGC50 > HAVGC50.1, HAVGC50, 1 / 0)
For the red dots:
- Plot Style: Dots
- Plot Color: Red
- Period: 1
- Average Type: Doesn't matter (because the Period is 1).
- Formula: IIF(HAVGC50 < HAVGC50.1, HAVGC50, 1 / 0)
How to Overlay an Indicator (choose & Scale With)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/30/2017 Posts: 1,227
|
Pretty cool. Filing this away for future reference. :)
|
|
Registered User Joined: 5/23/2018 Posts: 2
|
Thanks so much, it works
|
|
Registered User Joined: 11/19/2015 Posts: 459
|
Hi, Bruce. When convenient, could I please have the formula for hull50 turning green and vice versa? I hope you're well.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Hull turning blue.
TrueInRow(HAVGC50 > HAVGC50.1, 2) =1
Or maybe this would be more efficient (it is shorter).
XUP(HAVGC50, HAVGC50.1)
Hull turning red.
TrueInRow(HAVGC50 < HAVGC50.1, 2) = 1
Shorter version being the following.
XDOWN(HAVGC50, HAVGC50.1)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/19/2015 Posts: 459
|
Perfect as always. Thanks, Bruce. Have a nice weekend.
|
|
Registered User Joined: 11/19/2015 Posts: 459
|
Hello.
Bruce, I've confused myself.
1. I've plotted the B-R, R-B Hull8 trend changes as above. They're plotted right on the chart candlesticks. Looks good. This is the "Hull trend".
2. "Next Hull change": I've also plotted the "based on current value, where would Hull8 next change to red or blue" formula you helped me with last week. I use a "last value horizontal" line for:
(51 * C1 + 186 * (C2 + C3) + 78 * C4 + 6 * C5 - 115 * C - 30 * (C6 + C7) - 15 * C8 - 5 * C9) / 312
The "next change" line *appears" to be correct. It's always below a blue dot and above a red dot relative to the last "Hull Trend" value. But if I change the scaling of the Next Hull to "by itself" (rather than the symbol", I get a completely different value.
Why does changing the scaling produce a different price value?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I do not know why this would happen. The value should not change, only the position of the plot relative to price should change when you plot the Custom PCF Indicator on its own scale.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/19/2015 Posts: 459
|
It's the end of your day, so I'll try following up tomorrow by sending you the layout+chart to TC mail. I'll work on it tonight to see if I clear it up myself. Thanks, Bruce.
|
|
Registered User Joined: 11/19/2015 Posts: 459
|
Bruce, would you please help me with finding current price's distance away (in percent) from "next hull change" as above in this thread?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try the following.
100 * (312 * C / (51 * C1 + 186 * (C2 + C3) + 78 * C4 + 6 * C5 - 115 * C - 30 * (C6 + C7) - 15 * C8 - 5 * C9) - 1)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |