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 |

Swing High & Swing Lows Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
rcbenjamin1220
Posted : Saturday, November 18, 2017 10:47:25 AM
Registered User
Joined: 1/20/2016
Posts: 47

How do I get a plot of a swing high (higher than 6 or more bars to the left and right of it) and a swing low (lower than 30 bar or more to the left of it and lower than 20 bars or more bars to the right of it) on a chart.  I want the PCF to plot the value of that swing high and the value of that swing low as soon as the conditions are met which means that a swing low cannot be determined until 20 bars have past and that a swing high cannot be determined until 6 bars have past.  The PCF value will be zero until the swing occurs.

bcochrane
Posted : Saturday, November 18, 2017 4:54:59 PM
Registered User
Joined: 9/17/2010
Posts: 484

This might help you get started:

http://forums.worden.com/default.aspx?g=posts&t=57592

Bruce_L
Posted : Monday, November 20, 2017 10:43:51 AM


Worden Trainer

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

You could plot these as Custom PCF Indicators in the same pane and scale as price.

For your swing high:

IIF(MAXH6 < H6 AND H6 > MAXH6.7, H6, 0)

For your swing low:

IIF(MINL20 > L20 AND L20 < MINL30.21, L20, 0)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
rcbenjamin1220
Posted : Monday, November 20, 2017 4:55:06 PM
Registered User
Joined: 1/20/2016
Posts: 47

The formula plots a dot for the swing high 6 bars away from it and not actually on the swing high as requested.  How can I get it to plot it actually on the swing high?

Bruce_L
Posted : Monday, November 20, 2017 5:03:39 PM


Worden Trainer

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

Seriously, I thought you were pretty darned specific in not wanting it to plot until 6 and 20 bars after the swing high and swing low.

To get the dots at the correct points, you have to add 1 period simple moving averages to the Custom PCF Indicators. Set the Offset to -6 for the swing high and -20 for the swing low.

You will probably want to set the Opacity of the Custom PCF Indicators themselves all the way to the left so those dots don't show.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
rcbenjamin1220
Posted : Monday, November 20, 2017 5:11:51 PM
Registered User
Joined: 1/20/2016
Posts: 47

Sorry for the confusion.  Would you update the formula with the actual negative offset because I must be doing something wrong.

Bruce_L
Posted : Monday, November 20, 2017 5:27:54 PM


Worden Trainer

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

There isn't a way to put a negative offset in the formula itself. That is why you have to add the 1 period moving average and put the negative offset there instead.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
rcbenjamin1220
Posted : Monday, November 20, 2017 5:42:06 PM
Registered User
Joined: 1/20/2016
Posts: 47

Ok.  It worked. What PCF can be used to determine if the most recent Pivot High or Swing Low has occurred during the last 13 bars?

Bruce_L
Posted : Tuesday, November 21, 2017 9:17:48 AM


Worden Trainer

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

Well by definition, the most recent swing low cannot have actually occurred during the most recent 13 bars since it has to happened it least 20 bars ago. For the swing high, we could use the following.

CountTrue(MAXH6 < H6 AND H6 > MAXH6.7, 7) > 0

The following would return true if a swing high was detected in the most recent 13 bars.

CountTrue(MAXH6 < H6 AND H6 > MAXH6.7, 13) > 0

And if a swing low was detected in the most recent 13 bars

CountTrue(MINL20 > L20 AND L20 < MINL30.21, 13) > 0



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