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 |

UP 12 out of 15 days Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
thnkbigr
Posted : Monday, January 7, 2013 2:16:57 AM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

How do I write a rule in TC that turns true when price is up 12 out of 15 days or more?

 

Thx

Bruce_L
Posted : Monday, January 7, 2013 11:22:15 AM


Worden Trainer

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

It depends on what you mean by up and if you need to have a single monolithic Condition Formula or you are willing to create a Condition based on a shorter Condition Formula used as the Boolean Formula in a Custom PCF % True Indicator.

Let's start with a longer formula based on the close being above the close of the previous bar being your definition of up.

ABS(C > C1) - (C1 > C2) - (C2 > C3) - (C3 > C4) - (C4 > C5) - (C5 > C6) - (C6 > C7) - (C7 > C8) - (C8 > C9) - (C9 > C10) - (C10 > C11) - (C11 > C12) - (C12 > C13) - (C13 > C14) - (C14 > C15) > 11.5

The long formula version based on the close being above the open could be written as:

ABS(C > O) - (C1 > O1) - (C2 > O2) - (C3 > O3) - (C4 > O4) - (C5 > O5) - (C6 > O6) - (C7 > O7) - (C8 > O8) - (C9 > O9) - (C10 > O10) - (C11 > O11) - (C12 > O12) - (C13 > O13) - (C14 > O14) > 11.5

There is a way to do this however that uses much shorter formulas. In the case of the close being above the previous close we would use the following Condition Formula as the Boolean Formula in a Custom PCF % True Indicator:

C > C1

We would then set the Period to 15 and the Average Type to Simple. The Custom PCF % True Indicator would then return 73.3% when 11 of the most recent 15 bars returned true and 80% when 12 of the most recent 15 bars returned true.

This allows us to click on the Custom PCF % True Indicator and select Create Scan Condition. We want to create a Condition for Greater Than and choose a Greater Than value which falls betwen 73.3% and 80%. The closest whole number to exactly halfway in between would be 77%. So I would probably use that.

If you wanted to use the close being above the open instead, you would just replace the Boolean Formula with:

C > O



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Tuesday, January 8, 2013 2:00:37 AM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

Thx Bruce

Is there anyway we can put hash marks on the chart like SF in TC?

 

Also how do I plot a horizantal line on the scale of the indicator

Bruce_L
Posted : Tuesday, January 8, 2013 8:14:07 AM


Worden Trainer

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

You can plot a horizontal line on the scale of the indicator by clicking on any indicator plotted in that scale and selecting Horizontal Lines... | Add Line.

The closest thing in TC2000 version 12.3 to the hash marks in StockFinder is the Custom PCF % True Indicator. It plots 100 when true and 0 when false. Moving Averages can be applied to these results which is what allows for the creation of a Custom PCF % True Indicator with a Condition added to check for 12 out of 15 results being true without using a long formula.

You can change the Plot Style from Line to something else such as Histogram, Dots or Area. You can also click on the indicator to change the Scaling to set a Custom Scale where some of the Dots for example might not plot because they were not in the range of the scale.

It is also possible to use the Custom PCF Indicator (instead of a Custom PCF % True Indicator) in using a Dot Plot Style to plot dots near the candle to signify if a result is true or not, but this would not allow the use of the shorter formulas. For example, if you used the following Formula:

ABS(ABS(C > C1) - (C1 > C2) - (C2 > C3) - (C3 > C4) - (C4 > C5) - (C5 > C6) - (C6 > C7) - (C7 > C8) - (C8 > C9) - (C9 > C10) - (C10 > C11) - (C11 > C12) - (C12 > C13) - (C13 > C14) - (C14 > C15) > 11.5) * L

You would get a dot at the low of the bar when the result is true and a dot at zero when the result was false. The Custom PCF Indicator needs to be in the same scale as Price History for this to work correctly.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, January 9, 2013 10:51:50 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

seems to work so far

thx

thnkbigr
Posted : Monday, February 11, 2013 10:16:58 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

Bruce

using the method you explained in your Tuesday, January 08, 2013 8:14:07 AM to plot dots above or below today's bar if the rule is true or not

I tried to create an indicator that would plot a dot once today's volume is higher than last 10 days 

V > MAXV9.1

It gives me an error

Howcome

 

Bruce_L
Posted : Tuesday, February 12, 2013 8:18:35 AM


Worden Trainer

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

QUOTE (thnkbigr)
using the method you explained in your Tuesday, January 08, 2013 8:14:07 AM to plot dots above or below today's bar if the rule is true or not

I cannot reproduce these results. When I use the formula given in that post in a Custom PCF Indicator which is plotted in the same pane and scale as price, it just puts a dot at the low of the bar. There are also dots being plotted at 0, but they are being plotted below the scale and are not visible.

Are you sure you are plotting the Custom PCF Indicator in the same scale as price?

QUOTE (thnkbigr)
I tried to create an indicator that would plot a dot once today's volume is higher than last 10 days 

V > MAXV9.1

It gives me an error

Your formula will work as the Boolean Formula in a Custom PCF % True Indicator, but it will not work to create a dot in a Custom PCF Indicator. To do that, you would need to take the absolute value of the result and multiply it by where you wish to plot the dot. For example, if you wanted to plot the dot at the high of the price bar, you would use:

H * ABS(V > MAXV9.1)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, February 13, 2013 11:22:38 AM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

Thx

Bruce_L
Posted : Wednesday, February 13, 2013 11:31:04 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.