Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The base bull formula would seem to be:
IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L))))))
The base bear formula would seem to be:
IIF(C < O, IIF(C1 > O, GREATEST(C1 - O, H - L), H-L), IIF(C > O, IIF(C1 > O, GREATEST(C1 - L, H - C), GREATEST(O - L, H - C)), IIF(H - C > C - L, IIF(C1 > O, GREATEST(C1 - O, H - L), H - L), IIF(H - C < C - L, IIF(C1 > O, GREATEST(C1 - L, H - C), O - L), IIF(C1 > O, GREATEST(C1 - O, H - L), IIF(C1 < O, GREATEST(O - L, H - C), H - L))))))
With the histogram just being the difference between the two.
IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))) - IIF(C < O, IIF(C1 > O, GREATEST(C1 - O, H - L), H-L), IIF(C > O, IIF(C1 > O, GREATEST(C1 - L, H - C), GREATEST(O - L, H - C)), IIF(H - C > C - L, IIF(C1 > O, GREATEST(C1 - O, H - L), H - L), IIF(H - C < C - L, IIF(C1 > O, GREATEST(C1 - L, H - C), O - L), IIF(C1 > O, GREATEST(C1 - O, H - L), IIF(C1 < O, GREATEST(O - L, H - C), H - L))))))
The article recommends smoothing these values with moving averages.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 6/24/2017 Posts: 15
|
Wow, works like a charm thanks Bruce. I added as an indicator and figured out the smoothing.
If I now want to create an easyscan, I created the below simple above/below - but I would like to (1) add smooting, say 5 period to each, and (2) then create a scan for cross-overs, with a large pcf like below I dont know where to add the periods (.1) etc so I can do below say 3 bars ago, above 1 bar ago ?
(IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L))))))) > (IIF(C < O, IIF(C1 > O, GREATEST(C1 - O, H - L), H-L), IIF(C > O, IIF(C1 > O, GREATEST(C1 - L, H - C), GREATEST(O - L, H - C)), IIF(H - C > C - L, IIF(C1 > O, GREATEST(C1 - O, H - L), H - L), IIF(H - C < C - L, IIF(C1 > O, GREATEST(C1 - L, H - C), O - L), IIF(C1 > O, GREATEST(C1 - O, H - L), IIF(C1 < O, GREATEST(O - L, H - C), H - L)))))))
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Every single O, H, L, or C without an offset parameter already would get an offset parameter. So for say 3 bars ago would become O3, H3, L3, and C3. The only thing with an offset parameter already would be C1, so you would add the offset to the existing offset parameter. So for say 3 bars ago would become C4 instead of C1.
All of that said, XUP() and XDOWN() functions were added to the Personal Criteria Formula Language in TC2000 v17 which makes it so you may not need to do offsets.
Let's say you wanted to check for if the 5 period simple moving average of the base bull formula crossed up through its own 2 period simple moving average (so the second line was a 2 period simple moving average of the 5 period simple average of the base bull formula).
XUP(AVG(IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))), 5), AVG(AVG(IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))), 5), 2))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 9/30/2011 Posts: 788
|
The following formula generates numbers, I would like the change with signal.
IIF (C <O, IIF (C1 <O, GREATEST (H - C1, C - L), GREATEST (H - O, C - L)), IIF (C> O, IIF (C1> O, H - L , GREATEST (O - C1, H - L)), IIF (H - C> C - L, IIF (C1 <O, GREATEST (H - C1, C - L), H - O), IIF (H - C <C - L, IIF (C1> O, H - L, GREATEST (O - C1, H - L)), IIF (C1> O, GREATEST (H - O, C - L), IIF (C1 <O, GREATEST (O - C1, H - L), H - L))))))
Thank you and goodbye.
Raider45
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The indicator doesn't even cross through zero (although it can equal zero).
So I guess, above zero:
IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))) > 0
Equals zero:
IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))) = 0
Switching from zero to above zero:
TrueInRow(IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))) > 0, 2) = 1
Switching from above zero to zero:
TrueInRow(IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))) = 0, 2) = 1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Maybe you are interested in the Histogram instead? It actually does cross through zero.
Above Zero:
IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))) > IIF(C < O, IIF(C1 > O, GREATEST(C1 - O, H - L), H-L), IIF(C > O, IIF(C1 > O, GREATEST(C1 - L, H - C), GREATEST(O - L, H - C)), IIF(H - C > C - L, IIF(C1 > O, GREATEST(C1 - O, H - L), H - L), IIF(H - C < C - L, IIF(C1 > O, GREATEST(C1 - L, H - C), O - L), IIF(C1 > O, GREATEST(C1 - O, H - L), IIF(C1 < O, GREATEST(O - L, H - C), H - L))))))
Below Zero:
IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))) < IIF(C < O, IIF(C1 > O, GREATEST(C1 - O, H - L), H-L), IIF(C > O, IIF(C1 > O, GREATEST(C1 - L, H - C), GREATEST(O - L, H - C)), IIF(H - C > C - L, IIF(C1 > O, GREATEST(C1 - O, H - L), H - L), IIF(H - C < C - L, IIF(C1 > O, GREATEST(C1 - L, H - C), O - L), IIF(C1 > O, GREATEST(C1 - O, H - L), IIF(C1 < O, GREATEST(O - L, H - C), H - L))))))
Crossing Up Zero:
TrueInRow(IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))) > IIF(C < O, IIF(C1 > O, GREATEST(C1 - O, H - L), H-L), IIF(C > O, IIF(C1 > O, GREATEST(C1 - L, H - C), GREATEST(O - L, H - C)), IIF(H - C > C - L, IIF(C1 > O, GREATEST(C1 - O, H - L), H - L), IIF(H - C < C - L, IIF(C1 > O, GREATEST(C1 - L, H - C), O - L), IIF(C1 > O, GREATEST(C1 - O, H - L), IIF(C1 < O, GREATEST(O - L, H - C), H - L)))))), 2) = 1
Crossing Down Zero:
TrueInRow(IIF(C < O, IIF(C1 < O, GREATEST(H - C1, C - L), GREATEST(H - O, C - L)), IIF(C > O, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(H - C > C - L, IIF(C1 < O, GREATEST(H - C1, C - L), H - O), IIF(H - C < C - L, IIF(C1 > O, H - L, GREATEST(O - C1, H - L)), IIF(C1 > O, GREATEST(H - O, C - L), IIF(C1 < O, GREATEST(O - C1, H - L), H - L)))))) < IIF(C < O, IIF(C1 > O, GREATEST(C1 - O, H - L), H-L), IIF(C > O, IIF(C1 > O, GREATEST(C1 - L, H - C), GREATEST(O - L, H - C)), IIF(H - C > C - L, IIF(C1 > O, GREATEST(C1 - O, H - L), H - L), IIF(H - C < C - L, IIF(C1 > O, GREATEST(C1 - L, H - C), O - L), IIF(C1 > O, GREATEST(C1 - O, H - L), IIF(C1 < O, GREATEST(O - L, H - C), H - L)))))), 2) = 1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|