Registered User Joined: 7/29/2010 Posts: 417
|
Hi Bruce,
How can I construct a pcf for 8ema crossing 2ema up and 8ema rising and 8ema staying above the 2ema after the cross?
I would like the 8ema cross and subsequent to occur within the past let's say 5 bars.
Please do this for both v12 and v17.
I am guessing it is not possible with v12.
I assume in v17 I can then use this in a column.
Is there anything created in v17 that can't be used in a column?
Also, I noticed I now have to log into the discusssion forum even though I am already logged in to v12 web browser. I used to be automatically logged in and prefer that to having to log in 2X.
Many thanks for any help.
Don
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
"8ema rising and 8ema staying above the 2ema after the cross"
I just realized I probably only need one or the other of these 2 conditions.
Don
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If we just look at the current bar as far the 8 ema rising, then you could write the following Condition Formula for TC2000 v17.
XAVGC8 > XAVGC2 AND XAVGC8 > XAVGC8.1 AND TrueInRow(XAVGC8.1 > XAVGC2.1, 5) < 5
The same thing in TC2000 v12 could be written as follows.
XAVGC8 > XAVGC2 AND XAVGC8 > XAVGC8.1 AND (XAVGC8.1 <= XAVGC2.1 OR XAVGC8.2 <= XAVGC2.2 OR XAVGC8.3 <= XAVGC2.3 OR XAVGC8.4 <= XAVGC2.4 OR XAVGC8.5 <= XAVGC2.5)
You should be able to use either formula as a WatchList Column in TC2000 v17. I can't really think of much that can't be used as a WatchList Column in Tc2000 v17 (Volume at Price would be the only expcetion which leaps to mind).
I don't know why you would need to log into both. It keeps me logged into both.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If we only want the 8 ema to have remained above since the cross without checking for the 8 ema rising, then we can do the following for TC2000 v17.
XAVGC8 > XAVGC2 AND TrueInRow(XAVGC8.1 > XAVGC2.1, 5) < 5
And the following for TC2000 v12.
XAVGC8 > XAVGC2 AND XAVGC8 > XAVGC8.1 AND (XAVGC8.1 <= XAVGC2.1 OR XAVGC8.2 <= XAVGC2.2 OR XAVGC8.3 <= XAVGC2.3 OR XAVGC8.4 <= XAVGC2.4 OR XAVGC8.5 <= XAVGC2.5)
Having the 8 ema cross up through the 2 ema and keep rising after the cross is a somewhat more complicated case. Keep in mind that I don't think the 8 ema can actually be rising on the same bar that it crosses up through the 2 ema. This is because both emas will move toward price and the 8 ema will do so more slowly than the 2 ema.
So if we don't check for the 8 ema moving up on the bar of the cross and still allow for the cross to have happened on the current bar, then we would get the following for TC2000 v17.
XUP(XAVGC8, XAVGC2) OR (XUP(XAVGC8.1, XAVGC2.1) AND XAVGC8 > XAVGC8.1) OR (XUP(XAVGC8.2, XAVGC2.2) AND CountTrue(XAVGC8 > XAVGC8.1, 2) = 2) OR (XUP(XAVGC8.3, XAVGC2.3) AND CountTrue(XAVGC8 > XAVGC8.1, 3) = 3) OR (XUP(XAVGC8.4, XAVGC2.4) AND CountTrue(XAVGC8 > XAVGC8.1, 4) = 4)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
Many thanks for your very fine work.
I don't understand why we have to manually check for the 8ema below the 2ema in V12 but not in V17.
I guess I don't understand this:
TrueInRow(XAVGC8.1 > XAVGC2.1, 5) < 5
TrueInRow(XAVGC8.1 > XAVGC2.1, 5) tells me the condition has been true for the previous 5 bars...
I don't understand the <5 part of it.
It seems to specify the false condition ie 8ema below 2ema on the bar prior to that but I am not understanding it.
Thank you for helping.
Don
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
QUOTE (donv98) TrueInRow(XAVGC8.1 > XAVGC2.1, 5) tells me the condition has been true for the previous 5 bars...
Well not quite. It returns the number of bars in a row the condition has been true over the most recent 5 bars. This value can range from 0 to 5.
Adding the < 5 to the end checks to make sure ema 8 was at or below ema 2 during those 5 bars. This could also have been done using CountTrue() instead of TrueInRow(), but the hope is that TrueInRow() would be slightly more efficient because it can truncate its calculations at the first false instance.
Now if you were to just use TrueInRow(XAVGC8.1 > XAVGC2.1, 5) by itself without comparing it to a value, it could be used as a boolean (but only because the Boolean Formula would try to convert the numeric value to true or false... with false being 0). That said, it would not do what you think. The only time it would return false is when the count is 0. This means it would return true if the number of times in a row the condition was true was 1, 2, 3, 4, or 5 bars in a row.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
TrueInRow(XAVGC8.1 > XAVGC2.1, 5) < 5
does this mean the condition has become true sometime within the past 5 bars,
ie. <5?
ie: on the 0 or 1 or 2 or 3 or 4 bar.
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
Sorry, I was writing the above post before you corrected my error with your post.
Don
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
We have already checked for the current bar being above with the following.
XAVGC8 > XAVGC2
The next part:
TrueInRow(XAVGC8.1 > XAVGC2.1, 5) < 5
Just checks to make sure 8 ema has not been continuously above 2 ema for the previous 5 bars as well.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
How do I specify that a condition has been true each instance for the previous X bars,
...what I was erroneously thinking TrueInRow did?
CountTrue(b, x) -> Will return the number of times Boolean formula was true in the period
CountTrue(XAVGC8.1 > XAVGC2.1, X) tells me the number of times the condition has been true for the previous X bars
TrueInRow(b, x) -> Will return a value between 0 and period that is how many times the Boolean formula was true in a row
TrueInRow(XAVGC8.1 > XAVGC2.1, X
"It returns the number of bars in a row the condition has been true over the most recent X bars. This value can range from 0 to X."
Thank you.
Don
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
QUOTE (Bruce_L)
We have already checked for the current bar being above with the following.
XAVGC8 > XAVGC2
The next part:
TrueInRow(XAVGC8.1 > XAVGC2.1, 5) < 5
Just checks to make sure 8 ema has not been continuously above 2 ema for the previous 5 bars as well.
Very helpful Bruce.
I was again composing while you were posting this so I didn't see it.
don
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
"How do I specify that a condition has been true each instance for the previous X bars?"
Is this how?
CountTrue(XAVGC8.1 > XAVGC2.1, X) = X
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Both of the following would work for that (even though the functions themseleves do two different things).
CountTrue(XAVGC8.1 > XAVGC2.1, X) = X
Or:
TrueInRow(XAVGC8.1 > XAVGC2.1, X) = X
The reason I used TrueInRow() instead of CountTrue() was just a matter of perceived efficiency for the particular application.
Think about an algorithm for CountTrue(). I need to check each bar in order to get a count.
Now think about an algorithm for TrueInRow(). I can can stop checking each bar at the first bar returning false (because I have my answer at that point).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
Many thanks for sharing the nuances of these functions.
I really appreciate your patient, detailed responses.
TrueInRow(XAVGC8.1 > XAVGC2.1,50) = 5
Does this check for occurences of the condition being true exactly 5 consecutive bars over the previous 50?
TrueInRow(XAVGC8.1 > XAVGC2.1,50) >5
Does this check for occurences of the condition being true > 5 consecutive bars over the previous 50?
Don
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
TrueInRow(XAVGC8.1 > XAVGC2.1, 50) is going to check for how many bars in a row this is true currently. It doesn't check for past instances of it being true in a row.
So:
TrueInRow(XAVGC8.1 > XAVGC2.1, 50) = 5 is going to give you the same answer as TrueInRow(XAVGC8.1 > XAVGC2.1, 6) = 5.
And:
TrueInRow(XAVGC8.1 > XAVGC2.1, 50) > 5 is goin gto give you the same answer as TrueInRow(XAVGC(8.1 > XAVGC2.1, 6) > 5.
But if XAVGC8.1 > XAVGC2.1 was true for 10 bars in a row (including the current bar), then TrueInRow(XAVGC8.1 > XAVGC2.1, 50) would return 10 while TrueInRow(XAVGC8.1 > XAVGC2.1, 6) would return 6.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/30/2008 Posts: 4
|
Where can I find the XUP, TrueInRow, etc explanations and methods?
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
Here Version 17 PCF Capabilities
|
|
Guest-1 |