Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

SF5 is not a SCANNING tool, just a sorting tool. Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
william2
Posted : Tuesday, June 8, 2010 1:28:45 PM
Registered User
Joined: 9/15/2009
Posts: 3
I am extremely disappointed to learn that SF5 cannot scan for stocks passing multiple rules as SF4 did. SF5 can only filter and sort, and sort based on ONLY ONE condition at a time! I cannot believe the designers would remove such a valuable feature. I cannot use SF5 and am now forced to go back to SF4 after investing 30+ hours in trying to scan in SF5.  I just spent 40 minutes with Worden tech support and they confirmed for me that SF5 will NOT scan like SF4. I thought version 5 was supposed to be an improvement!
jas0501
Posted : Tuesday, June 8, 2010 2:12:44 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
The loss of multi-column sort is in part due to the mix of beta testers and thier not using that particular feature so it wasn't missed. Too bad you didn't participate in the beta testing. I expect you would have uncovered this oversight in no time.


I don;t know if it will be corrected. I'm sure it is very useful.


There is one way to accomplish the effect via real code. It is not as dynamic, as changing the column membership requires editing the realcode indicator. One can make it somewat dynamic with a userinput specifying the column order. Assume  you have 6 conditions COND1 thru COND6.

You can specify the sort column ordering with a 6 digit number  123456 or 654321 or 136542 etc.

'# columnOrder = userinput.integer = 123456

then compose a 7 digit number stating with 1 and having a 0 or a 1 for each of the 6 condition based on value.
 So for example is the columnOrder is 135246 abd the conditon status is
COND1 =pass
COND3 =fail
COND5 =pass
COND2 =pass
COND4 =fail
COND6 =pass

then the number would be 
1101101

The code would look something like this

'# columnOrder = userinput.integer = 123456
'# COND1 = 
'# COND2 = 
'# COND3 = 
'# COND4 = 
'# COND5 = 
'# COND6 =
 

static dim CondCol(6) as integer
dim str                        as string

'
' initialize condition col assignments
'
if conditionCol(1) = 0 then
       str = columnOrder
       for i as integer = 1 to 6
           dim subscr as integer
           subscr =  Left(str,1)
           CondCol(subsrc) =  6 - i         
           str = right(str,6-i)
       next
end if
'
' assume only last bar value is needed, mimicing telechart
'  and making it faster
'
if islastbar then
      num = 10 ^ 6
      if COND1. value then
            num  +=  10 ^ CondCol(1)
      end if
      if COND2. value then
            num  +=  10 ^ CondCol(2)
      end if
      if COND3. value then
            num  +=  10 ^ CondCol(3)
      end if
      if COND4. value then
            num  +=  10 ^ CondCol(4)
      end if
      if COND5. value then
            num  +=  10 ^ CondCol(4)
      end if
      if COND6. value then
            num  +=  10 ^ CondCol(6)
      end if
end if
jas0501
Posted : Tuesday, June 8, 2010 2:14:38 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
QUOTE (jas0501)


'# columnOrder = userinput.integer = 123456
'# COND1 = 
'# COND2 = 
'# COND3 = 
'# COND4 = 
'# COND5 = 
'# COND6 =
 

static dim CondCol( 6 ) as integer
dim str                        as string

'
' initialize condition col assignments
'
if conditionCol(1) = 0 then
       str = columnOrder
       for i as integer = 1 to 6
           dim subscr as integer
           subscr =  Left(str,1)
           CondCol(subsrc) =  6 - i         
           str = right(str,6-i)
       next
end if
'
' assume only last bar value is needed, mimicing telechart
'  and making it faster
'
if islastbar then
      num = 10 ^ 6
      if COND1. value then
            num  +=  10 ^ CondCol(1)
      end if
      if COND2. value then
            num  +=  10 ^ CondCol(2)
      end if
      if COND3. value then
            num  +=  10 ^ CondCol(3)
      end if
      if COND4. value then
            num  +=  10 ^ CondCol(4)
      end if
      if COND5. value then
            num  +=  10 ^ CondCol(5)
      end if
      if COND6. value then
            num  +=  10 ^ CondCol( 6 )
      end if
end if
jas0501
Posted : Tuesday, June 8, 2010 2:18:11 PM
Registered User
Joined: 12/31/2005
Posts: 2,499

Oh and it helps to then plot Num

   
...
...
...
     Plot = num
end if

jas0501
Posted : Tuesday, June 8, 2010 3:28:06 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
Note:

if conditionCol(1) = 0 then

should be

if condCol(1) = 0 then

Some additional thoughts:


Changing the code to use AUTOLOOP = FALSE and making the adjustments to the code would speed it up considerably.


The reason for the starting with num = 1,000,000 is to present a visually unambiguous number for with multiple columns are false

1000111 versus   111
1001001 versus 1001
etc.


The code is uncompiled and untested but conceptually produces a number that can be used as a sort column and represents a prioritized multi-column sort.

There is no error checking of the userinput to detect invalid column assignments, as in 432256. This could/should be added.

The code could be made more generic to permit easy construction of different column count versions by assigning a const for the column count

const columns as integer = 6

and adjusting the code to use columns instead of 6 in the appropriate places.

Then just  inserting the

'# CONDx  = chartcondition.whatever

lines 

and the appropriately edited if-endif lines

      if CONDx. value then
            num  +=  10 ^ CondCol( x )
      end if


one could make 3 column ot 5 column version.


Note the number could have a decimal point so than

1100111

could be 

110.0111 if one preferred by adjusting the CondCol() value assignment


It would be an interesting  to adjust this concept to use a date pointer to permit picking the date to sort on.


jas0501
Posted : Tuesday, June 8, 2010 3:46:54 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
One final thought. 

For those times when indicators have the same num value, one could change the code to add a tiebreaker indicator. If one knew the indicator value range then one could map that range between .9999 and .0000 and then just add the mapped value to the num

'# TieBreaker = chartindicator.somesuch

dim mappedValue as single

...
...
mappedValue = ' code to map TieBreaker between .9999 and .0000
num += mappedValue


Then each 1001111 would become 1001111.mappedValue as in

1001111.7087
1001111.3026
1001111.1961
1001111.0654
etc
sfjeff
Posted : Friday, June 11, 2010 4:17:38 PM
Registered User
Joined: 9/28/2005
Posts: 54
William - Is there a reason you need to scan for multiple conditions?  Why not create a combo condition that can be backtested and provides a natural organization structure for the rules you want?  Why have two different places where you keep rule logic: 1) in the rules themselves and 2) in the watchlist where you have multiple conditions contributing to flag and sort order independently.  If you keep all logic associated with the condition you are interested in inside a main "My signal condition", it becomes a discrete object that can be dropped on watchlists or backtesters while maintaining semantic integrity.  IMO, scanning for multiple conditions confuses the user interface without providing any functionality that is missing from combo conditions (except for the true x of y recent bars in combos, which would be a nice addition, but is not something I rely on to be honest).
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.