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 |

Binary code in TC2000 Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
icookwithwine
Posted : Tuesday, September 8, 2015 8:50:36 PM
Registered User
Joined: 5/13/2015
Posts: 11

Hello, 

is it possible to write a custom indicator in TC2000 that does this?

======================

If the low is higher then the 21 bars xaverage offsetted by 1 then the trend =1

if the high is lower then the  21 bars xaverage offsetted by 1 then the trend = -1 

otherswise the trend is equal to the trend of the previous bar.

============================
 
I could make it work in stockfinder 5 thanks to the help of a kind stockfinder user.  It would be terriffic if I could have it working also in TC2000, but wothout an pcf "if" funcion I feel a bit lost. 
 
Thank you

 

Bruce_L
Posted : Wednesday, September 9, 2015 12:06:21 PM


Worden Trainer

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

This is unfortunately not going to look nearly as nice as the same thing in StockFinder. This particular version looks at the most recent 25 bars to find an entire bar above or below the 21 period exponential moving average of 1 bar ago. It returns 0 if this is not the case.

Days Since Last Peak (or other day-counting needs)

SGN(ABS(L > XAVGC21.1 OR XAVGC21.1 > H) * (C - XAVGC21.1) + ABS(L <= XAVGC21.1 AND XAVGC21.1 <= H) * (ABS(L1 > XAVGC21.2 OR XAVGC21.2 > H1) * (C1 - XAVGC21.2) + ABS(L1 <= XAVGC21.2 AND XAVGC21.2 <= H1) * (ABS(L2 > XAVGC21.3 OR XAVGC21.3 > H2) * (C2 - XAVGC21.3) + ABS(L2 <= XAVGC21.3 AND XAVGC21.3 <= H2) * (ABS(L3 > XAVGC21.4 OR XAVGC21.4 > H3) * (C3 - XAVGC21.4) + ABS(L3 <= XAVGC21.4 AND XAVGC21.4 <= H3) * (ABS(L4 > XAVGC21.5 OR XAVGC21.5 > H4) * (C4 - XAVGC21.5) + ABS(L4 <= XAVGC21.5 AND XAVGC21.5 <= H4) * (ABS(L5 > XAVGC21.6 OR XAVGC21.6 > H5) * (C5 - XAVGC21.6) + ABS(L5 <= XAVGC21.6 AND XAVGC21.6 <= H5) * (ABS(L6 > XAVGC21.7 OR XAVGC21.7 > H6) * (C6 - XAVGC21.7) + ABS(L6 <= XAVGC21.7 AND XAVGC21.7 <= H6) * (ABS(L7 > XAVGC21.8 OR XAVGC21.8 > H7) * (C7 - XAVGC21.8) + ABS(L7 <= XAVGC21.8 AND XAVGC21.8 <= H7) * (ABS(L8 > XAVGC21.9 OR XAVGC21.9 > H8) * (C8 - XAVGC21.9) + ABS(L8 <= XAVGC21.9 AND XAVGC21.9 <= H8) * (ABS(L9 > XAVGC21.10 OR XAVGC21.10 > H9) * (C9 - XAVGC21.10) + ABS(L9 <= XAVGC21.10 AND XAVGC21.10 <= H9) * (ABS(L10 > XAVGC21.11 OR XAVGC21.11 > H10) * (C10 - XAVGC21.11) + ABS(L10 <= XAVGC21.11 AND XAVGC21.11 <= H10) * (ABS(L11 > XAVGC21.12 OR XAVGC21.12 > H11) * (C11 - XAVGC21.12) + ABS(L11 <= XAVGC21.12 AND XAVGC21.12 <= H11) * (ABS(L12 > XAVGC21.13 OR XAVGC21.13 > H12) * (C12 - XAVGC21.13) + ABS(L12 <= XAVGC21.13 AND XAVGC21.13 <= H12) * (ABS(L13 > XAVGC21.14 OR XAVGC21.14 > H13) * (C13 - XAVGC21.14) + ABS(L13 <= XAVGC21.14 AND XAVGC21.14 <= H13) * (ABS(L14 > XAVGC21.15 OR XAVGC21.15 > H14) * (C14 - XAVGC21.15) + ABS(L14 <= XAVGC21.15 AND XAVGC21.15 <= H14) * (ABS(L15 > XAVGC21.16 OR XAVGC21.16 > H15) * (C15 - XAVGC21.16) + ABS(L15 <= XAVGC21.16 AND XAVGC21.16 <= H15) * (ABS(L16 > XAVGC21.17 OR XAVGC21.17 > H16) * (C16 - XAVGC21.17) + ABS(L16 <= XAVGC21.17 AND XAVGC21.17 <= H16) * (ABS(L17 > XAVGC21.18 OR XAVGC21.18 > H17) * (C17 - XAVGC21.18) + ABS(L17 <= XAVGC21.18 AND XAVGC21.18 <= H17) * (ABS(L18 > XAVGC21.19 OR XAVGC21.19 > H18) * (C18 - XAVGC21.19) + ABS(L18 <= XAVGC21.19 AND XAVGC21.19 <= H18) * (ABS(L19 > XAVGC21.20 OR XAVGC21.20 > H19) * (C19 - XAVGC21.20) + ABS(L19 <= XAVGC21.20 AND XAVGC21.20 <= H19) * (ABS(L20 > XAVGC21.21 OR XAVGC21.21 > H20) * (C20 - XAVGC21.21) + ABS(L20 <= XAVGC21.21 AND XAVGC21.21 <= H20) * (ABS(L21 > XAVGC21.22 OR XAVGC21.22 > H21) * (C21 - XAVGC21.22) + ABS(L21 <= XAVGC21.22 AND XAVGC21.22 <= H21) * (ABS(L22 > XAVGC21.23 OR XAVGC21.23 > H22) * (C22 - XAVGC21.23) + ABS(L22 <= XAVGC21.23 AND XAVGC21.23 <= H22) * (ABS(L23 > XAVGC21.24 OR XAVGC21.24 > H23) * (C23 - XAVGC21.24) + ABS(L23 <= XAVGC21.24 AND XAVGC21.24 <= H23) * (ABS(L24 > XAVGC21.25 OR XAVGC21.25 > H24) * (C24 - XAVGC21.25))))))))))))))))))))))))))



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
icookwithwine
Posted : Wednesday, September 9, 2015 1:14:31 PM
Registered User
Joined: 5/13/2015
Posts: 11

WOW!!! I couldn't believe it was possible!!! I tried so much! I am glad I asked you

Thank you so much Bruce. You are providing an unbeliavable support for the Worden products. 

 

 

Bruce_L
Posted : Wednesday, September 9, 2015 1:21:12 PM


Worden Trainer

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

You're welcome.



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