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 |

Crossing up through 150 day MA Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
sabre365
Posted : Thursday, October 4, 2012 10:07:46 PM
Registered User
Joined: 10/23/2011
Posts: 7

What is the formula to find stocks that have been trading sideways for a year below their 150 moving average and then for the last 2 weeks have been trading above their 150 moving average?

 

J. Mike M

Bruce_L
Posted : Friday, October 5, 2012 8:35:55 AM


Worden Trainer

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

Without even considering the sideways portion of your request, a Condition Formula for price trading below its moving average for 252 trading days and then trading above its moving average for the most recent 10 trading days would be quite long because you would need to individually check each of these days. And the result is incredibly restrictive.

C > AVGC150 AND C1 > AVGC150.1 AND C2 > AVGC150.2 AND C3 > AVGC150.3 AND C4 > AVGC150.4 AND C5 > AVGC150.5 AND C6 > AVGC150.6 AND C7 > AVGC150.7 AND C8 > AVGC150.8 AND C9 > AVGC150.9 AND C10 > AVGC150.10 AND C11 < AVGC150.11 AND C12 < AVGC150.12 AND C13 < AVGC150.13 AND C14 < AVGC150.14 AND C15 < AVGC150.15 AND C16 < AVGC150.16 AND C17 < AVGC150.17 AND C18 < AVGC150.18 AND C19 < AVGC150.19 AND C20 < AVGC150.20 AND C21 < AVGC150.21 AND C22 < AVGC150.22 AND C23 < AVGC150.23 AND C24 < AVGC150.24 AND C25 < AVGC150.25 AND C26 < AVGC150.26 AND C27 < AVGC150.27 AND C28 < AVGC150.28 AND C29 < AVGC150.29 AND C30 < AVGC150.30 AND C31 < AVGC150.31 AND C32 < AVGC150.32 AND C33 < AVGC150.33 AND C34 < AVGC150.34 AND C35 < AVGC150.35 AND C36 < AVGC150.36 AND C37 < AVGC150.37 AND C38 < AVGC150.38 AND C39 < AVGC150.39 AND C40 < AVGC150.40 AND C41 < AVGC150.41 AND C42 < AVGC150.42 AND C43 < AVGC150.43 AND C44 < AVGC150.44 AND C45 < AVGC150.45 AND C46 < AVGC150.46 AND C47 < AVGC150.47 AND C48 < AVGC150.48 AND C49 < AVGC150.49 AND C50 < AVGC150.50 AND C51 < AVGC150.51 AND C52 < AVGC150.52 AND C53 < AVGC150.53 AND C54 < AVGC150.54 AND C55 < AVGC150.55 AND C56 < AVGC150.56 AND C57 < AVGC150.57 AND C58 < AVGC150.58 AND C59 < AVGC150.59 AND C60 < AVGC150.60 AND C61 < AVGC150.61 AND C62 < AVGC150.62 AND C63 < AVGC150.63 AND C64 < AVGC150.64 AND C65 < AVGC150.65 AND C66 < AVGC150.66 AND C67 < AVGC150.67 AND C68 < AVGC150.68 AND C69 < AVGC150.69 AND C70 < AVGC150.70 AND C71 < AVGC150.71 AND C72 < AVGC150.72 AND C73 < AVGC150.73 AND C74 < AVGC150.74 AND C75 < AVGC150.75 AND C76 < AVGC150.76 AND C77 < AVGC150.77 AND C78 < AVGC150.78 AND C79 < AVGC150.79 AND C80 < AVGC150.80 AND C81 < AVGC150.81 AND C82 < AVGC150.82 AND C83 < AVGC150.83 AND C84 < AVGC150.84 AND C85 < AVGC150.85 AND C86 < AVGC150.86 AND C87 < AVGC150.87 AND C88 < AVGC150.88 AND C89 < AVGC150.89 AND C90 < AVGC150.90 AND C91 < AVGC150.91 AND C92 < AVGC150.92 AND C93 < AVGC150.93 AND C94 < AVGC150.94 AND C95 < AVGC150.95 AND C96 < AVGC150.96 AND C97 < AVGC150.97 AND C98 < AVGC150.98 AND C99 < AVGC150.99 AND C100 < AVGC150.100 AND C101 < AVGC150.101 AND C102 < AVGC150.102 AND C103 < AVGC150.103 AND C104 < AVGC150.104 AND C105 < AVGC150.105 AND C106 < AVGC150.106 AND C107 < AVGC150.107 AND C108 < AVGC150.108 AND C109 < AVGC150.109 AND C110 < AVGC150.110 AND C111 < AVGC150.111 AND C112 < AVGC150.112 AND C113 < AVGC150.113 AND C114 < AVGC150.114 AND C115 < AVGC150.115 AND C116 < AVGC150.116 AND C117 < AVGC150.117 AND C118 < AVGC150.118 AND C119 < AVGC150.119 AND C120 < AVGC150.120 AND C121 < AVGC150.121 AND C122 < AVGC150.122 AND C123 < AVGC150.123 AND C124 < AVGC150.124 AND C125 < AVGC150.125 AND C126 < AVGC150.126 AND C127 < AVGC150.127 AND C128 < AVGC150.128 AND C129 < AVGC150.129 AND C130 < AVGC150.130 AND C131 < AVGC150.131 AND C132 < AVGC150.132 AND C133 < AVGC150.133 AND C134 < AVGC150.134 AND C135 < AVGC150.135 AND C136 < AVGC150.136 AND C137 < AVGC150.137 AND C138 < AVGC150.138 AND C139 < AVGC150.139 AND C140 < AVGC150.140 AND C141 < AVGC150.141 AND C142 < AVGC150.142 AND C143 < AVGC150.143 AND C144 < AVGC150.144 AND C145 < AVGC150.145 AND C146 < AVGC150.146 AND C147 < AVGC150.147 AND C148 < AVGC150.148 AND C149 < AVGC150.149 AND C150 < AVGC150.150 AND C151 < AVGC150.151 AND C152 < AVGC150.152 AND C153 < AVGC150.153 AND C154 < AVGC150.154 AND C155 < AVGC150.155 AND C156 < AVGC150.156 AND C157 < AVGC150.157 AND C158 < AVGC150.158 AND C159 < AVGC150.159 AND C160 < AVGC150.160 AND C161 < AVGC150.161 AND C162 < AVGC150.162 AND C163 < AVGC150.163 AND C164 < AVGC150.164 AND C165 < AVGC150.165 AND C166 < AVGC150.166 AND C167 < AVGC150.167 AND C168 < AVGC150.168 AND C169 < AVGC150.169 AND C170 < AVGC150.170 AND C171 < AVGC150.171 AND C172 < AVGC150.172 AND C173 < AVGC150.173 AND C174 < AVGC150.174 AND C175 < AVGC150.175 AND C176 < AVGC150.176 AND C177 < AVGC150.177 AND C178 < AVGC150.178 AND C179 < AVGC150.179 AND C180 < AVGC150.180 AND C181 < AVGC150.181 AND C182 < AVGC150.182 AND C183 < AVGC150.183 AND C184 < AVGC150.184 AND C185 < AVGC150.185 AND C186 < AVGC150.186 AND C187 < AVGC150.187 AND C188 < AVGC150.188 AND C189 < AVGC150.189 AND C190 < AVGC150.190 AND C191 < AVGC150.191 AND C192 < AVGC150.192 AND C193 < AVGC150.193 AND C194 < AVGC150.194 AND C195 < AVGC150.195 AND C196 < AVGC150.196 AND C197 < AVGC150.197 AND C198 < AVGC150.198 AND C199 < AVGC150.199 AND C200 < AVGC150.200 AND C201 < AVGC150.201 AND C202 < AVGC150.202 AND C203 < AVGC150.203 AND C204 < AVGC150.204 AND C205 < AVGC150.205 AND C206 < AVGC150.206 AND C207 < AVGC150.207 AND C208 < AVGC150.208 AND C209 < AVGC150.209 AND C210 < AVGC150.210 AND C211 < AVGC150.211 AND C212 < AVGC150.212 AND C213 < AVGC150.213 AND C214 < AVGC150.214 AND C215 < AVGC150.215 AND C216 < AVGC150.216 AND C217 < AVGC150.217 AND C218 < AVGC150.218 AND C219 < AVGC150.219 AND C220 < AVGC150.220 AND C221 < AVGC150.221 AND C222 < AVGC150.222 AND C223 < AVGC150.223 AND C224 < AVGC150.224 AND C225 < AVGC150.225 AND C226 < AVGC150.226 AND C227 < AVGC150.227 AND C228 < AVGC150.228 AND C229 < AVGC150.229 AND C230 < AVGC150.230 AND C231 < AVGC150.231 AND C232 < AVGC150.232 AND C233 < AVGC150.233 AND C234 < AVGC150.234 AND C235 < AVGC150.235 AND C236 < AVGC150.236 AND C237 < AVGC150.237 AND C238 < AVGC150.238 AND C239 < AVGC150.239 AND C240 < AVGC150.240 AND C241 < AVGC150.241 AND C242 < AVGC150.242 AND C243 < AVGC150.243 AND C244 < AVGC150.244 AND C245 < AVGC150.245 AND C246 < AVGC150.246 AND C247 < AVGC150.247 AND C248 < AVGC150.248 AND C249 < AVGC150.249 AND C250 < AVGC150.250 AND C251 < AVGC150.251 AND C252 < AVGC150.252 AND C253 < AVGC150.253 AND C254 < AVGC150.254 AND C255 < AVGC150.255 AND C256 < AVGC150.256 AND C257 < AVGC150.257 AND C258 < AVGC150.258 AND C259 < AVGC150.259 AND C260 < AVGC150.260 AND C261 < AVGC150.261

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

It is possible to create a "fuzzy" approach to doing this using Custom PCF % True Indicators however. Create a Custom PCF % True Indicator for price being above its moving average:

- Period: 10
- Average Type: Simple
- Boolean Formula: C > AVGC10

And another Custom PCF % True Indicator for price being below its moving average:

- Period: 262
- Average Type: Simple
- Boolean formula: C < AVGC10

Then click on both of the Custom PCF % True Indicators and select Create Scan Condition. You could start by checking for the "above its moving average" Custom PCF % True Indicator to be Greater Than 85 and the "below its moving average" Custom PCF % True Indicator to be Greater Than 95.

Note that these numbers represent the percentage of the time that the moving average was above or below the moving average during the period specified in the Custom PCF % True Indicator. You can adjust both the Period of the Custom PCF % True Indicator and the Greater Than percentage of the Condition to adjust how fuzzy you want the Conditions to be.

Creating Scan and Sort Conditions

You would then use both Conditions as EasyScan Conditions in the same EasyScan.

EasyScan Basics
EasyScan Expanded

Even the fuzzy version is relatively restrictive without even adding requirements for trading sideways. If we are going to add trading sideways requirements as well, you would need to come up with an unambiguous objective definition of the term which could be used to test for this requirement.



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