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 |

ulcer index custom formula? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
davelittlejohn
Posted : Friday, June 1, 2012 2:12:26 PM
Gold Customer Gold Customer

Joined: 8/6/2010
Posts: 3

Would like to be able to calculate the Ulcer Index of various time frames in TC2000.  Any help creating these formulas would be greatly appreciated.  Thanks!

Bruce_L
Posted : Friday, June 1, 2012 3:50:48 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Given a specific period, it would be possible to the Ulcer Index (the referenced topic is for StockFinder, but the algorithm would be straightforward to convert). It is not possible to create a generalized solution which would accept a period as a user input in TC2000.

ulcer index in SF 4



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
davelittlejohn
Posted : Monday, June 4, 2012 11:04:17 AM
Gold Customer Gold Customer

Joined: 8/6/2010
Posts: 3

Okay, so showing how much of a noob I am here...  can you point me to some resources to get a better handle on how to code this thing?  I'm completely unfamiliar with the language and the various products offered through Worden.  I'd like to be able to create a few different UI time periods -- like 5, 10, 17, 21, 40, 100, etc...  I just need a little more of a nudge in the right direction.  I 'conceptually' understand the other thread, but I don't know how to translate of actually get the code started.

Thanks for the response Tom!

Bruce_L
Posted : Monday, June 4, 2012 11:53:14 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

My interpretation of 5-Period Ulster Index as an Indicator Formula is:

(ABS((C < MAXC5) * (100 * (C / MAXC5-1)) ^ 2 - (C1 < MAXC4.1) * (100 * (C1 / MAXC4.1 - 1)) ^ 2 - (C2 < MAXC3.2) * (100 * (C2 / MAXC3.2 - 1)) ^ 2 - (C3 < MAXC2.3) * (100 * (C3 / MAXC2.3 - 1)) ^ 2 - (C4 < C5) * (100 * (C4 / C5 - 1)) ^ 2) / 5) ^ .5

My interpretation of 10-Period Ulster Index as an Indicator Formula is:

(ABS((C < MAXC10) * (100 * (C / MAXC10-1)) ^ 2 - (C1 < MAXC9.1) * (100 * (C1 / MAXC9.1 - 1)) ^ 2 - (C2 < MAXC8.2) * (100 * (C2 / MAXC8.2 - 1)) ^ 2 - (C3 < MAXC7.3) * (100 * (C3 / MAXC7.3 - 1)) ^ 2 - (C4 < MAXC6.4) * (100 * (C4 / MAXC6.4 - 1)) ^ 2 - (C5 < MAXC5.5) * (100 * (C5 / MAXC5.5 - 1)) ^ 2 - (C6 < MAXC4.6) * (100 * (C6 / MAXC4.6 - 1)) ^ 2 - (C7 < MAXC3.7) * (100 * (C7 / MAXC3.7 - 1)) ^ 2 - (C8 < MAXC2.8) * (100 * (C8 / MAXC2.8 - 1)) ^ 2 - (C9 < C10) * (100 * (C9 / C10 - 1)) ^ 2) / 10) ^ .5

My interpretation of 17-Period Ulster Index as an Indicator Formula is:

(ABS((C < MAXC17) * (100 * (C / MAXC17-1)) ^ 2 - (C1 < MAXC16.1) * (100 * (C1 / MAXC16.1 - 1)) ^ 2 - (C2 < MAXC15.2) * (100 * (C2 / MAXC15.2 - 1)) ^ 2 - (C3 < MAXC14.3) * (100 * (C3 / MAXC14.3 - 1)) ^ 2 - (C4 < MAXC13.4) * (100 * (C4 / MAXC13.4 - 1)) ^ 2 - (C5 < MAXC12.5) * (100 * (C5 / MAXC12.5 - 1)) ^ 2 - (C6 < MAXC11.6) * (100 * (C6 / MAXC11.6 - 1)) ^ 2 - (C7 < MAXC10.7) * (100 * (C7 / MAXC10.7 - 1)) ^ 2 - (C8 < MAXC9.8) * (100 * (C8 / MAXC9.8 - 1)) ^ 2 - (C9 < MAXC8.9) * (100 * (C9 / MAXC8.9 - 1)) ^ 2 - (C10 < MAXC7.10) * (100 * (C10 / MAXC7.10 - 1)) ^ 2 - (C11 < MAXC6.11) * (100 * (C11 / MAXC6.11 - 1)) ^ 2 - (C12 < MAXC5.12) * (100 * (C12 / MAXC5.12 - 1)) ^ 2 - (C13 < MAXC4.13) * (100 * (C13 / MAXC4.13 - 1)) ^ 2 - (C14 < MAXC3.14) * (100 * (C14 / MAXC3.14 - 1)) ^ 2 - (C15 < MAXC2.15) * (100 * (C15 / MAXC2.15 - 1)) ^ 2 - (C16 < C17) * (100 * (C16 / C17 - 1)) ^ 2) / 17) ^ .5

My interpretation of 21-Period Ulster Index as an Indicator Formula is:

(ABS((C < MAXC21) * (100 * (C / MAXC21-1)) ^ 2 - (C1 < MAXC20.1) * (100 * (C1 / MAXC20.1 - 1)) ^ 2 - (C2 < MAXC19.2) * (100 * (C2 / MAXC19.2 - 1)) ^ 2 - (C3 < MAXC18.3) * (100 * (C3 / MAXC18.3 - 1)) ^ 2 - (C4 < MAXC17.4) * (100 * (C4 / MAXC17.4 - 1)) ^ 2 - (C5 < MAXC16.5) * (100 * (C5 / MAXC16.5 - 1)) ^ 2 - (C6 < MAXC15.6) * (100 * (C6 / MAXC15.6 - 1)) ^ 2 - (C7 < MAXC14.7) * (100 * (C7 / MAXC14.7 - 1)) ^ 2 - (C8 < MAXC13.8) * (100 * (C8 / MAXC13.8 - 1)) ^ 2 - (C9 < MAXC12.9) * (100 * (C9 / MAXC12.9 - 1)) ^ 2 - (C10 < MAXC11.10) * (100 * (C10 / MAXC11.10 - 1)) ^ 2 - (C11 < MAXC10.11) * (100 * (C11 / MAXC10.11 - 1)) ^ 2 - (C12 < MAXC9.12) * (100 * (C12 / MAXC9.12 - 1)) ^ 2 - (C13 < MAXC8.13) * (100 * (C13 / MAXC8.13 - 1)) ^ 2 - (C14 < MAXC7.14) * (100 * (C14 / MAXC7.14 - 1)) ^ 2 - (C15 < MAXC6.15) * (100 * (C15 / MAXC6.15 - 1)) ^ 2 - (C16 < MAXC5.16) * (100 * (C16 / MAXC5.16 - 1)) ^ 2 - (C17 < MAXC4.17) * (100 * (C17 / MAXC4.17 - 1)) ^ 2 - (C18 < MAXC3.18) * (100 * (C18 / MAXC3.18 - 1)) ^ 2 - (C19 < MAXC2.19) * (100 * (C19 / MAXC2.19 - 1)) ^ 2 - (C20 < C21) * (100 * (C20 / C21 - 1)) ^ 2) / 21) ^ .5

My interpretation of 40-Period Ulster Index as an Indicator Formula is:

(ABS((C < MAXC40) * (100 * (C / MAXC40-1)) ^ 2 - (C1 < MAXC39.1) * (100 * (C1 / MAXC39.1 - 1)) ^ 2 - (C2 < MAXC38.2) * (100 * (C2 / MAXC38.2 - 1)) ^ 2 - (C3 < MAXC37.3) * (100 * (C3 / MAXC37.3 - 1)) ^ 2 - (C4 < MAXC36.4) * (100 * (C4 / MAXC36.4 - 1)) ^ 2 - (C5 < MAXC35.5) * (100 * (C5 / MAXC35.5 - 1)) ^ 2 - (C6 < MAXC34.6) * (100 * (C6 / MAXC34.6 - 1)) ^ 2 - (C7 < MAXC33.7) * (100 * (C7 / MAXC33.7 - 1)) ^ 2 - (C8 < MAXC32.8) * (100 * (C8 / MAXC32.8 - 1)) ^ 2 - (C9 < MAXC31.9) * (100 * (C9 / MAXC31.9 - 1)) ^ 2 - (C10 < MAXC30.10) * (100 * (C10 / MAXC30.10 - 1)) ^ 2 - (C11 < MAXC29.11) * (100 * (C11 / MAXC29.11 - 1)) ^ 2 - (C12 < MAXC28.12) * (100 * (C12 / MAXC28.12 - 1)) ^ 2 - (C13 < MAXC27.13) * (100 * (C13 / MAXC27.13 - 1)) ^ 2 - (C14 < MAXC26.14) * (100 * (C14 / MAXC26.14 - 1)) ^ 2 - (C15 < MAXC25.15) * (100 * (C15 / MAXC25.15 - 1)) ^ 2 - (C16 < MAXC24.16) * (100 * (C16 / MAXC24.16 - 1)) ^ 2 - (C17 < MAXC23.17) * (100 * (C17 / MAXC23.17 - 1)) ^ 2 - (C18 < MAXC22.18) * (100 * (C18 / MAXC22.18 - 1)) ^ 2 - (C19 < MAXC21.19) * (100 * (C19 / MAXC21.19 - 1)) ^ 2 - (C20 < MAXC20.20) * (100 * (C20 / MAXC20.20 - 1)) ^ 2 - (C21 < MAXC19.21) * (100 * (C21 / MAXC19.21 - 1)) ^ 2 - (C22 < MAXC18.22) * (100 * (C22 / MAXC18.22 - 1)) ^ 2 - (C23 < MAXC17.23) * (100 * (C23 / MAXC17.23 - 1)) ^ 2 - (C24 < MAXC16.24) * (100 * (C24 / MAXC16.24 - 1)) ^ 2 - (C25 < MAXC15.25) * (100 * (C25 / MAXC15.25 - 1)) ^ 2 - (C26 < MAXC14.26) * (100 * (C26 / MAXC14.26 - 1)) ^ 2 - (C27 < MAXC13.27) * (100 * (C27 / MAXC13.27 - 1)) ^ 2 - (C28 < MAXC12.28) * (100 * (C28 / MAXC12.28 - 1)) ^ 2 - (C29 < MAXC11.29) * (100 * (C29 / MAXC11.29 - 1)) ^ 2 - (C30 < MAXC10.30) * (100 * (C30 / MAXC10.30 - 1)) ^ 2 - (C31 < MAXC9.31) * (100 * (C31 / MAXC9.31 - 1)) ^ 2 - (C32 < MAXC8.32) * (100 * (C32 / MAXC8.32 - 1)) ^ 2 - (C33 < MAXC7.33) * (100 * (C33 / MAXC7.33 - 1)) ^ 2 - (C34 < MAXC6.34) * (100 * (C34 / MAXC6.34 - 1)) ^ 2 - (C35 < MAXC5.35) * (100 * (C35 / MAXC5.35 - 1)) ^ 2 - (C36 < MAXC4.36) * (100 * (C36 / MAXC4.36 - 1)) ^ 2 - (C37 < MAXC3.37) * (100 * (C37 / MAXC3.37 - 1)) ^ 2 - (C38 < MAXC2.38) * (100 * (C38 / MAXC2.38 - 1)) ^ 2 - (C39 < C40) * (100 * (C39 / C40 - 1)) ^ 2) / 40) ^ .5

My interpretation of 100-Period Ulster Index is too long and slow to post in the forums.

PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!



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