Dear Sandwedge ,
This scan gives a true signal on each bar of every symbol. Here is the easiest way to see this:
- copy the scan code and apply it
- open any symbol from the Scan Results (double-click the symbol)
- open Tools -> Study Builder, create a new study, paste the scan code into it and apply it to the chart
Here are some errors in your code:
lowValue := Close\i\;
highValue := Close\i\;
if (Close\i\ < lowValue)
{Close\i\ < Close\i\} then
{always false} begin
lowValue := Close\i\;
end;
if (Close\i\ > highValue)
{Close\i\ > Close\i\} then
{always false} begin
highValue := Close\i\;
end;
end;
delta := ( (highValue - lowValue)/2 );
{ (Close\i\ - Close\i\)/2 always equals 0}Sincerely,
Tradecision Support Team
I have attempted to use neatscan on numerous occasions to develop simple programs. I can never seem to validate the results my programs provide (in other words neatscan returns stocks that do not appear to meet my criteria, thus I lose confidence in the results. Let me provide a simple example of volatility program. I suspect the issues is with either the way I'm attempting to address previous day i.e Close\i\ or with the floating point values that are generated by division operations. Any suggestions or comments are appreciated.
{
*****
High Volitility Stocks
Look for stocks that have varied
significantly over the past 20 trading sessions
Author: Sandwedge
1/31/2009
*****
}
var
i:=1;
len:=20;
delta := 0.00;
midPoint := 0.00;
lowValue :=0.00;
highValue := 0.00;
threshold := 75.00;
theDiff := 0.0000;
ret := false;
end_var;
lowValue := Close\i\;
highValue := Close\i\;
for i:=1 to len do
begin
if (Close\i\ < lowValue) then
begin
lowValue := Close\i\;
end;
if (Close\i\ > highValue) then
begin
highValue := Close\i\;
end;
end;
delta := ( (highValue - lowValue)/2 );
midPoint := lowValue + delta;
theDiff := ( ((midPoint - delta) / midPoint) * 100);
if (theDiff > threshold) then
begin
ret := true;
end;
else
begin
ret := false;
end;
return ret;