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 |

2 Bar Slope of an EMA Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Chris55
Posted : Wednesday, April 4, 2018 10:17:55 AM
Registered User
Joined: 6/14/2016
Posts: 285
Hello Bruce,
 
Easy question today regading the slope of an EMA. What would be the Condition PCF to find:
 
the 2 bar slope of am EMA20 being positive ?
 
Any easy way to have an Indicator PCF with a histogram which goes to +1 when this slope is positive and signals -1 when it is negative (2bar EMA20 slope) ?
 
Many thanks for your help. Kid regards,
 
Chris 
StockGuy
Posted : Wednesday, April 4, 2018 10:24:01 AM

Administration

Joined: 9/30/2004
Posts: 9,187

Bruce is out the rest of this week.  He'll be back on Monday.

Chris55
Posted : Wednesday, April 4, 2018 10:58:53 AM
Registered User
Joined: 6/14/2016
Posts: 285

Hi StockGuy,

Thanks for the info. Can you help me with my two issues above?

Kind regards,

Chris 

StockGuy
Posted : Wednesday, April 4, 2018 11:05:12 AM

Administration

Joined: 9/30/2004
Posts: 9,187

SGN(XAVGC20 > XAVGC20.1) will return 1 when the 2-bar slope is positive and -1 when negative.

Chris55
Posted : Wednesday, April 4, 2018 11:57:34 AM
Registered User
Joined: 6/14/2016
Posts: 285

Thanks much. Can I use this as an Indicator PCF as well or just as a Conition/Scan PCF?

Chris 

StockGuy
Posted : Wednesday, April 4, 2018 12:05:30 PM

Administration

Joined: 9/30/2004
Posts: 9,187

Yes, you can use it in a Custom PCF Indicator.

Chris55
Posted : Tuesday, April 10, 2018 9:31:06 AM
Registered User
Joined: 6/14/2016
Posts: 285

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.

Chris 

Bruce_L
Posted : Tuesday, April 10, 2018 10:06:37 AM


Worden Trainer

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

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



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Chris55
Posted : Tuesday, April 10, 2018 11:11:03 AM
Registered User
Joined: 6/14/2016
Posts: 285

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.

Kind regards,

Chris

Bruce_L
Posted : Tuesday, April 10, 2018 11:23:10 AM


Worden Trainer

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

Put the entire formula inside the following:

XUP(put formula here , 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)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Chris55
Posted : Tuesday, April 10, 2018 11:35:18 AM
Registered User
Joined: 6/14/2016
Posts: 285

Many thanks, works like a charm.

Chris55
Posted : Tuesday, April 10, 2018 5:17:08 PM
Registered User
Joined: 6/14/2016
Posts: 285

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:

XUP(SGN(-(-4.235801 * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8), 8), 8) + 20.561175096* XAVG(XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8), 8) - 33.268947 * XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8) + 17.943573032* XAVG(XAVG(XAVGC8, 8), 8) - ( -(-4.235801 * XAVG(XAVG(XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8), 8), 8) + 20.561175096* XAVG(XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8), 8) - 33.268947 * XAVG(XAVG(XAVG(XAVGC8, 8), 8), 8) + 17.943573032* XAVG(XAVG(XAVGC8, 8), 8))) , 0)
 
Do you see what I did wrong?
Thanks,
Chris 

 

Bruce_L
Posted : Wednesday, April 11, 2018 9:56:06 AM


Worden Trainer

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

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)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Chris55
Posted : Wednesday, April 11, 2018 10:07:15 AM
Registered User
Joined: 6/14/2016
Posts: 285

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,

Chris 

Bruce_L
Posted : Wednesday, April 11, 2018 10:15:38 AM


Worden Trainer

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

The XUP() function is what is converting it into a condition.

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



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Chris55
Posted : Wednesday, April 11, 2018 10:23:19 AM
Registered User
Joined: 6/14/2016
Posts: 285

Thanks Bruce - that last one works great! I much appreciate your help. Chris 

Chris55
Posted : Friday, April 13, 2018 10:00:59 AM
Registered User
Joined: 6/14/2016
Posts: 285

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.

Chris 

Bruce_L
Posted : Friday, April 13, 2018 10:25:56 AM


Worden Trainer

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

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

But the formula is too long and slow to be practical or post in the forums.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Chris55
Posted : Friday, April 13, 2018 11:25:13 AM
Registered User
Joined: 6/14/2016
Posts: 285

Thanks Bruce,

I will try to paste in the T3 formulas and see what the outcome is.

Best regards, Chris 

Bruce_L
Posted : Friday, April 13, 2018 11:29:16 AM


Worden Trainer

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

You're welcome.



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