Tradecision Talks
May 25, 2013, 09:12:37 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Neatscan previous day(s) access  (Read 1654 times)
Sandwedge
Newbie
*
Posts: 1


« on: February 06, 2010, 11:45:03 AM »

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;
« Last Edit: February 06, 2010, 12:00:00 PM by Sandwedge » Logged
Tradecision Support Team
Hero Member
*****
Posts: 336


« Reply #1 on: February 08, 2010, 04:45:31 AM »

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;
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!