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 |

ATR Trailing Stop/Channels Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
drpolk
Posted : Sunday, June 3, 2012 1:31:53 PM
Gold Customer Gold Customer

Joined: 3/30/2010
Posts: 8

I have been playing around with this formula for an ATR trailing stop.

2 Questions.

1) How would I modify this formula to create the upper channel for a short position exit?

2) Is there any way to ratchet this so that once a high is reached it won't allow it to dip below that high.

MAXH22 - 3.5 * ((L < C1) * L + (L >= C1) * C1 - (H > C1) * H - (H <= C1) * C1 +
(L1 < C2) * L1 + (L1 >= C2) * C2 - (H1 > C2) * H1 - (H1 <= C2) * C2 +
(L2 < C3) * L2 + (L2 >= C3) * C3 - (H2 > C3) * H2 - (H2 <= C3) * C3 +
(L3 < C4) * L3 + (L3 >= C4) * C4 - (H3 > C4) * H3 - (H3 <= C4) * C4 +
(L4 < C5) * L4 + (L4 >= C5) * C5 - (H4 > C5) * H4 - (H4 <= C5) * C5 +
(L5 < C6) * L5 + (L5 >= C6) * C6 - (H5 > C6) * H5 - (H5 <= C6) * C6 +
(L6 < C7) * L6 + (L6 >= C7) * C7 - (H6 > C7) * H6 - (H6 <= C7) * C7 +
(L7 < C8) * L7 + (L7 >= C8) * C8 - (H7 > C8) * H7 - (H7 <= C8) * C8 +
(L8 < C9) * L8 + (L8 >= C9) * C9 - (H8 > C9) * H8 - (H8 <= C9) * C9 +
(L9 < C10) * L9 + (L9 >= C10) * C10 - (H9 > C10) * H9 - (H9 <= C10) * C10 +
(L10 < C11) * L10 + (L10 >= C11) * C11 - (H10 > C11) * H10 - (H10 <= C11) * C11 +
(L11 < C12) * L11 + (L11 >= C12) * C12 - (H11 > C12) * H11 - (H11 <= C12) * C12 +
(L12 < C13) * L12 + (L12 >= C13) * C13 - (H12 > C13) * H12 - (H12 <= C13) * C13 +
(L13 < C14) * L13 + (L13 >= C14) * C14 - (H13 > C14) * H13 - (H13 <= C14) * C14 +
(L14 < C15) * L14 + (L14 >= C15) * C15 - (H14 > C15) * H14 - (H14 <= C15) * C15 +
(L15 < C16) * L15 + (L15 >= C16) * C16 - (H15 > C16) * H15 - (H15 <= C16) * C16 +
(L16 < C17) * L16 + (L16 >= C17) * C17 - (H16 > C17) * H16 - (H16 <= C17) * C17 +
(L17 < C18) * L17 + (L17 >= C18) * C18 - (H17 > C18) * H17 - (H17 <= C18) * C18 +
(L18 < C19) * L18 + (L18 >= C19) * C19 - (H18 > C19) * H18 - (H18 <= C19) * C19 +
(L19 < C20) * L19 + (L19 >= C20) * C20 - (H19 > C20) * H19 - (H19 <= C20) * C20 +
(L20 < C21) * L20 + (L20 >= C21) * C21 - (H20 > C21) * H20 - (H20 <= C21) * C21 +
(L21 < C22) * L21 + (L21 >= C22) * C22 - (H21 > C22) * H21 - (H21 <= C22) * C22) / 22

Bruce_L
Posted : Monday, June 4, 2012 8:18:26 AM


Worden Trainer

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

Inverting your formula would involve adding 3.5 times a 22-Period Simple Moving Average of True Range:

MINL22 + 3.5 * ((AVGH22 - AVGL22) / 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) + ABS(H10 - C11) + ABS(C11 - L10) + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H12 - C13) + ABS(C13 - L12) + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H14 - C15) + ABS(C15 - L14) + ABS(H15 - C16) + ABS(C16 - L15) + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H17 - C18) + ABS(C18 - L17) + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H19 - C20) + ABS(C20 - L19) + ABS(H20 - C21) + ABS(C21 - L20) + ABS(H21 - C22) + ABS(C22 - L21)) / 44)

I do not know of a way to create a formula short enough to be practical which would not retreat.

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



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
drpolk
Posted : Monday, June 4, 2012 12:49:31 PM
Gold Customer Gold Customer

Joined: 3/30/2010
Posts: 8

Great! Thanks Bruce.

Bruce_L
Posted : Monday, June 4, 2012 12:56:41 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.