Registered User Joined: 2/16/2006 Posts: 12
|
Reading Sir Old Viking Trader's excellent contribution, he mentions a PCF formula he has configured which I was not able to implement; maybe you can give me a hint? His description is given below:
"An ATR is defined as the greater of the following calculations: A. Today's high minus today's low. B. Today's high minus yesterday's close. C. Today's low minus yesterday's close. I then make a 10 day moving average of the daily ATR's and enter into a PCF."
My question is: how to make a 10 day moving average of the daily ATRs and enter into a PCF?
Thanks,
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
True Range is the largest of the High minus the Low, the High minus the previous Close or the previous Close minus the Low. A very useful way of calculating this value for the purpose of creating Personal Criteria Formulas is:
(H -L + ABS(H - C1) + ABS(C1 - L)) / 2
Average True Range is the Moving Average of this value. I'm going to use a Period of 10 because that is what was mentioned by Sir Old Viking Trader in the Thursday, April 5, 2007 Worden Report. The type of Smoothing used was not mentioned. It could be calculated using a Simple Moving Average:
10-Period Simple Moving Average of True Range:
(AVGH10 - AVGL10) / 2 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9)) / 20
It is usually calculated using Wilder's Smoothing however. Wilder's Smoothing is a variation of an Exponential Moving Average. You can double the Wilder Period and subtract one to get the Exponential Moving Average Period:
10-Period Average True Range (Wilder's Smoothed):
XAVGH19 - XAVGL19 + .100095591785708 * ((H < C1) * (H - C1) + (C1 < L) * (C1 - L) + .9 * ((H1 < C2) * (H1 - C2) + (C2 < L1) * (C2 - L1) + .9 * ((H2 < C3) * (H2 - C3) + (C3 < L2) * (C3 - L2) + .9 * ((H3 < C4) * (H3 - C4) + (C4 < L3) * (C4 - L3) + .9 * ((H4 < C5) * (H4 - C5) + (C5 < L4) * (C5 - L4) + .9 * ((H5 < C6) * (H5 - C6) + (C6 < L5) * (C6 - L5) + .9 * ((H6 < C7) * (H6 - C7) + (C7 < L6) * (C7 - L6) + .9 * ((H7 < C8) * (H7 - C8) + (C8 < L7) * (C8 - L7) + .9 * ((H8 < C9) * (H8 - C9) + (C9 < L8) * (C9 - L8) + .9 * ((H9 < C10) * (H9 - C10) + (C10 < L9) * (C10 - L9) + .9 * ((H10 < C11) * (H10 - C11) + (C11 < L10) * (C11 - L10) + .9 * ((H11 < C12) * (H11 - C12) + (C12 < L11) * (C12 - L11) + .9 * ((H12 < C13) * (H12 - C13) + (C13 < L12) * (C13 - L12) + .9 * ((H13 < C14) * (H13 - C14) + (C14 < L13) * (C14 - L13) + .9 * ((H14 < C15) * (H14 - C15) + (C15 < L14) * (C15 - L14) + .9 * ((H15 < C16) * (H15 - C16) + (C16 < L15) * (C16 - L15) + .9 * ((H16 < C17) * (H16 - C17) + (C17 < L16) * (C17 - L16) + .9 * ((H17 < C18) * (H17 - C18) + (C18 < L17) * (C18 - L17) + .9 * ((H18 < C19) * (H18 - C19) + (C19 < L18) * (C19 - L18) + .9 * ((H19 < C20) * (H19 - C20) + (C20 < L19) * (C20 - L19) + .9 * ((H20 < C21) * (H20 - C21) + (C21 < L20) * (C21 - L20) + .9 * ((H21 < C22) * (H21 - C22) + (C22 < L21) * (C22 - L21) + .9 * ((H22 < C23) * (H22 - C23) + (C23 < L22) * (C23 - L22) + .9 * ((H23 < C24) * (H23 - C24) + (C24 < L23) * (C24 - L23) + .9 * ((H24 < C25) * (H24 - C25) + (C25 < L24) * (C25 - L24) + .9 * ((H25 < C26) * (H25 - C26) + (C26 < L25) * (C26 - L25) + .9 * ((H26 < C27) * (H26 - C27) + (C27 < L26) * (C27 - L26) + .9 * ((H27 < C28) * (H27 - C28) + (C28 < L27) * (C28 - L27) + .9 * ((H28 < C29) * (H28 - C29) + (C29 < L28) * (C29 - L28) + .9 * ((H29 < C30) * (H29 - C30) + (C30 < L29) * (C30 - L29) + .9 * ((H30 < C31) * (H30 - C31) + (C31 < L30) * (C31 - L30) + .9 * ((H31 < C32) * (H31 - C32) + (C32 < L31) * (C32 - L31) + .9 * ((H32 < C33) * (H32 - C33) + (C33 < L32) * (C33 - L32) + .9 * ((H33 < C34) * (H33 - C34) + (C34 < L33) * (C34 - L33) + .9 * ((H34 < C35) * (H34 - C35) + (C35 < L34) * (C35 - L34) + .9 * ((H35 < C36) * (H35 - C36) + (C36 < L35) * (C36 - L35) + .9 * ((H36 < C37) * (H36 - C37) + (C37 < L36) * (C37 - L36) + .9 * ((H37 < C38) * (H37 - C38) + (C38 < L37) * (C38 - L37) + .9 * ((H38 < C39) * (H38 - C39) + (C39 < L38) * (C39 - L38) + .9 * ((H39 < C40) * (H39 - C40) + (C40 < L39) * (C40 - L39) + .9 * ((H40 < C41) * (H40 - C41) + (C41 < L40) * (C41 - L40) + .9 * ((H41 < C42) * (H41 - C42) + (C42 < L41) * (C42 - L41) + .9 * ((H42 < C43) * (H42 - C43) + (C43 < L42) * (C43 - L42) + .9 * ((H43 < C44) * (H43 - C44) + (C44 < L43) * (C44 - L43) + .9 * ((H44 < C45) * (H44 - C45) + (C45 < L44) * (C45 - L44) + .9 * ((H45 < C46) * (H45 - C46) + (C46 < L45) * (C46 - L45) + .9 * ((H46 < C47) * (H46 - C47) + (C47 < L46) * (C47 - L46) + .9 * ((H47 < C48) * (H47 - C48) + (C48 < L47) * (C48 - L47) + .9 * ((H48 < C49) * (H48 - C49) + (C49 < L48) * (C49 - L48) + .9 * ((H49 < C50) * (H49 - C50) + (C50 < L49) * (C50 - L49) + .9 * ((H50 < C51) * (H50 - C51) + (C51 < L50) * (C51 - L50) + .9 * ((H51 < C52) * (H51 - C52) + (C52 < L51) * (C52 - L51) + .9 * ((H52 < C53) * (H52 - C53) + (C53 < L52) * (C53 - L52) + .9 * ((H53 < C54) * (H53 - C54) + (C54 < L53) * (C54 - L53) + .9 * ((H54 < C55) * (H54 - C55) + (C55 < L54) * (C55 - L54) + .9 * ((H55 < C56) * (H55 - C56) + (C56 < L55) * (C56 - L55) + .9 * ((H56 < C57) * (H56 - C57) + (C57 < L56) * (C57 - L56) + .9 * ((H57 < C58) * (H57 - C58) + (C58 < L57) * (C58 - L57) + .9 * ((H58 < C59) * (H58 - C59) + (C59 < L58) * (C59 - L58) + .9 * ((H59 < C60) * (H59 - C60) + (C60 < L59) * (C60 - L59) + .9 * ((H60 < C61) * (H60 - C61) + (C61 < L60) * (C61 - L60) + .9 * ((H61 < C62) * (H61 - C62) + (C62 < L61) * (C62 - L61) + .9 * ((H62 < C63) * (H62 - C63) + (C63 < L62) * (C63 - L62) + .9 * ((H63 < C64) * (H63 - C64) + (C64 < L63) * (C64 - L63) + .9 * ((H64 < C65) * (H64 - C65) + (C65 < L64) * (C65 - L64) + .9 * ((H65 < C66) * (H65 - C66) + (C66 < L65) * (C66 - L65)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
Here's an Exponential version to round things out:
10-Period Exponential Moving Average of True Range:
XAVGH10 - XAVGL10 + .181980276277401 * ((H < C1) * (H - C1) + (C1 < L) * (C1 - L) + 9 / 11 * ((H1 < C2) * (H1 - C2) + (C2 < L1) * (C2 - L1) + 9 / 11 * ((H2 < C3) * (H2 - C3) + (C3 < L2) * (C3 - L2) + 9 / 11 * ((H3 < C4) * (H3 - C4) + (C4 < L3) * (C4 - L3) + 9 / 11 * ((H4 < C5) * (H4 - C5) + (C5 < L4) * (C5 - L4) + 9 / 11 * ((H5 < C6) * (H5 - C6) + (C6 < L5) * (C6 - L5) + 9 / 11 * ((H6 < C7) * (H6 - C7) + (C7 < L6) * (C7 - L6) + 9 / 11 * ((H7 < C8) * (H7 - C8) + (C8 < L7) * (C8 - L7) + 9 / 11 * ((H8 < C9) * (H8 - C9) + (C9 < L8) * (C9 - L8) + 9 / 11 * ((H9 < C10) * (H9 - C10) + (C10 < L9) * (C10 - L9) + 9 / 11 * ((H10 < C11) * (H10 - C11) + (C11 < L10) * (C11 - L10) + 9 / 11 * ((H11 < C12) * (H11 - C12) + (C12 < L11) * (C12 - L11) + 9 / 11 * ((H12 < C13) * (H12 - C13) + (C13 < L12) * (C13 - L12) + 9 / 11 * ((H13 < C14) * (H13 - C14) + (C14 < L13) * (C14 - L13) + 9 / 11 * ((H14 < C15) * (H14 - C15) + (C15 < L14) * (C15 - L14) + 9 / 11 * ((H15 < C16) * (H15 - C16) + (C16 < L15) * (C16 - L15) + 9 / 11 * ((H16 < C17) * (H16 - C17) + (C17 < L16) * (C17 - L16) + 9 / 11 * ((H17 < C18) * (H17 - C18) + (C18 < L17) * (C18 - L17) + 9 / 11 * ((H18 < C19) * (H18 - C19) + (C19 < L18) * (C19 - L18) + 9 / 11 * ((H19 < C20) * (H19 - C20) + (C20 < L19) * (C20 - L19) + 9 / 11 * ((H20 < C21) * (H20 - C21) + (C21 < L20) * (C21 - L20) + 9 / 11 * ((H21 < C22) * (H21 - C22) + (C22 < L21) * (C22 - L21) + 9 / 11 * ((H22 < C23) * (H22 - C23) + (C23 < L22) * (C23 - L22) + 9 / 11 * ((H23 < C24) * (H23 - C24) + (C24 < L23) * (C24 - L23) + 9 / 11 * ((H24 < C25) * (H24 - C25) + (C25 < L24) * (C25 - L24) + 9 / 11 * ((H25 < C26) * (H25 - C26) + (C26 < L25) * (C26 - L25) + 9 / 11 * ((H26 < C27) * (H26 - C27) + (C27 < L26) * (C27 - L26) + 9 / 11 * ((H27 < C28) * (H27 - C28) + (C28 < L27) * (C28 - L27) + 9 / 11 * ((H28 < C29) * (H28 - C29) + (C29 < L28) * (C29 - L28) + 9 / 11 * ((H29 < C30) * (H29 - C30) + (C30 < L29) * (C30 - L29) + 9 / 11 * ((H30 < C31) * (H30 - C31) + (C31 < L30) * (C31 - L30) + 9 / 11 * ((H31 < C32) * (H31 - C32) + (C32 < L31) * (C32 - L31) + 9 / 11 * ((H32 < C33) * (H32 - C33) + (C33 < L32) * (C33 - L32) + 9 / 11 * ((H33 < C34) * (H33 - C34) + (C34 < L33) * (C34 - L33) + 9 / 11 * ((H34 < C35) * (H34 - C35) + (C35 < L34) * (C35 - L34))))))))))))))))))))))))))))))))))))
You may wish to review the following:
PCF's for today worden report How to create a Personal Criteria Forumula (PCF) Handy PCF example formulas to help you learn the syntax of PCFs! Average True Range (ATR) & Stop Losses Trailing-Stop Applications in TC
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/7/2004 Posts: 71
|
Sir Old Viking indicates he puts the Close, the ATR and the number of shares to purchase in the form of PCF's ona LEFT TAB for instant and easy viewing. I don't understand how he is doing this?
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
You may be interested in this:
How to create a Personal Criteria Forumula (PCF)
Customize the Information Displayed in the WatchList
Explanation of the different types of WatchList available in TeleChart
Thanks diceman
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
QUOTE (Bruce_L) I'm going to use a Period of 10 because that is what was mentioned by Sir Old Viking Trader in the Thursday, April 5, 2007 Worden Report. The type of Smoothing used was not mentioned.
Sir Old Viking Trader said:
"An ATR is defined as the greater of the following calculations. A. Today's high minus today's low. B. Today's high minus yesterday's close. C. Today's low minus yesterday's close. I then make a 10 day moving average of the daily ATR's and enter into a PCF."
Notice that his definition of True Range is not the same as the usual as given by Bruce. He likely did not intend changing the definition.
Sir Old Viking Trader did mention a 10 day moving average. He likely meant a 10 day Simple Moving Average. The 10 Period Exponential Moving Average and the 10 Period Wilder Smoothing have nothing to do with 10 days.
I may be wrong and Sir Old Viking Trader could have meant his new definition of True Range with any one of the infinite number of "10 day moving averages".
Thanks, Jim Murphy
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
bustermu, I had not noticed the inversion of the current low and previous close in Part C. While it would certainly be possible to write a formula for this, I would tend to agree this change was unintentional. Unless I'm missing something, the value of Part B will always equal or exceed the value of Part C (making Part C redundant in the definition given by Sir Old Viking Trader).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/31/2007 Posts: 9
|
Bruce Sorry I am a newby with the software. How could I graph a stop loss price using your 10-Period Average True Range (Wilder's Smoothed) I would like to use the 2.0 ATR value I would start with (C )-(XAVGH19 .. and end with * 2)
It would be great if the same can be done on a different graph 1.5% risk tolerance using the example $25000 account on how many shares to buy in a position.
as an example I would use SGP and it would calculate a stop loss at about $23.30 (4-6-2007)
Thanks in advance Jerry
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
See the answer here:
Sir Old Viking Trader
Thanks diceman
|
|
Gold Customer
Joined: 12/5/2005 Posts: 63
|
Bruce, please help me to write four PCFs for ATR:
1)10-Period Simple Moving Average of True Range yesterday < True Range Today
2)10-Period Simple Moving Average of True Range 2 days ago < True Range yesterday
3) The average 10 period of True Range < True Range Today
4) The average 10 period of True Range 2 days ago < the True Range yesterday
Thank you!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
QUOTE (auchang929) 10-Period Simple Moving Average of True Range yesterday < True Range Today
(AVGH10.1 - AVGL10.1) / 2 + (ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9) + ABS(H10 - C11) + ABS(C11 - L10)) / 20 < (H -L + ABS(H - C1) + ABS(C1 - L)) / 2
QUOTE (auchang929) 10-Period Simple Moving Average of True Range 2 days ago < True Range yesterday
(AVGH10.2 - AVGL10.2) / 2 + (ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9) + ABS(H10 - C11) + ABS(C11 - L10) + ABS(H11 - C12) + ABS(C12 - L11)) / 20 < (H1 -L1 + ABS(H1 - C2) + ABS(C2 - L1)) / 2
QUOTE (auchang929) The average 10 period of True Range < True Range Today
I'm not quite sure what "The average 10 period of True Range" means, but if it is the Simple Moving Average as above:
(AVGH10 - AVGL10) / 2 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9)) / 20 < (H -L + ABS(H - C1) + ABS(C1 - L)) / 2
QUOTE (auchang929) The average 10 period of True Range 2 days ago < the True Range yesterday
Assuming your are still talking about the Simple Moving Average, this would be the same as the second formula provided in this topic.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 12/5/2005 Posts: 63
|
Thank you! Bruce. I will study the first two PCFs. The 3) and 4) PCF may be the same as 1) and 2) PCF. I am sorry for the confusion.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
auchang929,
You're welcome. Our pleasure.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 12/5/2005 Posts: 63
|
Bruce, please help me to write two PCFs
1) The largest single-day range for the past 21 days
2) The largest single-day ATR for the past 21 days
Thank you!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
auchang929,
Do you want to find out if the current day is the largest or do you want the value of the largest no matter on which of the past 21 days it occurred?
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 12/5/2005 Posts: 63
|
Bruce, I want to have the value of the largest no matter on which of the past 21 days it occurred. The starting day is yesterday.
|
|
Gold Customer
Joined: 12/5/2005 Posts: 63
|
Bruce, maybe this way is easier. What I am looking for are
1) Today's trading range > The largest single-day range for the past 21 days
2) Today's ATR > The largest single-day ATR for the past 21 days
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
auchang929,
Warning: Long Personal Criteria Formulas can dramatically increase the time it takes to update your PCFs. These formulas should not be used as Custom Indicators.
Min Max PCFs
Maximum Range for the 21-Periods ending 1-Period Ago:
(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) + 2 * (H3 - L3) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) - 2 * (H3 - L3)) + H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) + 2 * (H6 - L6) + ABS(H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6)) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) + 2 * (H3 - L3) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) - 2 * (H3 - L3)) - H4 + L4 - H5 + L5 - ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6) - ABS(H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6))) + H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) + 2 * (H9 - L9) + ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9)) + 2 * (H10 - L10 + H11 - L11 + ABS(H10 - L10 - H11 + L11)) + ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) + 2 * (H9 - L9) + ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9)) - 2 * (H10 - L10 + H11 - L11 + ABS(H10 - L10 - H11 + L11))) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) + 2 * (H3 - L3) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) - 2 * (H3 - L3)) + H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) + 2 * (H6 - L6) + ABS(H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6)) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) + 2 * (H3 - L3) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) - 2 * (H3 - L3)) - H4 + L4 - H5 + L5 - ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6) - ABS(H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6))) - H7 + L7 - H8 + L8 - ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9) - ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9)) - 2 * (H10 - L10 + H11 - L11 + ABS(H10 - L10 - H11 + L11)) - ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) + 2 * (H9 - L9) + ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9)) - 2 * (H10 - L10 + H11 - L11 + ABS(H10 - L10 - H11 + L11)))) + H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) + 2 * (H14 - L14) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) - 2 * (H14 - L14)) + 2 * (H15 - L15 + H16 - L16 + ABS(H15 - L15 - H16 + L16)) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) + 2 * (H14 - L14) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) - 2 * (H14 - L14)) - 2 * (H15 - L15 + H16 - L16 + ABS(H15 - L15 - H16 + L16))) + H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) + 2 * (H19 - L19) + ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19)) + 2 * (H20 - L20 + H21 - L21 + ABS(H20 - L20 - H21 + L21)) + ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) + 2 * (H19 - L19) + ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19)) - 2 * (H20 - L20 + H21 - L21 + ABS(H20 - L20 - H21 + L21))) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) + 2 * (H14 - L14) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) - 2 * (H14 - L14)) + 2 * (H15 - L15 + H16 - L16 + ABS(H15 - L15 - H16 + L16)) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) + 2 * (H14 - L14) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) - 2 * (H14 - L14)) - 2 * (H15 - L15 + H16 - L16 + ABS(H15 - L15 - H16 + L16))) - H17 + L17 - H18 + L18 - ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19) - ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19)) - 2 * (H20 - L20 + H21 - L21 + ABS(H20 - L20 - H21 + L21)) - ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) + 2 * (H19 - L19) + ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19)) - 2 * (H20 - L20 + H21 - L21 + ABS(H20 - L20 - H21 + L21)))) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) + 2 * (H3 - L3) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) - 2 * (H3 - L3)) + H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) + 2 * (H6 - L6) + ABS(H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6)) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) + 2 * (H3 - L3) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) - 2 * (H3 - L3)) - H4 + L4 - H5 + L5 - ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6) - ABS(H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6))) + H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) + 2 * (H9 - L9) + ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9)) + 2 * (H10 - L10 + H11 - L11 + ABS(H10 - L10 - H11 + L11)) + ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) + 2 * (H9 - L9) + ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9)) - 2 * (H10 - L10 + H11 - L11 + ABS(H10 - L10 - H11 + L11))) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) + 2 * (H3 - L3) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) - 2 * (H3 - L3)) + H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) + 2 * (H6 - L6) + ABS(H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6)) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) + 2 * (H3 - L3) + ABS(H1 - L1 + H2 - L2 + ABS(H1 - L1 - H2 + L2) - 2 * (H3 - L3)) - H4 + L4 - H5 + L5 - ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6) - ABS(H4 - L4 + H5 - L5 + ABS(H4 - L4 - H5 + L5) - 2 * (H6 - L6))) - H7 + L7 - H8 + L8 - ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9) - ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9)) - 2 * (H10 - L10 + H11 - L11 + ABS(H10 - L10 - H11 + L11)) - ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) + 2 * (H9 - L9) + ABS(H7 - L7 + H8 - L8 + ABS(H7 - L7 - H8 + L8) - 2 * (H9 - L9)) - 2 * (H10 - L10 + H11 - L11 + ABS(H10 - L10 - H11 + L11)))) - H12 + L12 - H13 + L13 - ABS(H12 - L12 - H13 + L13) - 2 * (H14 - L14) - ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) - 2 * (H14 - L14)) - 2 * (H15 - L15 + H16 - L16 + ABS(H15 - L15 - H16 + L16)) - ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) + 2 * (H14 - L14) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) - 2 * (H14 - L14)) - 2 * (H15 - L15 + H16 - L16 + ABS(H15 - L15 - H16 + L16))) - H17 + L17 - H18 + L18 - ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19) - ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19)) - 2 * (H20 - L20 + H21 - L21 + ABS(H20 - L20 - H21 + L21)) - ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) + 2 * (H19 - L19) + ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19)) - 2 * (H20 - L20 + H21 - L21 + ABS(H20 - L20 - H21 + L21))) - ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) + 2 * (H14 - L14) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) - 2 * (H14 - L14)) + 2 * (H15 - L15 + H16 - L16 + ABS(H15 - L15 - H16 + L16)) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) + 2 * (H14 - L14) + ABS(H12 - L12 + H13 - L13 + ABS(H12 - L12 - H13 + L13) - 2 * (H14 - L14)) - 2 * (H15 - L15 + H16 - L16 + ABS(H15 - L15 - H16 + L16))) - H17 + L17 - H18 + L18 - ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19) - ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19)) - 2 * (H20 - L20 + H21 - L21 + ABS(H20 - L20 - H21 + L21)) - ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) + 2 * (H19 - L19) + ABS(H17 - L17 + H18 - L18 + ABS(H17 - L17 - H18 + L18) - 2 * (H19 - L19)) - 2 * (H20 - L20 + H21 - L21 + ABS(H20 - L20 - H21 + L21)))))) / 32
Maximum True Range for the 21-Periods ending 1-Period Ago:
(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) + 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3)) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) - 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3))) + H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) + 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6))) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) + 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3)) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) - 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3))) - H4 + L4 - ABS(H4 - C5) - ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5) - ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)) - ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)))) + H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) + 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9)) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9))) + 2 * (H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) + H11 - L11 + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) - H11 + L11 - ABS(H11 - C12) - ABS(C12 - L11))) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) + 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9)) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9))) - 2 * (H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) + H11 - L11 + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) - H11 + L11 - ABS(H11 - C12) - ABS(C12 - L11)))) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) + 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3)) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) - 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3))) + H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) + 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6))) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) + 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3)) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) - 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3))) - H4 + L4 - ABS(H4 - C5) - ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5) - ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)) - ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)))) - H7 + L7 - ABS(H7 - C8) - ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8) - ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9)) - ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9))) - 2 * (H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) + H11 - L11 + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) - H11 + L11 - ABS(H11 - C12) - ABS(C12 - L11))) - ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) + 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9)) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9))) - 2 * (H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) + H11 - L11 + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) - H11 + L11 - ABS(H11 - C12) - ABS(C12 - L11))))) + H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) + 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14)) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) - 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14))) + 2 * (H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) + H16 - L16 + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) - H16 + L16 - ABS(H16 - C17) - ABS(C17 - L16))) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) + 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14)) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) - 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14))) - 2 * (H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) + H16 - L16 + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) - H16 + L16 - ABS(H16 - C17) - ABS(C17 - L16)))) + H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) + 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19)) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19))) + 2 * (H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) + H21 - L21 + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) - H21 + L21 - ABS(H21 - C22) - ABS(C22 - L21))) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) + 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19)) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19))) - 2 * (H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) + H21 - L21 + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) - H21 + L21 - ABS(H21 - C22) - ABS(C22 - L21)))) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) + 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14)) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) - 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14))) + 2 * (H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) + H16 - L16 + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) - H16 + L16 - ABS(H16 - C17) - ABS(C17 - L16))) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) + 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14)) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) - 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14))) - 2 * (H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) + H16 - L16 + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) - H16 + L16 - ABS(H16 - C17) - ABS(C17 - L16)))) - H17 + L17 - ABS(H17 - C18) - ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18) - ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19)) - ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19))) - 2 * (H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) + H21 - L21 + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) - H21 + L21 - ABS(H21 - C22) - ABS(C22 - L21))) - ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) + 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19)) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19))) - 2 * (H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) + H21 - L21 + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) - H21 + L21 - ABS(H21 - C22) - ABS(C22 - L21))))) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) + 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3)) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) - 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3))) + H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) + 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6))) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) + 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3)) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) - 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3))) - H4 + L4 - ABS(H4 - C5) - ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5) - ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)) - ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)))) + H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) + 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9)) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9))) + 2 * (H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) + H11 - L11 + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) - H11 + L11 - ABS(H11 - C12) - ABS(C12 - L11))) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) + 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9)) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9))) - 2 * (H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) + H11 - L11 + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) - H11 + L11 - ABS(H11 - C12) - ABS(C12 - L11)))) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) + 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3)) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) - 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3))) + H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) + 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6))) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) + 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3)) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) + H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) - H2 + L2 - ABS(H2 - C3) - ABS(C3 - L2)) - 2 * (H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3))) - H4 + L4 - ABS(H4 - C5) - ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5) - ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)) - ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) + H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) - H5 + L5 - ABS(H5 - C6) - ABS(C6 - L5)) - 2 * (H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6)))) - H7 + L7 - ABS(H7 - C8) - ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8) - ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9)) - ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9))) - 2 * (H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) + H11 - L11 + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) - H11 + L11 - ABS(H11 - C12) - ABS(C12 - L11))) - ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) + 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9)) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) + H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) - H8 + L8 - ABS(H8 - C9) - ABS(C9 - L8)) - 2 * (H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9))) - 2 * (H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) + H11 - L11 + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) - H11 + L11 - ABS(H11 - C12) - ABS(C12 - L11))))) - H12 + L12 - ABS(H12 - C13) - ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13) - ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) - 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14)) - ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) - 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14))) - 2 * (H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) + H16 - L16 + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) - H16 + L16 - ABS(H16 - C17) - ABS(C17 - L16))) - ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) + 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14)) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) - 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14))) - 2 * (H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) + H16 - L16 + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) - H16 + L16 - ABS(H16 - C17) - ABS(C17 - L16)))) - H17 + L17 - ABS(H17 - C18) - ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18) - ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19)) - ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19))) - 2 * (H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) + H21 - L21 + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) - H21 + L21 - ABS(H21 - C22) - ABS(C22 - L21))) - ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) + 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19)) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19))) - 2 * (H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) + H21 - L21 + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) - H21 + L21 - ABS(H21 - C22) - ABS(C22 - L21)))) - ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) + 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14)) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) - 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14))) + 2 * (H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) + H16 - L16 + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) - H16 + L16 - ABS(H16 - C17) - ABS(C17 - L16))) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) + 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14)) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) + H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) - H13 + L13 - ABS(H13 - C14) - ABS(C14 - L13)) - 2 * (H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14))) - 2 * (H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) + H16 - L16 + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) - H16 + L16 - ABS(H16 - C17) - ABS(C17 - L16)))) - H17 + L17 - ABS(H17 - C18) - ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18) - ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19)) - ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19))) - 2 * (H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) + H21 - L21 + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) - H21 + L21 - ABS(H21 - C22) - ABS(C22 - L21))) - ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) + 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19)) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) + H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) - H18 + L18 - ABS(H18 - C19) - ABS(C19 - L18)) - 2 * (H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19))) - 2 * (H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) + H21 - L21 + ABS(H21 - C22) + ABS(C22 - L21) + ABS(H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) - H21 + L21 - ABS(H21 - C22) - ABS(C22 - L21))))))) / 64
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
QUOTE (auchang929) Bruce, maybe this way is easier.
Much easier actually.
Current Range is greater than the Maximum Range over the previous 21-Periods:
H - L > H1 - L1 AND H - L > H2 - L2 AND H - L > H3 - L3 AND H - L > H4 - L4 AND H - L > H5 - L5 AND H - L > H6 - L6 AND H - L > H7 - L7 AND H - L > H8 - L8 AND H - L > H9 - L9 AND H - L > H10 - L10 AND H - L > H11 - L11 AND H - L > H12 - L12 AND H - L > H13 - L13 AND H - L > H14 - L14 AND H - L > H15 - L15 AND H - L > H16 - L16 AND H - L > H17 - L17 AND H - L > H18 - L18 AND H - L > H19 - L19 AND H - L > H20 - L20 AND H - L > H21 - L21
Current True Range is greater then the Maximum True Range over the previous 21-Periods:
H - L + ABS(H - C1) + ABS(C1 - L) > H1 - L1 + ABS(H1 - C2) + ABS(C2 - L1) AND H - L + ABS(H - C1) + ABS(C1 - L) > H2 - L2 + ABS(H2 - C3) + ABS(C3 - L2) AND H - L + ABS(H - C1) + ABS(C1 - L) > H3 - L3 + ABS(H3 - C4) + ABS(C4 - L3) AND H - L + ABS(H - C1) + ABS(C1 - L) > H4 - L4 + ABS(H4 - C5) + ABS(C5 - L4) AND H - L + ABS(H - C1) + ABS(C1 - L) > H5 - L5 + ABS(H5 - C6) + ABS(C6 - L5) AND H - L + ABS(H - C1) + ABS(C1 - L) > H6 - L6 + ABS(H6 - C7) + ABS(C7 - L6) AND H - L + ABS(H - C1) + ABS(C1 - L) > H7 - L7 + ABS(H7 - C8) + ABS(C8 - L7) AND H - L + ABS(H - C1) + ABS(C1 - L) > H8 - L8 + ABS(H8 - C9) + ABS(C9 - L8) AND H - L + ABS(H - C1) + ABS(C1 - L) > H9 - L9 + ABS(H9 - C10) + ABS(C10 - L9) AND H - L + ABS(H - C1) + ABS(C1 - L) > H10 - L10 + ABS(H10 - C11) + ABS(C11 - L10) AND H - L + ABS(H - C1) + ABS(C1 - L) > H11 - L11 + ABS(H11 - C12) + ABS(C12 - L11) AND H - L + ABS(H - C1) + ABS(C1 - L) > H12 - L12 + ABS(H12 - C13) + ABS(C13 - L12) AND H - L + ABS(H - C1) + ABS(C1 - L) > H13 - L13 + ABS(H13 - C14) + ABS(C14 - L13) AND H - L + ABS(H - C1) + ABS(C1 - L) > H14 - L14 + ABS(H14 - C15) + ABS(C15 - L14) AND H - L + ABS(H - C1) + ABS(C1 - L) > H15 - L15 + ABS(H15 - C16) + ABS(C16 - L15) AND H - L + ABS(H - C1) + ABS(C1 - L) > H16 - L16 + ABS(H16 - C17) + ABS(C17 - L16) AND H - L + ABS(H - C1) + ABS(C1 - L) > H17 - L17 + ABS(H17 - C18) + ABS(C18 - L17) AND H - L + ABS(H - C1) + ABS(C1 - L) > H18 - L18 + ABS(H18 - C19) + ABS(C19 - L18) AND H - L + ABS(H - C1) + ABS(C1 - L) > H19 - L19 + ABS(H19 - C20) + ABS(C20 - L19) AND H - L + ABS(H - C1) + ABS(C1 - L) > H20 - L20 + ABS(H20 - C21) + ABS(C21 - L20) AND H - L + ABS(H - C1) + ABS(C1 - L) > H21 - L21 + ABS(H21 - C22) + ABS(C22 - L21)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Gold Customer
Joined: 12/5/2005 Posts: 63
|
Thank you! Bruce. Those formula are too complicated too use. Thank you again!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
auchang929,
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |