Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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.
|
|
Registered User Joined: 9/17/2010 Posts: 484
|
This might help you get started:
http://forums.worden.com/default.aspx?g=posts&t=57592
|
|
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
|
|
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?
|
|
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
|
|
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.
|
|
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
|
|
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?
|
|
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
|
|
Guest-1 |