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 |

Help with my 1st strategy Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
vpi63
Posted : Saturday, August 11, 2007 1:22:01 PM
Registered User
Joined: 3/15/2005
Posts: 33
I would like to construct a a strategy that uses williams % R of price that gives a buy each time it crosses > -80, and a sell each tiome it crosses <-20.

BTW, what is the difference between williams % R and Williams percent of price?

TIA for your help.

VPI63
Kuf
Posted : Sunday, August 12, 2007 12:16:34 PM


Administration

Joined: 9/18/2004
Posts: 3,522
For the strategy:

Load the Williams % R strategy condition. Left click on the condition and change the 'Less Than' to 'Crossing up through'. Change the -20 to -80

Load the same for the sell signal and again change the approprite values.

Williams %R lets you load and apply the calculation to any indicator (not just price). %R of price is your traditional indicator.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
jimlou6
Posted : Thursday, December 13, 2007 3:57:58 PM
Registered User
Joined: 3/8/2005
Posts: 10
QUOTE (Kuf)
For the strategy:

Load the Williams % R strategy condition. Left click on the condition and change the 'Less Than' to 'Crossing up through'. Change the -20 to -80

Load the same for the sell signal and again change the approprite values.

Williams %R lets you load and apply the calculation to any indicator (not just price). %R of price is your traditional indicator.


Could we have this formula for TeleChart?  I need this Williams %R with -20 to -80 for TeleChart.

Thanks,

James
Bruce_L
Posted : Thursday, December 13, 2007 4:05:00 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
jimlou6,
Williams %R is just the raw Stochastic - 100. So (using a 10-Period Williams %R as an example):

10-Period Williams %R xUp -20:

STOC10 - 100 > (-20) AND STOC10.1.1 - 100 <= (-20)

10-Period Williams %R xUp -80:

STOC10 - 100 > (-80) AND STOC10.1.1 - 100 <= (-80)

10-Period Williams %R xDn -20:

STOC10 - 100 < (-20) AND STOC10.1.1 - 100 >= (-20)

10-Period Williams %R xDn -80:

STOC10 - 100 < (-80) AND STOC10.1.1 - 100 >= (-80)

These formulas can be simplified:

10-Period Williams %R xUp -20:

STOC10 > 80 AND STOC10.1.1 <= 80

10-Period Williams %R xUp -80:

STOC10 > 20 AND STOC10.1.1 <= 20

10-Period Williams %R xDn -20:

STOC10 < 80 AND STOC10.1.1 >= 80

10-Period Williams %R xDn -80:

STOC10 < 20 AND STOC10.1.1 >= 20

You may wish to review the following:

How to create a Personal Criteria Forumula (PCF)
Understanding Stochastics
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jimlou6
Posted : Thursday, December 13, 2007 6:21:16 PM
Registered User
Joined: 3/8/2005
Posts: 10
Bruce,

   Thanks for the formula.  If I want to plot this Williams %R on the Chart as Custom Indicators, how to plot the value on the chart?  I can't used the above formula to plot the chart because it return the boolean.

Thanks again,

James
Bruce_L
Posted : Friday, December 14, 2007 9:09:04 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
jimlou6,
For a 10-Period Williams %R, you could just plot STOC10 - 100 as a standard Custom Indicator:

Select Chart Template | Add Indicator | Indicator.
- Visible: Checked
- Center Zero Line: Unchceked
- Plot using price scale: Unchecked
- Smoothing Average: 1
- Average Type: Doesn't matter (because the Smoothing Average is 1)
- Indicator Formula: STOC10 - 100

Another option might be to just add the built in Stochastic indicator and adjust it mentally. The Stochastic will run from 0 to 100 while the Williams %R will be autoscaled (although this may not matter with a short enough Period vs Zoom). You may wish to review the following:

Plotting Custom Indicators with Examples

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jimlou6
Posted : Saturday, December 15, 2007 9:57:47 PM
Registered User
Joined: 3/8/2005
Posts: 10
Bruce,

   Thanks for the help.  How can I change the lines to indicate -20 and -80 in Custom Indicator for William %R?

James
Bruce_L
Posted : Monday, December 17, 2007 9:28:24 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
jimlou6,
If you add a Stochastic to the chart, it will draw lines at -20 and -80 as long as the Williams %R runs from -100 to 0 on the visible portion of the chart. Normally I would suggest unchecking visible for the Stochastic, but in this case I would recommend setting the Stochastic Period to Williams %R Period and the SK and SD Periods to 1. The Stochastic and Williams %R should line up. If they do not line up, you will know the -20 and -80 lines are in the wrong place for your Williams %R.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jimlou6
Posted : Wednesday, December 19, 2007 6:37:31 PM
Registered User
Joined: 3/8/2005
Posts: 10
Bruce,

   Thanks for the information.  I used the Custom Indicator (STOC10 - 100) you provide to plot the William %R.  It plot 3 lines with different numbers.  How can I change the Custom Indicator to plot 2 lines with -20 and -80?

Thanks again,

James
Bruce_L
Posted : Wednesday, December 19, 2007 6:45:19 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The Custom Indicator will range from the lowest to the highest visible value and place lines at 25%, 50% and 75% percent of the range. I do not know of a way to make these lines go away when plotting a Custom Indicator.

The Stochastic will Plot lines at 20 and 80. This corresponds to -80 and -20 for a William's %R. Adding the Stochastic to the same Pane adds the 20 and 80 lines but doesn't make the Custom Indicator Lines go away. If you only want lines at 20 (-80) and 80 (-20), my only suggestion is to just plot the Stochastic and subtract 100 from the values in your head. Stochastics and William's %R are exactly the same indicator with a slightly different method of displaying the scale (Stochastic runs from 0 to 100 while William's %R runs from -100 to 0).

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jimlou6
Posted : Friday, December 28, 2007 3:03:49 PM
Registered User
Joined: 3/8/2005
Posts: 10
Hi Bruce,

   Thanks for the help. I just use Stoch. by keep in mind the 20 (-80) and 80 (-20).

   If I want to scan from the above 80 the day before cross below 80 today, is this formula will do this.

   STOC10.1.1 >= 80 and STOC10 < 80

   Other scan is from below 20 the day before and cross above 20 today.

   STOC10.1.1 <= 20 AND STOCK10 > 20

Thanks,

James
Bruce_L
Posted : Friday, December 28, 2007 3:05:13 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Your formulas appear to be correct.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jimlou6
Posted : Tuesday, January 1, 2008 3:53:49 PM
Registered User
Joined: 3/8/2005
Posts: 10
Hi Bruce,

   I used Stoch. 21,10,10 formula with exponential to scan the stocks and plot the Stoch. 21,10,10 with cross over.  The plots is not match the scan.  Do you know what's the problem?  If I change to simple, it match.

Thanks,

James
Bruce_L
Posted : Tuesday, January 1, 2008 4:18:16 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
jimlou6,
The most useful indicators and functions in TeleChart's Personal Criteria Formula Language for producing Stochastics formulas are:

STOCx.y.z -> Simple Stochastic
AVG(w,x) -> Simple Moving Average
XAVG(w,x) -> Exponential moving Average

Where w is the Number or Indicator to which a Function is applied.
- w cannot be a formula or function for AVG(), XAVG()
Where x is the Period of the Indicator or Function.
Where y is a the Period of an additional Simple Moving Average.
Where z is the number of Periods Ago.
- z can also be a date. May 3, 2007 would be (single quotes required): '05/03/07'

The arguments in indicators are separated by periods while the arguments in functions are separated by commas.

You already noticed that the formula you wrote matched a charted Simple Stochastic. Since a Simple and Exponential Stochastic use different types of Moving Averages, they aren't going to be the same, meaning the same formula will not represent both types of Stochastics. The fact that the XAVG() function cannot take a formula or function as an argument means at least one of the Exponential Moving Averages will need to be expanded if the periods are the same (and in this case, they are both 10).

Exponential Stochastic 21,10,10 SK xUp SD:

XAVG(STOC21,10) > .181980276277401 * (XAVG(STOC21.1.0,10) + 9 / 11 * (XAVG(STOC21.1.1,10) + 9 / 11 * (XAVG(STOC21.1.2,10) + 9 / 11 * (XAVG(STOC21.1.3,10) + 9 / 11 * (XAVG(STOC21.1.4,10) + 9 / 11 * (XAVG(STOC21.1.5,10) + 9 / 11 * (XAVG(STOC21.1.6,10) + 9 / 11 * (XAVG(STOC21.1.7,10) + 9 / 11 * (XAVG(STOC21.1.8,10) + 9 / 11 * (XAVG(STOC21.1.9,10) + 9 / 11 * (XAVG(STOC21.1.10,10) + 9 / 11 * (XAVG(STOC21.1.11,10) + 9 / 11 * (XAVG(STOC21.1.12,10) + 9 / 11 * (XAVG(STOC21.1.13,10) + 9 / 11 * (XAVG(STOC21.1.14,10) + 9 / 11 * (XAVG(STOC21.1.15,10) + 9 / 11 * (XAVG(STOC21.1.16,10) + 9 / 11 * (XAVG(STOC21.1.17,10) + 9 / 11 * (XAVG(STOC21.1.18,10) + 9 / 11 * (XAVG(STOC21.1.19,10) + 9 / 11 * (XAVG(STOC21.1.20,10) + 9 / 11 * (XAVG(STOC21.1.21,10) + 9 / 11 * (XAVG(STOC21.1.22,10) + 9 / 11 * (XAVG(STOC21.1.23,10) + 9 / 11 * (XAVG(STOC21.1.24,10) + 9 / 11 * (XAVG(STOC21.1.25,10) + 9 / 11 * (XAVG(STOC21.1.26,10) + 9 / 11 * (XAVG(STOC21.1.27,10) + 9 / 11 * (XAVG(STOC21.1.28,10) + 9 / 11 * (XAVG(STOC21.1.29,10) + 9 / 11 * (XAVG(STOC21.1.30,10) + 9 / 11 * (XAVG(STOC21.1.31,10) + 9 / 11 * (XAVG(STOC21.1.32,10) + 9 / 11 * (XAVG(STOC21.1.33,10) + 9 / 11 * (XAVG(STOC21.1.34,10)))))))))))))))))))))))))))))))))))) AND XAVG(STOC21.1.1,10) <= .181980276277401 * (XAVG(STOC21.1.1,10) + 9 / 11 * (XAVG(STOC21.1.2,10) + 9 / 11 * (XAVG(STOC21.1.3,10) + 9 / 11 * (XAVG(STOC21.1.4,10) + 9 / 11 * (XAVG(STOC21.1.5,10) + 9 / 11 * (XAVG(STOC21.1.6,10) + 9 / 11 * (XAVG(STOC21.1.7,10) + 9 / 11 * (XAVG(STOC21.1.8,10) + 9 / 11 * (XAVG(STOC21.1.9,10) + 9 / 11 * (XAVG(STOC21.1.10,10) + 9 / 11 * (XAVG(STOC21.1.11,10) + 9 / 11 * (XAVG(STOC21.1.12,10) + 9 / 11 * (XAVG(STOC21.1.13,10) + 9 / 11 * (XAVG(STOC21.1.14,10) + 9 / 11 * (XAVG(STOC21.1.15,10) + 9 / 11 * (XAVG(STOC21.1.16,10) + 9 / 11 * (XAVG(STOC21.1.17,10) + 9 / 11 * (XAVG(STOC21.1.18,10) + 9 / 11 * (XAVG(STOC21.1.19,10) + 9 / 11 * (XAVG(STOC21.1.20,10) + 9 / 11 * (XAVG(STOC21.1.21,10) + 9 / 11 * (XAVG(STOC21.1.22,10) + 9 / 11 * (XAVG(STOC21.1.23,10) + 9 / 11 * (XAVG(STOC21.1.24,10) + 9 / 11 * (XAVG(STOC21.1.25,10) + 9 / 11 * (XAVG(STOC21.1.26,10) + 9 / 11 * (XAVG(STOC21.1.27,10) + 9 / 11 * (XAVG(STOC21.1.28,10) + 9 / 11 * (XAVG(STOC21.1.29,10) + 9 / 11 * (XAVG(STOC21.1.30,10) + 9 / 11 * (XAVG(STOC21.1.31,10) + 9 / 11 * (XAVG(STOC21.1.32,10) + 9 / 11 * (XAVG(STOC21.1.33,10) + 9 / 11 * (XAVG(STOC21.1.34,10) + 9 / 11 * (XAVG(STOC21.1.35,10))))))))))))))))))))))))))))))))))))

Exponential Stochastic 21,10,10 SK xDn SD:

XAVG(STOC21,10) < .181980276277401 * (XAVG(STOC21.1.0,10) + 9 / 11 * (XAVG(STOC21.1.1,10) + 9 / 11 * (XAVG(STOC21.1.2,10) + 9 / 11 * (XAVG(STOC21.1.3,10) + 9 / 11 * (XAVG(STOC21.1.4,10) + 9 / 11 * (XAVG(STOC21.1.5,10) + 9 / 11 * (XAVG(STOC21.1.6,10) + 9 / 11 * (XAVG(STOC21.1.7,10) + 9 / 11 * (XAVG(STOC21.1.8,10) + 9 / 11 * (XAVG(STOC21.1.9,10) + 9 / 11 * (XAVG(STOC21.1.10,10) + 9 / 11 * (XAVG(STOC21.1.11,10) + 9 / 11 * (XAVG(STOC21.1.12,10) + 9 / 11 * (XAVG(STOC21.1.13,10) + 9 / 11 * (XAVG(STOC21.1.14,10) + 9 / 11 * (XAVG(STOC21.1.15,10) + 9 / 11 * (XAVG(STOC21.1.16,10) + 9 / 11 * (XAVG(STOC21.1.17,10) + 9 / 11 * (XAVG(STOC21.1.18,10) + 9 / 11 * (XAVG(STOC21.1.19,10) + 9 / 11 * (XAVG(STOC21.1.20,10) + 9 / 11 * (XAVG(STOC21.1.21,10) + 9 / 11 * (XAVG(STOC21.1.22,10) + 9 / 11 * (XAVG(STOC21.1.23,10) + 9 / 11 * (XAVG(STOC21.1.24,10) + 9 / 11 * (XAVG(STOC21.1.25,10) + 9 / 11 * (XAVG(STOC21.1.26,10) + 9 / 11 * (XAVG(STOC21.1.27,10) + 9 / 11 * (XAVG(STOC21.1.28,10) + 9 / 11 * (XAVG(STOC21.1.29,10) + 9 / 11 * (XAVG(STOC21.1.30,10) + 9 / 11 * (XAVG(STOC21.1.31,10) + 9 / 11 * (XAVG(STOC21.1.32,10) + 9 / 11 * (XAVG(STOC21.1.33,10) + 9 / 11 * (XAVG(STOC21.1.34,10)))))))))))))))))))))))))))))))))))) AND XAVG(STOC21.1.1,10) >= .181980276277401 * (XAVG(STOC21.1.1,10) + 9 / 11 * (XAVG(STOC21.1.2,10) + 9 / 11 * (XAVG(STOC21.1.3,10) + 9 / 11 * (XAVG(STOC21.1.4,10) + 9 / 11 * (XAVG(STOC21.1.5,10) + 9 / 11 * (XAVG(STOC21.1.6,10) + 9 / 11 * (XAVG(STOC21.1.7,10) + 9 / 11 * (XAVG(STOC21.1.8,10) + 9 / 11 * (XAVG(STOC21.1.9,10) + 9 / 11 * (XAVG(STOC21.1.10,10) + 9 / 11 * (XAVG(STOC21.1.11,10) + 9 / 11 * (XAVG(STOC21.1.12,10) + 9 / 11 * (XAVG(STOC21.1.13,10) + 9 / 11 * (XAVG(STOC21.1.14,10) + 9 / 11 * (XAVG(STOC21.1.15,10) + 9 / 11 * (XAVG(STOC21.1.16,10) + 9 / 11 * (XAVG(STOC21.1.17,10) + 9 / 11 * (XAVG(STOC21.1.18,10) + 9 / 11 * (XAVG(STOC21.1.19,10) + 9 / 11 * (XAVG(STOC21.1.20,10) + 9 / 11 * (XAVG(STOC21.1.21,10) + 9 / 11 * (XAVG(STOC21.1.22,10) + 9 / 11 * (XAVG(STOC21.1.23,10) + 9 / 11 * (XAVG(STOC21.1.24,10) + 9 / 11 * (XAVG(STOC21.1.25,10) + 9 / 11 * (XAVG(STOC21.1.26,10) + 9 / 11 * (XAVG(STOC21.1.27,10) + 9 / 11 * (XAVG(STOC21.1.28,10) + 9 / 11 * (XAVG(STOC21.1.29,10) + 9 / 11 * (XAVG(STOC21.1.30,10) + 9 / 11 * (XAVG(STOC21.1.31,10) + 9 / 11 * (XAVG(STOC21.1.32,10) + 9 / 11 * (XAVG(STOC21.1.33,10) + 9 / 11 * (XAVG(STOC21.1.34,10) + 9 / 11 * (XAVG(STOC21.1.35,10))))))))))))))))))))))))))))))))))))

Exponential Stochastic 21,10,10 SK crossing SD (either direction):

SGN(XAVG(STOC21,10) - .181980276277401 * (XAVG(STOC21.1.0,10) + 9 / 11 * (XAVG(STOC21.1.1,10) + 9 / 11 * (XAVG(STOC21.1.2,10) + 9 / 11 * (XAVG(STOC21.1.3,10) + 9 / 11 * (XAVG(STOC21.1.4,10) + 9 / 11 * (XAVG(STOC21.1.5,10) + 9 / 11 * (XAVG(STOC21.1.6,10) + 9 / 11 * (XAVG(STOC21.1.7,10) + 9 / 11 * (XAVG(STOC21.1.8,10) + 9 / 11 * (XAVG(STOC21.1.9,10) + 9 / 11 * (XAVG(STOC21.1.10,10) + 9 / 11 * (XAVG(STOC21.1.11,10) + 9 / 11 * (XAVG(STOC21.1.12,10) + 9 / 11 * (XAVG(STOC21.1.13,10) + 9 / 11 * (XAVG(STOC21.1.14,10) + 9 / 11 * (XAVG(STOC21.1.15,10) + 9 / 11 * (XAVG(STOC21.1.16,10) + 9 / 11 * (XAVG(STOC21.1.17,10) + 9 / 11 * (XAVG(STOC21.1.18,10) + 9 / 11 * (XAVG(STOC21.1.19,10) + 9 / 11 * (XAVG(STOC21.1.20,10) + 9 / 11 * (XAVG(STOC21.1.21,10) + 9 / 11 * (XAVG(STOC21.1.22,10) + 9 / 11 * (XAVG(STOC21.1.23,10) + 9 / 11 * (XAVG(STOC21.1.24,10) + 9 / 11 * (XAVG(STOC21.1.25,10) + 9 / 11 * (XAVG(STOC21.1.26,10) + 9 / 11 * (XAVG(STOC21.1.27,10) + 9 / 11 * (XAVG(STOC21.1.28,10) + 9 / 11 * (XAVG(STOC21.1.29,10) + 9 / 11 * (XAVG(STOC21.1.30,10) + 9 / 11 * (XAVG(STOC21.1.31,10) + 9 / 11 * (XAVG(STOC21.1.32,10) + 9 / 11 * (XAVG(STOC21.1.33,10) + 9 / 11 * (XAVG(STOC21.1.34,10))))))))))))))))))))))))))))))))))))) <> SGN(XAVG(STOC21.1.1,10) - .181980276277401 * (XAVG(STOC21.1.1,10) + 9 / 11 * (XAVG(STOC21.1.2,10) + 9 / 11 * (XAVG(STOC21.1.3,10) + 9 / 11 * (XAVG(STOC21.1.4,10) + 9 / 11 * (XAVG(STOC21.1.5,10) + 9 / 11 * (XAVG(STOC21.1.6,10) + 9 / 11 * (XAVG(STOC21.1.7,10) + 9 / 11 * (XAVG(STOC21.1.8,10) + 9 / 11 * (XAVG(STOC21.1.9,10) + 9 / 11 * (XAVG(STOC21.1.10,10) + 9 / 11 * (XAVG(STOC21.1.11,10) + 9 / 11 * (XAVG(STOC21.1.12,10) + 9 / 11 * (XAVG(STOC21.1.13,10) + 9 / 11 * (XAVG(STOC21.1.14,10) + 9 / 11 * (XAVG(STOC21.1.15,10) + 9 / 11 * (XAVG(STOC21.1.16,10) + 9 / 11 * (XAVG(STOC21.1.17,10) + 9 / 11 * (XAVG(STOC21.1.18,10) + 9 / 11 * (XAVG(STOC21.1.19,10) + 9 / 11 * (XAVG(STOC21.1.20,10) + 9 / 11 * (XAVG(STOC21.1.21,10) + 9 / 11 * (XAVG(STOC21.1.22,10) + 9 / 11 * (XAVG(STOC21.1.23,10) + 9 / 11 * (XAVG(STOC21.1.24,10) + 9 / 11 * (XAVG(STOC21.1.25,10) + 9 / 11 * (XAVG(STOC21.1.26,10) + 9 / 11 * (XAVG(STOC21.1.27,10) + 9 / 11 * (XAVG(STOC21.1.28,10) + 9 / 11 * (XAVG(STOC21.1.29,10) + 9 / 11 * (XAVG(STOC21.1.30,10) + 9 / 11 * (XAVG(STOC21.1.31,10) + 9 / 11 * (XAVG(STOC21.1.32,10) + 9 / 11 * (XAVG(STOC21.1.33,10) + 9 / 11 * (XAVG(STOC21.1.34,10) + 9 / 11 * (XAVG(STOC21.1.35,10)))))))))))))))))))))))))))))))))))))

You may wish to review the following:

Cascades of Moving Averages

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