** Updated April 5, 2014 see addendum notes.
Have you ever read the scanning documentation or reviewed someone else's scan coding and thought this just doesn't make sense to me, well you are not alone it happens to all of us. We are not identical computers running the same version of software, we are individual, (and thats a good thing).
Scans are mathematical relationships between various variables and by default we all think of those relationships a little differently. Here's a few examples to get you thinking outside of "YOUR" box.
In the following case A is greater than B, but from the other side B is less than A, what was Your first thought?
Now lets review some of the mathematical relationships between A & B and the various ways we could write them. Remember mathematical relationships are usually read from left to right, ie A is greater than B, (A > B) however the converse is also true, as read right to left, ie B is less than A, (B < A). Here's a table of just a few of the relationships we could write about the A & B example shown above. Note they all describe the same thing, just stated in different ways from a different point of reference and if used in a scan they would all yield the same results.
Now lets apply this to a couple of chart scan examples and we'll be looking for < or >, rather than = , and we'll also replace A & B with actual technical variables.
1- Looking for todays close to be more than 25% above todays SMA-50 of the close. [ A > B * 1.25 ]
and [Close > SMA(50, Close) * 1.25]
This is the chartstyle I would use for laying out the scan and maybe a slightly shorter period for checking the scan. Note the use of the SMA envelopes to easily see the +/- 25% lines around the SMA-50
2- Or looking for the same thing using a different formula we could use the following. [ A < B * 0.8 ]
and [SMA(50, Close) < Close * 0.8 ]
Similar layout and checking chart, although in this case we are looking for the +/- 20% lines around the closing price. We can still use the SMA envelopes, the trick is to set the SMA to a value of 1 period, (ie the close).
So in summary there is almost always more than one way to write a scan. I like " [ A > B * 1.25]", but some like to see it as " [ B * 1.25 < A ]" or "[ A * 0.8 > B ]", all depends on how "Your" mind thinks. Just get comfortable with your prefered format and when you save someone else's scan for future reference just modify it to your way of thinking and maybe add a few comment notes.
** Addendum notes, additional details
With my engineering background I have been working with mathematical relationships for over 50 years, thus the above comes easily without even thinking about it. However if this is not your background you may find these extra notes will help get you on the right track.
Part I, defining the relationship graphically
First when thinking about mathematical relationships define a scale that works for you in determining the relationship graphically. It doesn't really matter what scale as long as you use the same one for both sides, A&B. Then ignore the greater than or less than signs, just work on how to make them equal, you can move on to the , < or > signs later.
1) Lets start with numbering the blocks 1, thru 5. Thus if A is 5 blocks and B is 4 blocks, then we could write the equation, A times 4/5 = B. Looking at it from the other side if B is 4 blocks and A is 5 blocks, we could write B times 5/4 = A.
A * 4/5 = B B * 5/4 = A
Now lets simplify this a bit, 4/5 = 0.8 and 5/4 = 1.25, so the above can be rewritten as;
A * 0.8 = B B * 1.25 = A
2) Lets try a different scale numbering system, we'll make the value of A = 100, thus the five blocks of A become 20, 40, 60, 80, 100 and using this scale B = 80. Thus the relationship could be written as A times 80/100 = B or B times 100/80 = A.
A * 80/100 = B B * 100/80 = A
Again lets simplify this a bit, 80/100 = 0.8 and 100/80 = 1.25, so the above can be rewritten as;
A * 0.8 = B B * 1.25 = A
3) Lets try a different scale numbering system, this time we'll make the value of B = 100, thus the four blocks of B become 25, 50, 75, 100 and using this scale A = 125. Thus the relationship could be written as B times 125/100 = A or A times 100/125 = B.
B * 125/100 = A A * 100/125 = B
Again lets simplify this a bit, 125/100 = 1.25 and 100/125 = 0.8, so the above can be rewritten as;
B * 1.25 = A A * 0.8 = B
Notice how even when using different scales, the mathematical relationships still simplify to the same basic formulas. The scaling method you use just depends on which way your mind likes to think and whether you want to define A in terms of B, or B in terms of A.
Now you may also want to brush up on a little high school Algebra, just Google it there are lots of tutorials. But basic Algebra also lets us manipulate the formulas once we have one valid relationship.
The basic premise is that as long as we do the same thing to both sides of the equation, the equation is still valid. So lets start with;
B * 1.25 = A
Divide both sides by 1.25
B * 1.25 /1.25 = A / 1.25 simplify B * 1 = A /1.25 simplify B = A * 0.8 or A * 0.8 = B
So again we arrive back at the same formulas we developed graphically above but this time we've used some basic algebraic manipulation. I could continue, but I'll let you do your own DD.
Part II, the charts used for verifying and troubleshooting the scan.
I find when verifying and troubleshooting a scan, the quickest and easiest way is to create a chartstyle that highlights only what is in the scan. This is not a chartstyle I would use for Technical Analysis, its focused on just the scan parameters I want to verify and I want to see them graphically so I can visually check at least 50 charts in a few seconds without having to look and compare individual numbers on each chart.
Limit the chartstyle to only the key parameters in the scan. If the scan involves things that happened in the last 5 days, do not look at a 12 month chart, look at a 10 day chart.
Use indicators and overlays set up to highlight the parameters of your scan, performance charts are also helpful when the scan involves percent change.
For review I use the 10 per page view and I can quickly scroll thru 50 charts in a couple of minutes. If the scan is fairly simple and the parameters can be seen on a small chart I'll save a CandleGlance chartstyle and then can review 30 charts per page quickly.