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 |

Quantifying up and down trends in Custom Indicators Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Ziad
Posted : Tuesday, March 21, 2006 12:12:48 PM
Registered User
Joined: 3/15/2006
Posts: 15
If a certain condition you are looking for requires that a short term uptrend or downtrend be present before it, it is easy to incorporate this into a scan by choosing one of the % price change filters. But if you are building a custom percent true indicator, how can you incorporate previous short term trend into the Boolean formula?

As a related question, what do you think is the best way to quantify long candles (as opposed to short ones)? I'm trying to use something like this: ABS(O - C) > (2 * ABS(AVGO13 - AVGC13)). Is AVGO13 - AVGC13 mathematically equivalent to AVG(O-C)13? I think the latter is a syntax error.
Craig_S
Posted : Tuesday, March 21, 2006 12:20:34 PM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
ABS(AVGO13 - AVGC13) does not work, you need to compare each day's open to each day's close.

I use this:

100*ABS(C-O)/(AVGH13-AVGL13)

You can also do it "longhand":

100*(ABS(C-O)/((ABS(C-O)+ ABS(C1-O1)+ ABS(C2-O2)+ ABS(C3-O3)+ ABS(C4-O4)+ ABS(C5-O5)+ ABS(C6-O6)+ ABS(C7-O7)+ ABS(C8-O8)+ ABS(C9-O9)+ ABS(C10-O10)+ ABS(C11-O11)+ ABS(C12-O12))/13)

It compares today's candle body to the stocks average trading range over the last 13 days.

I don't completely understand you first question. Are you looking for a BOOLEAN formula that looks for a short-term up or down trend of a certain percentage? If so try this:

Up or down at least 5% last 10 days
100*ABS(C-C10)/C10>5

- Craig
Here to Help!
Ziad
Posted : Tuesday, March 21, 2006 12:40:59 PM
Registered User
Joined: 3/15/2006
Posts: 15
A few Comments:

1) I assume in the first formula you put, you meant to write AVGC and AVGO instead of AVGH and AVGL.

2) when you put 100*something, this isn't a boolean formula anymore is it? Don't you then need the % meter found in the scanning option? If so, I don't think this is available when writing a percent true custom indicator. Or could you just put something like 100*X > 200?

3) About the first question, yes I am looking for a formula that looks for short-term up or down trend, but I don't want a certain percentage because I am doing it intraday and each stock has a different volatility. I was seeing if there is anyway to quantify that an up or down trend was in effect in the last few price bars, without specifying a certain percentage.
Craig_S
Posted : Tuesday, March 21, 2006 1:01:59 PM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
1) No. I wanted to compare the body to the average net trading range. You can use AVGH13-AVGL13 because the high is ALWAYS greater than or equal to the low.

2) The 100* only multiplies something by 100. A Boolean formula is one that returns either TRUE or FALSE (though it could return nothing if there is a probem with the formula or not enough data to calculate it).

3) Plot this as a custom indicator and see if it does the trick:

Trend/Consolidate 20 bars:

100*(MAXH20-MINL20)/(AVGH20-AVGL20)

The higher the value returned by this, the more the stock is trending in either direction.

- Craig
Here to Help!
Ziad
Posted : Tuesday, March 21, 2006 1:16:33 PM
Registered User
Joined: 3/15/2006
Posts: 15
Ok that looks good, but what number should I require it to be greater than or less than so that it becomes Boolean formula in my custom indicator?
Craig_S
Posted : Tuesday, March 21, 2006 1:19:44 PM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
That is up to you....

I recommend SORTING by the ACTUAL VALUE of the plotted indicator and scroll down looking at the values and the comparative trends on the chart. From there you can decide the minimum value you are willing to tolerate.

Here is a video to review:

Sorting price and indicators by their Actual Value

- Craig
Here to Help!
Ziad
Posted : Tuesday, March 21, 2006 1:23:45 PM
Registered User
Joined: 3/15/2006
Posts: 15
Ok thanks a lot for ur help!
Craig_S
Posted : Tuesday, March 21, 2006 1:28:36 PM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
My pleasure!

- Craig
Here to Help!
B4invest
Posted : Thursday, March 23, 2006 9:19:42 AM
Registered User
Joined: 3/7/2006
Posts: 9
Hi - can you pls advise what the syntax '&gt' in the example below represents?? Also, is there anyplace to get a list of various syntax like this?? thanks.
Bruce_L
Posted : Thursday, March 23, 2006 9:53:22 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
B4invest,
I don't see an example, but your syntax won't do anything in TeleChart's Personal Criteria Formula Language. It is the HTML entity for >. It will sometimes appear in posts that have been edited without selecting the PreserveHTML option. You may be interested in the following:

Handy PCF example formulas to help you learn the syntax of PCFs!
Personal Criteria Language
Personal Criteria Language Function List

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