Registered User Joined: 12/19/2005 Posts: 3
|
How do I get Average True Range values? I'm trying to make a customized function, but I can't seem to be able to account for the possible gaps.
Thanks, Raúl
|
|
Registered User Joined: 12/19/2005 Posts: 3
|
To clarify a bit, I'm trying to find a way to write in a formula:
Maximum of (High, Previous Close) minus Minimum of (Low, Previous Close)
I'm trying with the formulas Max and Min, but somehow I don't get the results I want.
Thanks, Raúl
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
Try plotting this:
((ABS(H>=C1)*H)+(ABS(H<C1)*C1)) - ((ABS(L>C1)*C1)+(ABS(L<=C1)*L))
- Craig Here to Help!
|
|
Registered User Joined: 12/19/2005 Posts: 3
|
If I understand correctly, are True and False values recognized numerically as -1 and 0 respectively?
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
Bingo
- Craig Here to Help!
|
|
Registered User Joined: 2/14/2006 Posts: 23
|
how would i plot 3 times the ATR in my chart (to signal a stop)? thank you very much
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
3 times the ATR?
Is it the low less 3x the ATR?
- Craig Here to Help!
|
|
Registered User Joined: 2/14/2006 Posts: 23
|
thanks for the fast reply craig - it would be Last or Close - (3*ATR) - where the average true range is the 20 ema of the true range
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jochen121, One way to write a formula for the current Last Price or Closing Price minus 3 times the 20-Period Exponential Moving Average of True Range would be as follows:
C - 3 * ((XAVGH20 - XAVGL20) / 2 + 0.0476622568003418 * (ABS(H - C1) + ABS(L - C1) + 19 / 21 * (ABS(H1 - C2) + ABS(L1 - C2) + 19 / 21 * (ABS(H2 - C3) + ABS(L2 - C3) + 19 / 21 * (ABS(H3 - C4) + ABS(L3 - C4) + 19 / 21 * (ABS(H4 - C5) + ABS(L4 - C5) + 19 / 21 * (ABS(H5 - C6) + ABS(L5 - C6) + 19 / 21 * (ABS(H6 - C7) + ABS(L6 - C7) + 19 / 21 * (ABS(H7 - C8) + ABS(L7 - C8) + 19 / 21 * (ABS(H8 - C9) + ABS(L8 - C9) + 19 / 21 * (ABS(H9 - C10) + ABS(L9 - C10) + 19 / 21 * (ABS(H10 - C11) + ABS(L10 - C11) + 19 / 21 * (ABS(H11 - C12) + ABS(L11 - C12) + 19 / 21 * (ABS(H12 - C13) + ABS(L12 - C13) + 19 / 21 * (ABS(H13 - C14) + ABS(L13 - C14) + 19 / 21 * (ABS(H14 - C15) + ABS(L14 - C15) + 19 / 21 * (ABS(H15 - C16) + ABS(L15 - C16) + 19 / 21 * (ABS(H16 - C17) + ABS(L16 - C17) + 19 / 21 * (ABS(H17 - C18) + ABS(L17 - C18) + 19 / 21 * (ABS(H18 - C19) + ABS(L18 - C19) + 19 / 21 * (ABS(H19 - C20) + ABS(L19 - C20) + 19 / 21 * (ABS(H20 - C21) + ABS(L20 - C21) + 19 / 21 * (ABS(H21 - C22) + ABS(L21 - C22) + 19 / 21 * (ABS(H22 - C23) + ABS(L22 - C23) + 19 / 21 * (ABS(H23 - C24) + ABS(L23 - C24) + 19 / 21 * (ABS(H24 - C25) + ABS(L24 - C25) + 19 / 21 * (ABS(H25 - C26) + ABS(L25 - C26) + 19 / 21 * (ABS(H26 - C27) + ABS(L26 - C27) + 19 / 21 * (ABS(H27 - C28) + ABS(L27 - C28) + 19 / 21 * (ABS(H28 - C29) + ABS(L28 - C29) + 19 / 21 * (ABS(H29 - C30) + ABS(L29 - C30) + 19 / 21 * (ABS(H30 - C31) + ABS(L30 - C31) + 19 / 21 * (ABS(H31 - C32) + ABS(L31 - C32) + 19 / 21 * (ABS(H32 - C33) + ABS(L32 - C33) + 19 / 21 * (ABS(H33 - C34) + ABS(L33 - C34) + 19 / 21 * (ABS(H34 - C35) + ABS(L34 - C35) + 19 / 21 * (ABS(H35 - C36) + ABS(L35 - C36) + 19 / 21 * (ABS(H36 - C37) + ABS(L36 - C37) + 19 / 21 * (ABS(H37 - C38) + ABS(L37 - C38) + 19 / 21 * (ABS(H38 - C39) + ABS(L38 - C39) + 19 / 21 * (ABS(H39 - C40) + ABS(L39 - C40) + 19 / 21 * (ABS(H40 - C41) + ABS(L40 - C41) + 19 / 21 * (ABS(H41 - C42) + ABS(L41 - C42) + 19 / 21 * (ABS(H42 - C43) + ABS(L42 - C43) + 19 / 21 * (ABS(H43 - C44) + ABS(L43 - C44) + 19 / 21 * (ABS(H44 - C45) + ABS(L44 - C45) + 19 / 21 * (ABS(H45 - C46) + ABS(L45 - C46) + 19 / 21 * (ABS(H46 - C47) + ABS(L46 - C47) + 19 / 21 * (ABS(H47 - C48) + ABS(L47 - C48) + 19 / 21 * (ABS(H48 - C49) + ABS(L48 - C49) + 19 / 21 * (ABS(H49 - C50) + ABS(L49 - C50) + 19 / 21 * (ABS(H50 - C51) + ABS(L50 - C51) + 19 / 21 * (ABS(H51 - C52) + ABS(L51 - C52) + 19 / 21 * (ABS(H52 - C53) + ABS(L52 - C53) + 19 / 21 * (ABS(H53 - C54) + ABS(L53 - C54) + 19 / 21 * (ABS(H54 - C55) + ABS(L54 - C55) + 19 / 21 * (ABS(H55 - C56) + ABS(L55 - C56) + 19 / 21 * (ABS(H56 - C57) + ABS(L56 - C57) + 19 / 21 * (ABS(H57 - C58) + ABS(L57 - C58) + 19 / 21 * (ABS(H58 - C59) + ABS(L58 - C59) + 19 / 21 * (ABS(H59 - C60) + ABS(L59 - C60) + 19 / 21 * (ABS(H60 - C61) + ABS(L60 - C61) + 19 / 21 * (ABS(H61 - C62) + ABS(L61 - C62) + 19 / 21 * (ABS(H62 - C63) + ABS(L62 - C63) + 19 / 21 * (ABS(H63 - C64) + ABS(L63 - C64) + 19 / 21 * (ABS(H64 - C65) + ABS(L64 - C65) + 19 / 21 * (ABS(H65 - C66) + ABS(L65 - C66) + 19 / 21 * (ABS(H66 - C67) + ABS(L66 - C67) + 19 / 21 * (ABS(H67 - C68) + ABS(L67 - C68) + 19 / 21 * (ABS(H68 - C69) + ABS(L68 - C69) + 19 / 21 * (ABS(H69 - C70) + ABS(L69 - C70))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/14/2006 Posts: 23
|
hi bruce, i just tried it but it doesn´t seem to work! i get a line that is sometimes higher than the price, but it should always be lower than the price as it is intended to be used as a volatility dependend stop - do you see any mistake? but thank you very much for your efforts
|
|
Registered User Joined: 2/14/2006 Posts: 23
|
maybe this helps - it is from "the original turtles" and i want to test the exit strategy! i want to plot N that consists of: TR=True Range= Maximum(H-L, H-PDC, PDC-L) Where: H=Current High, L=Current Low, PDC=Previous day´s close N= (19*PDN+TR)/20 where PDN=previous day´s N sorry that it sounds so complicated
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jochen121, Try checking Plot Using Price Scale when creating the Custom Indicator. You may wish to review the following:
Plotting Custom Indicators with Examples
As to your Tuesday, March 07, 2006 5:33:32 PM post, it would seem that your example does not give what the ATR should be subtracted from and does not use the standard 20-Period Exponential Moving Average you requested but uses the more traditional for ATR Wilder's Smoothing instead. Here's one way to write a formula for Price minus 3 times a 20-Period Wilder's Average True Range:
C - 3 * ((XAVGH39 - XAVGL39) / 2 + 0.025024606734037 * (ABS(H - C1) + ABS(L - C1) + 38 / 40 * (ABS(H1 - C2) + ABS(L1 - C2) + 38 / 40 * (ABS(H2 - C3) + ABS(L2 - C3) + 38 / 40 * (ABS(H3 - C4) + ABS(L3 - C4) + 38 / 40 * (ABS(H4 - C5) + ABS(L4 - C5) + 38 / 40 * (ABS(H5 - C6) + ABS(L5 - C6) + 38 / 40 * (ABS(H6 - C7) + ABS(L6 - C7) + 38 / 40 * (ABS(H7 - C8) + ABS(L7 - C8) + 38 / 40 * (ABS(H8 - C9) + ABS(L8 - C9) + 38 / 40 * (ABS(H9 - C10) + ABS(L9 - C10) + 38 / 40 * (ABS(H10 - C11) + ABS(L10 - C11) + 38 / 40 * (ABS(H11 - C12) + ABS(L11 - C12) + 38 / 40 * (ABS(H12 - C13) + ABS(L12 - C13) + 38 / 40 * (ABS(H13 - C14) + ABS(L13 - C14) + 38 / 40 * (ABS(H14 - C15) + ABS(L14 - C15) + 38 / 40 * (ABS(H15 - C16) + ABS(L15 - C16) + 38 / 40 * (ABS(H16 - C17) + ABS(L16 - C17) + 38 / 40 * (ABS(H17 - C18) + ABS(L17 - C18) + 38 / 40 * (ABS(H18 - C19) + ABS(L18 - C19) + 38 / 40 * (ABS(H19 - C20) + ABS(L19 - C20) + 38 / 40 * (ABS(H20 - C21) + ABS(L20 - C21) + 38 / 40 * (ABS(H21 - C22) + ABS(L21 - C22) + 38 / 40 * (ABS(H22 - C23) + ABS(L22 - C23) + 38 / 40 * (ABS(H23 - C24) + ABS(L23 - C24) + 38 / 40 * (ABS(H24 - C25) + ABS(L24 - C25) + 38 / 40 * (ABS(H25 - C26) + ABS(L25 - C26) + 38 / 40 * (ABS(H26 - C27) + ABS(L26 - C27) + 38 / 40 * (ABS(H27 - C28) + ABS(L27 - C28) + 38 / 40 * (ABS(H28 - C29) + ABS(L28 - C29) + 38 / 40 * (ABS(H29 - C30) + ABS(L29 - C30) + 38 / 40 * (ABS(H30 - C31) + ABS(L30 - C31) + 38 / 40 * (ABS(H31 - C32) + ABS(L31 - C32) + 38 / 40 * (ABS(H32 - C33) + ABS(L32 - C33) + 38 / 40 * (ABS(H33 - C34) + ABS(L33 - C34) + 38 / 40 * (ABS(H34 - C35) + ABS(L34 - C35) + 38 / 40 * (ABS(H35 - C36) + ABS(L35 - C36) + 38 / 40 * (ABS(H36 - C37) + ABS(L36 - C37) + 38 / 40 * (ABS(H37 - C38) + ABS(L37 - C38) + 38 / 40 * (ABS(H38 - C39) + ABS(L38 - C39) + 38 / 40 * (ABS(H39 - C40) + ABS(L39 - C40) + 38 / 40 * (ABS(H40 - C41) + ABS(L40 - C41) + 38 / 40 * (ABS(H41 - C42) + ABS(L41 - C42) + 38 / 40 * (ABS(H42 - C43) + ABS(L42 - C43) + 38 / 40 * (ABS(H43 - C44) + ABS(L43 - C44) + 38 / 40 * (ABS(H44 - C45) + ABS(L44 - C45) + 38 / 40 * (ABS(H45 - C46) + ABS(L45 - C46) + 38 / 40 * (ABS(H46 - C47) + ABS(L46 - C47) + 38 / 40 * (ABS(H47 - C48) + ABS(L47 - C48) + 38 / 40 * (ABS(H48 - C49) + ABS(L48 - C49) + 38 / 40 * (ABS(H49 - C50) + ABS(L49 - C50) + 38 / 40 * (ABS(H50 - C51) + ABS(L50 - C51) + 38 / 40 * (ABS(H51 - C52) + ABS(L51 - C52) + 38 / 40 * (ABS(H52 - C53) + ABS(L52 - C53) + 38 / 40 * (ABS(H53 - C54) + ABS(L53 - C54) + 38 / 40 * (ABS(H54 - C55) + ABS(L54 - C55) + 38 / 40 * (ABS(H55 - C56) + ABS(L55 - C56) + 38 / 40 * (ABS(H56 - C57) + ABS(L56 - C57) + 38 / 40 * (ABS(H57 - C58) + ABS(L57 - C58) + 38 / 40 * (ABS(H58 - C59) + ABS(L58 - C59) + 38 / 40 * (ABS(H59 - C60) + ABS(L59 - C60) + 38 / 40 * (ABS(H60 - C61) + ABS(L60 - C61) + 38 / 40 * (ABS(H61 - C62) + ABS(L61 - C62) + 38 / 40 * (ABS(H62 - C63) + ABS(L62 - C63) + 38 / 40 * (ABS(H63 - C64) + ABS(L63 - C64) + 38 / 40 * (ABS(H64 - C65) + ABS(L64 - C65) + 38 / 40 * (ABS(H65 - C66) + ABS(L65 - C66) + 38 / 40 * (ABS(H66 - C67) + ABS(L66 - C67) + 38 / 40 * (ABS(H67 - C68) + ABS(L67 - C68) + 38 / 40 * (ABS(H68 - C69) + ABS(L68 - C69) + 38 / 40 * (ABS(H69 - C70) + ABS(L69 - C70) + 38 / 40 * (ABS(H70 - C71) + ABS(L70 - C71) + 38 / 40 * (ABS(H71 - C72) + ABS(L71 - C72) + 38 / 40 * (ABS(H72 - C73) + ABS(L72 - C73) + 38 / 40 * (ABS(H73 - C74) + ABS(L73 - C74) + 38 / 40 * (ABS(H74 - C75) + ABS(L74 - C75) + 38 / 40 * (ABS(H75 - C76) + ABS(L75 - C76) + 38 / 40 * (ABS(H76 - C77) + ABS(L76 - C77) + 38 / 40 * (ABS(H77 - C78) + ABS(L77 - C78) + 38 / 40 * (ABS(H78 - C79) + ABS(L78 - C79) + 38 / 40 * (ABS(H79 - C80) + ABS(L79 - C80) + 38 / 40 * (ABS(H80 - C81) + ABS(L80 - C81) + 38 / 40 * (ABS(H81 - C82) + ABS(L81 - C82) + 38 / 40 * (ABS(H82 - C83) + ABS(L82 - C83) + 38 / 40 * (ABS(H83 - C84) + ABS(L83 - C84) + 38 / 40 * (ABS(H84 - C85) + ABS(L84 - C85) + 38 / 40 * (ABS(H85 - C86) + ABS(L85 - C86) + 38 / 40 * (ABS(H86 - C87) + ABS(L86 - C87) + 38 / 40 * (ABS(H87 - C88) + ABS(L87 - C88) + 38 / 40 * (ABS(H88 - C89) + ABS(L88 - C89) + 38 / 40 * (ABS(H89 - C90) + ABS(L89 - C90) + 38 / 40 * (ABS(H90 - C91) + ABS(L90 - C91) + 38 / 40 * (ABS(H91 - C92) + ABS(L91 - C92) + 38 / 40 * (ABS(H92 - C93) + ABS(L92 - C93) + 38 / 40 * (ABS(H93 - C94) + ABS(L93 - C94) + 38 / 40 * (ABS(H94 - C95) + ABS(L94 - C95) + 38 / 40 * (ABS(H95 - C96) + ABS(L95 - C96) + 38 / 40 * (ABS(H96 - C97) + ABS(L96 - C97) + 38 / 40 * (ABS(H97 - C98) + ABS(L97 - C98) + 38 / 40 * (ABS(H98 - C99) + ABS(L98 - C99) + 38 / 40 * (ABS(H99 - C100) + ABS(L99 - C100) + 38 / 40 * (ABS(H100 - C101) + ABS(L100 - C101) + 38 / 40 * (ABS(H101 - C102) + ABS(L101 - C102) + 38 / 40 * (ABS(H102 - C103) + ABS(L102 - C103) + 38 / 40 * (ABS(H103 - C104) + ABS(L103 - C104) + 38 / 40 * (ABS(H104 - C105) + ABS(L104 - C105) + 38 / 40 * (ABS(H105 - C106) + ABS(L105 - C106) + 38 / 40 * (ABS(H106 - C107) + ABS(L106 - C107) + 38 / 40 * (ABS(H107 - C108) + ABS(L107 - C108) + 38 / 40 * (ABS(H108 - C109) + ABS(L108 - C109) + 38 / 40 * (ABS(H109 - C110) + ABS(L109 - C110) + 38 / 40 * (ABS(H110 - C111) + ABS(L110 - C111) + 38 / 40 * (ABS(H111 - C112) + ABS(L111 - C112) + 38 / 40 * (ABS(H112 - C113) + ABS(L112 - C113) + 38 / 40 * (ABS(H113 - C114) + ABS(L113 - C114) + 38 / 40 * (ABS(H114 - C115) + ABS(L114 - C115) + 38 / 40 * (ABS(H115 - C116) + ABS(L115 - C116) + 38 / 40 * (ABS(H116 - C117) + ABS(L116 - C117) + 38 / 40 * (ABS(H117 - C118) + ABS(L117 - C118) + 38 / 40 * (ABS(H118 - C119) + ABS(L118 - C119) + 38 / 40 * (ABS(H119 - C120) + ABS(L119 - C120) + 38 / 40 * (ABS(H120 - C121) + ABS(L120 - C121) + 38 / 40 * (ABS(H121 - C122) + ABS(L121 - C122) + 38 / 40 * (ABS(H122 - C123) + ABS(L122 - C123) + 38 / 40 * (ABS(H123 - C124) + ABS(L123 - C124) + 38 / 40 * (ABS(H124 - C125) + ABS(L124 - C125) + 38 / 40 * (ABS(H125 - C126) + ABS(L125 - C126) + 38 / 40 * (ABS(H126 - C127) + ABS(L126 - C127) + 38 / 40 * (ABS(H127 - C128) + ABS(L127 - C128) + 38 / 40 * (ABS(H128 - C129) + ABS(L128 - C129) + 38 / 40 * (ABS(H129 - C130) + ABS(L129 - C130) + 38 / 40 * (ABS(H130 - C131) + ABS(L130 - C131) + 38 / 40 * (ABS(H131 - C132) + ABS(L131 - C132) + 38 / 40 * (ABS(H132 - C133) + ABS(L132 - C133) + 38 / 40 * (ABS(H133 - C134) + ABS(L133 - C134) + 38 / 40 * (ABS(H134 - C135) + ABS(L134 - C135)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/14/2006 Posts: 23
|
bruce, sorry for mixing the two up! when i use the formula you provided i get unrealistiv values. could it be some numbers are mixed up or something like that?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jochen121, Please provide examples.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/14/2006 Posts: 23
|
ok: 1) in the chart i click on "add cutsom indicator in top window" 2)i "plot using price scale" 3)using a simple 1 MA 4)copy your formula in the window, test formula and get a value: -1036644146619170,00 for ABIX
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jochen121, Try copying and pasting the desired formula again. For ABIX as of the 3/07/2006 Market Close I get a result of 12.34 for the Tuesday, March 07, 2006 11:40:03 AM formula and 12.32 for the Tuesday, March 07, 2006 10:15:04 PM formula.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/14/2006 Posts: 23
|
for ABIX daily chart using the 10:15:04 formula i get -1036644146619170,00 and for the 11:40 formula i get -10224952049069700,00 ... i don´t get it...
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jochen121, I've tried all sorts of things in an attempt to reproduce your results without success. My suggestion is to contact technical support. Give them information about both this topic and the Custom Date Sort issue you are experiencing (you will probably want to point out the forum topics to provide background). If damage to the program is causing the issue, technical support is the best way to get it fixed.
All e-mail communication sent to support@worden.com during business hours (Monday through Friday 9AM-11PM and Saturday and Sunday 9AM-3PM ET) should be answered within 20 minutes of arrival. For an even quicker response to tech support questions, we recommend calling our voice line at (919) 408-0542 (there is no phone support on Sundays or after 9PM ET on weekdays).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/14/2006 Posts: 23
|
maybe it has something to do with the fact that my system is not on english (us) - i have problems using the "c" function to sort charts because of that - what do you think?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jochen121, As I already mentioned in prog. close when markin chart after pressing "c", not using English (US) Regional Options or not using MM/DD/YY for your short date format could cause the Custom Date Sort issue (maybe changing just one would be enough to resolve this). I am not aware of either issue causing a problem with the calculation of Custom Indicators, but this is not customer training's area of expertise. Technical support is better able to troubleshoot and address such issues.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/14/2006 Posts: 23
|
thank you very much - you had the answers for my problems i changed the date format - "c" key works now! so i had the idea to check the formula for a "." as a divisor for decimals - i exchanged it by a "," and now i get a 12 for ABIX today thank you very much!
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jochen121, You're welcome. I'm glad you were able to work out so much on your own based on what I'd given you!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |