TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule
TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions
Worden Discussion Forum » Customer Training & Support » PCFs, EasyScan and Custom Indicators » 2 Bar Slope of an EMA
Bruce is out the rest of this week. He'll be back on Monday.
Hi StockGuy,
Thanks for the info. Can you help me with my two issues above?
Kind regards,
Chris
SGN(XAVGC20 > XAVGC20.1) will return 1 when the 2-bar slope is positive and -1 when negative.
Thanks much. Can I use this as an Indicator PCF as well or just as a Conition/Scan PCF?
Yes, you can use it in a Custom PCF Indicator.
Hi Bruce,
StockGuy helped me with an EMA20 2bar slope, but I am seeing that it is not responsive enough.
Would you be so good and give me the code to scan for:
the two bar slope of the T3-4-1.62 being positive, and also:
How to code a PCF indicator of the histogram of the two bar T3-4-1.618 slope (+1 for positive slope and -1 for negative slope)?
Many thanks to you.
Please try the following for the T3-4-1.62.
SGN(-(1.62 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC4, 4), 4), 4), 4), 4) + 3 * ((1.62 ^ 2) + (1.62 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC4, 4), 4), 4), 4) - (6 * (1.62 ^ 2) + 3 * (1.62 + (1.62 ^ 3))) * XAVG(XAVG(XAVG(XAVGC4, 4), 4), 4) + (1 + 3 * 1.62 + (1.62 ^ 3) + 3 * (1.62 ^ 2)) * XAVG(XAVG(XAVGC4, 4), 4) - (-(1.62 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC4.1, 4), 4), 4), 4), 4) + 3 * ((1.62 ^ 2) + (1.62 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC4.1, 4), 4), 4), 4) - (6 * (1.62 ^ 2) + 3 * (1.62 + (1.62 ^ 3))) * XAVG(XAVG(XAVG(XAVGC4.1, 4), 4), 4) + (1 + 3 * 1.62 + (1.62 ^ 3) + 3 * (1.62 ^ 2)) * XAVG(XAVG(XAVGC4.1, 4), 4)))
And the following for the T3-4-1.618.
SGN(-(1.618 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC4, 4), 4), 4), 4), 4) + 3 * ((1.618 ^ 2) + (1.618 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC4, 4), 4), 4), 4) - (6 * (1.618 ^ 2) + 3 * (1.618 + (1.618 ^ 3))) * XAVG(XAVG(XAVG(XAVGC4, 4), 4), 4) + (1 + 3 * 1.618 + (1.618 ^ 3) + 3 * (1.618 ^ 2)) * XAVG(XAVG(XAVGC4, 4), 4) - (-(1.618 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC4.1, 4), 4), 4), 4), 4) + 3 * ((1.618 ^ 2) + (1.618 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC4.1, 4), 4), 4), 4) - (6 * (1.618 ^ 2) + 3 * (1.618 + (1.618 ^ 3))) * XAVG(XAVG(XAVG(XAVGC4.1, 4), 4), 4) + (1 + 3 * 1.618 + (1.618 ^ 3) + 3 * (1.618 ^ 2)) * XAVG(XAVG(XAVGC4.1, 4), 4)))
Thanks Bruce, That works nicely and is very fast. Kind regards, Chris
P.S. How can I scan for changes in (2b Slope of the T3-4) when the T3-4 goes from negative to positive?? That would be a real nice addition.
Put the entire formula inside the following:
XUP(put formula here , 0)
XUP(
, 0)
So the slope of the T3-4-1.618 going from negative to positive would be the following.
XUP(SGN(-(1.618 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC4, 4), 4), 4), 4), 4) + 3 * ((1.618 ^ 2) + (1.618 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC4, 4), 4), 4), 4) - (6 * (1.618 ^ 2) + 3 * (1.618 + (1.618 ^ 3))) * XAVG(XAVG(XAVG(XAVGC4, 4), 4), 4) + (1 + 3 * 1.618 + (1.618 ^ 3) + 3 * (1.618 ^ 2)) * XAVG(XAVG(XAVGC4, 4), 4) - (-(1.618 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC4.1, 4), 4), 4), 4), 4) + 3 * ((1.618 ^ 2) + (1.618 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC4.1, 4), 4), 4), 4) - (6 * (1.618 ^ 2) + 3 * (1.618 + (1.618 ^ 3))) * XAVG(XAVG(XAVG(XAVGC4.1, 4), 4), 4) + (1 + 3 * 1.618 + (1.618 ^ 3) + 3 * (1.618 ^ 2)) * XAVG(XAVG(XAVGC4.1, 4), 4))) , 0)
Many thanks, works like a charm.
Hey Bruce,
I wanted to do the same Histo Indicator PCF for the T3-8-1.618 two bar slope turning positive and came up with this, but there seems to be a parenthesis error I cannot get rid of:
Please try the following instead.
XUP(SGN(-(-4.235801 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8), 8), 8) + 3 * ((-4.235801 ^ 2) + (-4.235801 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8), 8) - (6 * (-4.235801 ^ 2) + 3 * (-4.235801 + (-4.235801 ^ 3))) * XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8) + (1 + 3 * -4.235801 + (-4.235801 ^ 3) + 3 * (-4.235801 ^ 2)) * XAVG(XAVG(XAVGC8, 8), 8) - (-(-4.235801 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC8.1, 8), 8), 8), 8), 8) + 3 * ((-4.235801 ^ 2) + (-4.235801 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC8.1, 8), 8), 8), 8) - (6 * (-4.235801 ^ 2) + 3 * (-4.235801 + (-4.235801 ^ 3))) * XAVG(XAVG(XAVG(XAVGC8.1, 8), 8), 8) + (1 + 3 * -4.235801 + (-4.235801 ^ 3) + 3 * (-4.235801 ^ 2)) * XAVG(XAVG(XAVGC8.1, 8), 8))) , 0)
Thanks Bruce,
When I enter it into an Indicator PCF, it says: Boolean Condition and saves it is a condition PCF.
What I was aiming to do, is to have a histogram of the 2 bar Slope of the T3-8-1.618 and plot that histogram, so I would typically always see -1 (red) histograms below 0 and +1 green histograms abobe 0.
Any way I can change this inti a PCF Indicator which is a histogram of the two bar slope of this T3?
Thanks,
The XUP() function is what is converting it into a condition.
XUP()
SGN(-(-4.235801 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8), 8), 8) + 3 * ((-4.235801 ^ 2) + (-4.235801 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8), 8) - (6 * (-4.235801 ^ 2) + 3 * (-4.235801 + (-4.235801 ^ 3))) * XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8) + (1 + 3 * -4.235801 + (-4.235801 ^ 3) + 3 * (-4.235801 ^ 2)) * XAVG(XAVG(XAVGC8, 8), 8) - (-(-4.235801 ^ 3) * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC8.1, 8), 8), 8), 8), 8) + 3 * ((-4.235801 ^ 2) + (-4.235801 ^ 3)) * XAVG(XAVG(XAVG(XAVG(XAVGC8.1, 8), 8), 8), 8) - (6 * (-4.235801 ^ 2) + 3 * (-4.235801 + (-4.235801 ^ 3))) * XAVG(XAVG(XAVG(XAVGC8.1, 8), 8), 8) + (1 + 3 * -4.235801 + (-4.235801 ^ 3) + 3 * (-4.235801 ^ 2)) * XAVG(XAVG(XAVGC8.1, 8), 8)))
Thanks Bruce - that last one works great! I much appreciate your help. Chris
Good morning Bruce,
I am trying to write a Scan PCF filter for the following:
The T3-4-1.618 is crossing up through EITHER the T3-8-1.618 OR crossing up through the T3-6-1.272 within the last 3 bars. (but not necessarily through both, even though this could happen and should be condered as fulfilling the criteria even if both crosses are true).
Your help here would be appreciated. Thanks.
The basic structure of this would be:
CountTrue(XUP(T3-4-1.618, T3-8-1.618), 3) > 0 OR CountTrue(XUP(T3-4-1.618, T3-6-1.272), 3) > 0
CountTrue(XUP(
,
), 3) > 0 OR CountTrue(XUP(
), 3) > 0
But the formula is too long and slow to be practical or post in the forums.
I will try to paste in the T3 formulas and see what the outcome is.
Best regards, Chris
You're welcome.