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 |

How can I tell a scan I want something to have occurred within the past 5 days? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
tgilbert220
Posted : Friday, June 10, 2016 12:15:37 AM
Registered User
Joined: 3/21/2005
Posts: 9

For example, I want to have an RSI (period 2) <= 20, within the past 5 days.

I wrote "MIN(WRSI2,5) <= 20" but I'm getting a "Formula Error." 

Thanks for your help.

Bruce_L
Posted : Friday, June 10, 2016 10:06:08 AM


Worden Trainer

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

If it is a plain RSI without Wilder's smoothing then you could write the following.

MIN(RSI2,5) <= 20

The Condition Formula would be quite a bit longer for the Wilder's RSI version with Wilder's smoothing however because we can't use the MIN() function and because the formula for the RSI itself is quite a bit longer.

50 * (C - XAVGC3.1) / 2 / (.50003052 * (ABS(C - C1) + .5 * (ABS(C1 - C2) + .5 * (ABS(C2 - C3) + .5 * (ABS(C3 - C4) + .5 * (ABS(C4 - C5) + .5 * (ABS(C5 - C6) + .5 * (ABS(C6 - C7) + .5 * (ABS(C7 - C8) + .5 * (ABS(C8 - C9) + .5 * (ABS(C9 - C10) + .5 * (ABS(C10 - C11) + .5 * (ABS(C11 - C12) + .5 * (ABS(C12 - C13) + .5 * (ABS(C13 - C14)))))))))))))))) + 50 <= 20 OR 50 * (C1 - XAVGC3.2) / 2 / (.50003052 * (ABS(C1 - C2) + .5 * (ABS(C2 - C3) + .5 * (ABS(C3 - C4) + .5 * (ABS(C4 - C5) + .5 * (ABS(C5 - C6) + .5 * (ABS(C6 - C7) + .5 * (ABS(C7 - C8) + .5 * (ABS(C8 - C9) + .5 * (ABS(C9 - C10) + .5 * (ABS(C10 - C11) + .5 * (ABS(C11 - C12) + .5 * (ABS(C12 - C13) + .5 * (ABS(C13 - C14) + .5 * (ABS(C14 - C15)))))))))))))))) + 50 <= 20 OR 50 * (C2 - XAVGC3.3) / 2 / (.50003052 * (ABS(C2 - C3) + .5 * (ABS(C3 - C4) + .5 * (ABS(C4 - C5) + .5 * (ABS(C5 - C6) + .5 * (ABS(C6 - C7) + .5 * (ABS(C7 - C8) + .5 * (ABS(C8 - C9) + .5 * (ABS(C9 - C10) + .5 * (ABS(C10 - C11) + .5 * (ABS(C11 - C12) + .5 * (ABS(C12 - C13) + .5 * (ABS(C13 - C14) + .5 * (ABS(C14 - C15) + .5 * (ABS(C15 - C16)))))))))))))))) + 50 <= 20 OR 50 * (C3 - XAVGC3.4) / 2 / (.50003052 * (ABS(C3 - C4) + .5 * (ABS(C4 - C5) + .5 * (ABS(C5 - C6) + .5 * (ABS(C6 - C7) + .5 * (ABS(C7 - C8) + .5 * (ABS(C8 - C9) + .5 * (ABS(C9 - C10) + .5 * (ABS(C10 - C11) + .5 * (ABS(C11 - C12) + .5 * (ABS(C12 - C13) + .5 * (ABS(C13 - C14) + .5 * (ABS(C14 - C15) + .5 * (ABS(C15 - C16) + .5 * (ABS(C16 - C17)))))))))))))))) + 50 <= 20 OR 50 * (C4 - XAVGC3.5) / 2 / (.50003052 * (ABS(C4 - C5) + .5 * (ABS(C5 - C6) + .5 * (ABS(C6 - C7) + .5 * (ABS(C7 - C8) + .5 * (ABS(C8 - C9) + .5 * (ABS(C9 - C10) + .5 * (ABS(C10 - C11) + .5 * (ABS(C11 - C12) + .5 * (ABS(C12 - C13) + .5 * (ABS(C13 - C14) + .5 * (ABS(C14 - C15) + .5 * (ABS(C15 - C16) + .5 * (ABS(C16 - C17) + .5 * (ABS(C17 - C18)))))))))))))))) + 50 <= 20

You could use the following shorter Boolean Formula with the technique given below however.

Condition True at Least Once Over x Bars

50 * (C - XAVGC3.1) / 2 / (.50003052 * (ABS(C - C1) + .5 * (ABS(C1 - C2) + .5 * (ABS(C2 - C3) + .5 * (ABS(C3 - C4) + .5 * (ABS(C4 - C5) + .5 * (ABS(C5 - C6) + .5 * (ABS(C6 - C7) + .5 * (ABS(C7 - C8) + .5 * (ABS(C8 - C9) + .5 * (ABS(C9 - C10) + .5 * (ABS(C10 - C11) + .5 * (ABS(C11 - C12) + .5 * (ABS(C12 - C13) + .5 * (ABS(C13 - C14)))))))))))))))) + 50 <= 20



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
tgilbert220
Posted : Friday, June 10, 2016 3:06:08 PM
Registered User
Joined: 3/21/2005
Posts: 9

OMG, I'm so glad I asked, b/c I'd never have figured it out on my own.  Thank you so much!

Bruce_L
Posted : Friday, June 10, 2016 3:42: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.