New version 17 available now


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


New account application Trading resources
Margin rates Stock & option commissions

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

Price and Momentum Divergence as a colorful row of horizontal dots Topic Rating:
Previous Topic · Next Topic Watch this topic · Print this topic ·
UnclePennybags
Posted : Monday, July 17, 2017 11:51:33 AM
Registered User
Joined: 6/30/2017
Posts: 721

Given the lack of looping and variables, I'm probably not able to create the divergence scan that will allow me to let my computer do all the work while I go golfing ... LOL! 

Elder's Impulse "System" has been done to death in these forums and on the internet. I've listed the rules below for those that need a refresher.

Over the weekend it occurred to me that a Impulse Blue Price Bar is, by definition, a "divergence" since it means that either Price is rising while Momentum is falling or Price is falling while Momentum is rising.

So Bruce, I'd like to plot a horizontal line of dots with three colors: (1) No divergence, (2) Bullish divergence, and (3) Bearish diveregence...

Row of "divergence dots" (patent pending, LOL)

  • Gray, no divergence
    • The defiinition of an Impulse Green Bar below, or
    • The definition of an Impulse Red Bar below
  • Green, bullish divergence, price falling, momentum rising
    • (13-period EMA < previous 13-period EMA) and 
    • (MACD-Histogram > previous period's MACD-Histogram)
  • Red, bearish divergence, price rising, momentum falling
    • (13-period EMA > previous 13-period EMA) and 
    • (MACD-Histogram < previous period's MACD-Histogram)

Doable? Thanks!

***

Elder Impulse:

  • Green Price Bar
    • (13-period EMA > previous 13-period EMA) and
    • (MACD-Histogram > previous period's MACD-Histogram)
  • Red Price Bar
    • (13-period EMA < previous 13-period EMA) and 
    • (MACD-Histogram < previous period's MACD-Histogram)
  • Blue Price Bar
    • Conditions for a Red Price Bar or Green Price Bar are not met. 
  • The MACD-Histogram is based on MACD(12,26,9). 
UnclePennybags
Posted : Monday, July 17, 2017 3:21:03 PM
Registered User
Joined: 6/30/2017
Posts: 721

Probably should've led with the lead :) ...

QUOTE (UnclePennybags)

Bruce, I'd like to plot a horizontal line of dots with three colors: (1) No divergence, (2) Bullish divergence, and (3) Bearish diveregence...

Row of "divergence dots" (patent pending, LOL)

  • Gray, no divergence
    • The defiinition of an Impulse Green Bar below, or
    • The definition of an Impulse Red Bar below
  • Green, bullish divergence, price falling, momentum rising
    • (13-period EMA < previous 13-period EMA) and 
    • (MACD-Histogram > previous period's MACD-Histogram)
  • Red, bearish divergence, price rising, momentum falling
    • (13-period EMA > previous 13-period EMA) and 
    • (MACD-Histogram < previous period's MACD-Histogram)
  • The MACD-Histogram is based on MACD(12,26,9). 

Doable? Thanks!

UnclePennybags
Posted : Tuesday, July 18, 2017 10:08:28 AM
Registered User
Joined: 6/30/2017
Posts: 721

Bruce, when you get a chance ... thanks!

UnclePennybags
Posted : Tuesday, July 18, 2017 11:27:17 AM
Registered User
Joined: 6/30/2017
Posts: 721

?

Bruce_L
Posted : Tuesday, July 18, 2017 11:51:32 AM


Worden Trainer

Joined: 10/7/2004
Posts: 60,371

You will want to plot the following Custom PCF Indicators in the same scale and pane as each other, but in a separate pane from same price.

- Plot Style: Dot
- Plot Color: Green
- Period: 1
- Formula: 0 / ABS(C > XAVGC13.1 AND 119 * C + 765 * XAVGC12.1 > 65 * XAVGC26.1 + 819 * XAVGC9.1)

- Plot Style: Dot
- Plot Color: Red
- Period: 1
- Formula: 0 / ABS(C < XAVGC13.1 AND 119 * C + 765 * XAVGC12.1 < 65 * XAVGC26.1 + 819 * XAVGC9.1)

- Plot Style: Dot
- Plot Color: Blue
- Period: 1
- Formula: 0 / ABS(SGN(C - XAVGC13.1) <> SGN(119 * C + 765 * XAVGC12.1 - 65 * XAVGC26.1 - 819 * XAVGC9.1))

Plotting Elder Impulse



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
UnclePennybags
Posted : Tuesday, July 18, 2017 11:56:15 AM
Registered User
Joined: 6/30/2017
Posts: 721

Awesome. Thanks, Bruce!

When "Divergence Dots" take over the world, I'll give you a cut :)

jbem777
Posted : Tuesday, July 18, 2017 12:47:41 PM
Platinum Customer Platinum Customer

Joined: 7/9/2017
Posts: 12

Love this concept. Very easy to understand and can make chart review quick and efficient. Building upon this idea, I was hoping for some assistance in developing a similar system.

I would like the C to have a 6 period LR < 0 to indicate that price has been decline. I plan on adjusting this value but understand how to create it.

(2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0

Then have dots indicate when there is a TSV, BOP, or RSI divergence with price. Additionally, I would like to have a TSV20 6 period LR to be greater than the TSV20 20 Period LR to help identify an overall uptrend in TSV. My base equation is the TSV20 and Price Divergence described below.

TSV20 & Price Divergence: C 6LR < 0, TSV20 6LR > 0, & TSV20 6LR > TSV20 20LR

(2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0 AND (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 >  0 AND  (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 >  (9.5 * TSV20 + 8.5 * TSV20.1 + 7.5 * TSV20.2 + 6.5 * TSV20.3 + 5.5 * TSV20.4 + 4.5 * TSV20.5 + 3.5 * TSV20.6 + 2.5 * TSV20.7 + 1.5 * TSV20.8 + .5 * TSV20.9 - .5 * TSV20.10 - 1.5 * TSV20.11 - 2.5 * TSV20.12 -3.5 * TSV20.13 - 4.5 * TSV20.14 - 5.5 * TSV20.15 - 6.5 * TSV20.16 - 7.5 * TSV20.17 - 8.5 * TSV20.18 - 9.5 * TSV20.19) / 665

This would show price and TSV divergence and could be green.

TSV20 & RSI14 Divergence with Price: C 6LR < 0,  TSV20 6LR > 0, RSI14 6LR > 0, & TSV20 6LR > TSV20 20LR

(2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0 AND (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 >  0 AND (2.5 * RSI14 + 1.5 * RSI14.1 + .5 * RSI14.2 - .5 * RSI14.3 - 1.5 * RSI14.4 - 2.5 * RSI14.5) / 17.5  >  0 AND  (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 >  (9.5 * TSV20 + 8.5 * TSV20.1 + 7.5 * TSV20.2 + 6.5 * TSV20.3 + 5.5 * TSV20.4 + 4.5 * TSV20.5 + 3.5 * TSV20.6 + 2.5 * TSV20.7 + 1.5 * TSV20.8 + .5 * TSV20.9 - .5 * TSV20.10 - 1.5 * TSV20.11 - 2.5 * TSV20.12 -3.5 * TSV20.13 - 4.5 * TSV20.14 - 5.5 * TSV20.15 - 6.5 * TSV20.16 - 7.5 * TSV20.17 - 8.5 * TSV20.18 - 9.5 * TSV20.19) / 665

This would show TSV, RSI, and Price divergence and could be yellow.

TSV20 & BOP Divergence with Price C 6LR < 0,  TSV20 6LR > 0, BOP 6LR > 0, & TSV20 6LR > TSV20 20LR

(2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0 AND (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 >  0 AND (2.5 * BOP1 + 1.5 * BOP1.1 + .5 * BOP1.2 - .5 * BOP1.3 - 1.5 * BOP1.4 - 2.5 * BOP1.5 )>  / 17.5  >  0 AND  (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 >  (9.5 * TSV20 + 8.5 * TSV20.1 + 7.5 * TSV20.2 + 6.5 * TSV20.3 + 5.5 * TSV20.4 + 4.5 * TSV20.5 + 3.5 * TSV20.6 + 2.5 * TSV20.7 + 1.5 * TSV20.8 + .5 * TSV20.9 - .5 * TSV20.10 - 1.5 * TSV20.11 - 2.5 * TSV20.12 -3.5 * TSV20.13 - 4.5 * TSV20.14 - 5.5 * TSV20.15 - 6.5 * TSV20.16 - 7.5 * TSV20.17 - 8.5 * TSV20.18 - 9.5 * TSV20.19) / 665

This would show TSV, BOP, and Price Divergence and could be red.

It is also possible that all these conditions be true at one time and thus the PCF could be:

(2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0 AND (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 >  0 AND (2.5 * RSI14 + 1.5 * RSI14.1 + .5 * RSI14.2 - .5 * RSI14.3 - 1.5 * RSI14.4 - 2.5 * RSI14.5) / 17.5  >  0 AND (2.5 * BOP1 + 1.5 * BOP1.1 + .5 * BOP1.2 - .5 * BOP1.3 - 1.5 * BOP1.4 - 2.5 * BOP1.5 )>  / 17.5  >  0 AND  (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 >  (9.5 * TSV20 + 8.5 * TSV20.1 + 7.5 * TSV20.2 + 6.5 * TSV20.3 + 5.5 * TSV20.4 + 4.5 * TSV20.5 + 3.5 * TSV20.6 + 2.5 * TSV20.7 + 1.5 * TSV20.8 + .5 * TSV20.9 - .5 * TSV20.10 - 1.5 * TSV20.11 - 2.5 * TSV20.12 -3.5 * TSV20.13 - 4.5 * TSV20.14 - 5.5 * TSV20.15 - 6.5 * TSV20.16 - 7.5 * TSV20.17 - 8.5 * TSV20.18 - 9.5 * TSV20.19) / 665

This could be blue.

My goal is to combine the presence of these divergences during a TTM Squeeze to help identify situations that may result in explosive breakouts.

So after all the detail above, how might I set this up? Any feedback would also be appreciated. Thanks!

 

 

 

UnclePennybags
Posted : Tuesday, July 18, 2017 1:02:30 PM
Registered User
Joined: 6/30/2017
Posts: 721

Wow, that's impressive. Lots of dots. :)

Bruce_L
Posted : Tuesday, July 18, 2017 1:20:55 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,371

One of the nice things about a row of dots is that you can have lots of rows of dots in the same pane without the dots being on top of each other as long as you plots the rows of dots at different values (for example rows at 0, 1, 2, 3, 4, 5, & 6).

Since you already have the formulas, you can just use the following template.

(value at which you wish to plot the dot) / ABS(your condition formula here)

If you want different colored dots plotted in a single line, you use the same value. If you want multiple lines of dots, you use a different value for eac line you want to plot.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
UnclePennybags
Posted : Tuesday, July 18, 2017 1:32:53 PM
Registered User
Joined: 6/30/2017
Posts: 721

Yeah, some day I'll have a layout with nothing but dots. Just condition columns with dots, and a chart with dots, and price's opcacity dialed down. :)

jbem777
Posted : Tuesday, July 18, 2017 4:17:28 PM
Platinum Customer Platinum Customer

Joined: 7/9/2017
Posts: 12

QUOTE (Bruce_L)

One of the nice things about a row of dots is that you can have lots of rows of dots in the same pane without the dots being on top of each other as long as you plots the rows of dots at different values (for example rows at 0, 1, 2, 3, 4, 5, & 6).

Since you already have the formulas, you can just use the following template.

(value at which you wish to plot the dot) / ABS(your condition formula here)

If you want different colored dots plotted in a single line, you use the same value. If you want multiple lines of dots, you use a different value for eac line you want to plot.

 

Thank you! I am almost there but am having trouble figuring out how to plot the rows at different values. How would I do that?

Bruce_L
Posted : Tuesday, July 18, 2017 4:21:09 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,371

First, make sure the Custom PCF Indicators are plotted in the same pane and scale as each other.

Second, change the part before the / ABS in the formula to be the value at which you want to plot the dots.

For example, if you wanted to plot your first formula as a row of dots at a value of 0:

0 / ABS((2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0)

And your second formula as a row of dots at a value of 1.

1 / ABS((2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0 AND (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 > 0 AND (2.5 * TSV20 + 1.5 * TSV20.1 + .5 * TSV20.2 - .5 * TSV20.3 - 1.5 * TSV20.4 - 2.5 * TSV20.5) / 17.5 > (9.5 * TSV20 + 8.5 * TSV20.1 + 7.5 * TSV20.2 + 6.5 * TSV20.3 + 5.5 * TSV20.4 + 4.5 * TSV20.5 + 3.5 * TSV20.6 + 2.5 * TSV20.7 + 1.5 * TSV20.8 + .5 * TSV20.9 - .5 * TSV20.10 - 1.5 * TSV20.11 - 2.5 * TSV20.12 -3.5 * TSV20.13 - 4.5 * TSV20.14 - 5.5 * TSV20.15 - 6.5 * TSV20.16 - 7.5 * TSV20.17 - 8.5 * TSV20.18 - 9.5 * TSV20.19) / 665)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
UnclePennybags
Posted : Tuesday, July 18, 2017 4:21:56 PM
Registered User
Joined: 6/30/2017
Posts: 721

Just add 1 to one of your PCFs. add 2 to another PCF, add 3 to a third PCF, etc.

Hope that makes sense; Bruce will be along in a minute to explain it better. :)

UnclePennybags
Posted : Tuesday, July 18, 2017 4:23:54 PM
Registered User
Joined: 6/30/2017
Posts: 721

Hey, I was close. LOL.

jbem777
Posted : Tuesday, July 18, 2017 4:36:51 PM
Platinum Customer Platinum Customer

Joined: 7/9/2017
Posts: 12

When I use that formula, with the 1 in the front, I recieve this error message " An error occured calculating formula. Divide by 0

Bruce_L
Posted : Tuesday, July 18, 2017 4:45:41 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,371

You will get the same error message using the formula with the 0 in front of it. This is on purpose and required for the formula to work as intended in TC2000 v12.

What happens is that ABS((2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0) for example returns 1 when (2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0 is true and 0 when it false.

This makes it so 0 / ABS((2.5 * C+ 1.5 * C.1 + .5 * C2 - .5 * C3 - 1.5 * C4 - 2.5 * C5) / 17.5 < 0) returns 0 when true and a division by zero error when false.

This is desirable because the dot (or histogram bar) doesn't get plotted when there is an error produced when calculating the formula. So you get a dot plotted when true and nothing plotted when false.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jbem777
Posted : Tuesday, July 18, 2017 4:50:19 PM
Platinum Customer Platinum Customer

Joined: 7/9/2017
Posts: 12

Gotcha! I got it working for now...I think. Thanks for the insight.

UnclePennybags
Posted : Tuesday, July 18, 2017 4:55:11 PM
Registered User
Joined: 6/30/2017
Posts: 721

Try telling my grade school math teacher that divide-by-zero is desirable. LOL.

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.