OmniTrader Forum OmniTrader Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


  Current location        Thread information  
OmniTrader Upgrade Forums
OmniScan
Omniscan to filter out sector / industry group
Last Activity 3/11/2022 10:09 PM
21 replies, 2413 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : Omniscan to filter out sector / industry group
Posted : 2/23/2021 12:54 PM
Post #47928

Is there a way to create an Omniscan that does not return stocks in a certain sector or industry group?

For example, create a scan of S&P 500 stocks that does not include the energy sector. I know there are Zacks groups such as ZG015 but I can't figure out how to create an Omniscan that would filter out stocks in the Zacks group.

Alternatively, I have created a custom group of energy stocks. Is there a way to filter out stocks that are found in a custom group?
^ Top
Jim Dean

Sage
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 2/23/2021 1:14 PM
Post #47929 - In reply to #47928

Try this
Group(Symbol$) <> zackgrroupnumber
… or sector() or subgroup()
^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 2/23/2021 2:16 PM
Post #47930 - In reply to #47928

Thanks Jim but unfortunately I had no luck.
Using Group(Symbol$) <> "ZG015" produced an Invalid token 'Symbol$' in expression error.
Tried $Symbol in place of Symbol$ but got the same error.
Tried Symbol (no dollar sign) but got a Visual Basic compiler error saying Group is not declared.
Will attach screen shots...
Attached file : OmniScan1.jpg (55KB - 282 downloads)
Attached file : OmniScan2.jpg (47KB - 265 downloads)
Attached file : OmniScan3.jpg (69KB - 271 downloads)

^ Top
Jim Dean

Sage
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 2/23/2021 3:33 PM
Post #47931 - In reply to #47930

Sorry. Faulty memory.
I thought that they had included those functions in the Zacks upgrade.

Hmm. I don’t recall offhand for sure, but I think that all zacks groups have a long fixed length symbol name such as ZG12345678. Not at pc right now so I can’t check but it should be easy to.

If so, you can construct a rule based either on the number of characters or the prefix or both. Here is an example but you’ll have to tweak it for the actual Zacks ID structure:

To *only allow* Zacks symbols, use this:
Left$(Symbol,2) = “ZG” and len(symbol) = 10

To *NOT allow* Zacks symbols, use this:
Left$(Symbol,2) <> “ZG” or len(symbol) < 10

I used “MG” and it’s len = 3,4,5 to ID MG Sectors, Groups and Subgroups. IIRC, the ZG’s all are the same length - but again, easy to check from the pencil Omniscan table.

[Edited by Jim Dean on 2/23/2021 3:41 PM]

^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 2/26/2021 2:48 PM
Post #47933 - In reply to #47928

Thanks Jim but it doesn't look like there's a way to do this (at least I can't get it to work). I checked with OT support and there are not aware of a way to do this either. Not the end of the world but it would have been nice.
^ Top
Keith Parsons

Regular
252525
Posts: 76

Joined: 6/28/2009
Location: Durban, South Africa

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/1/2021 9:30 PM
Post #47937 - In reply to #47933

TonyJ
If support do give you a solution on Zacks - kindly post it.

Many thanks
^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/2/2021 5:42 AM
Post #47938 - In reply to #47928

Hi Keith,

OT Support said they were not aware of a way to filter out a Zacks group from an OmniScan. If they come back with a way to do so, I will post it here.

Tony
^ Top
Jim Dean

Sage
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/2/2021 9:12 AM
Post #47939 - In reply to #47938

The snapshot shows the typical structure of the Zacks symbols, which should help with understanding how/why these formulae work. They ARE correct syntax.

For a Focus List (or OScan Population) that has a mix of Zacks ZG######### symbols and other tradeable symbols, here are some rules that allow you to exclude various categories of the Zacks symbols, for use in a filter block or OmniScan:

To exclude all Zacks averages:
not( left(Symbol,2) = "ZG" )

To exclude only Zacks sectors:
not( left(Symbol,2) = "ZG" and len(Symbol) = 5 )

To exclude only Zacks groups:
not( left(Symbol,2) = "ZG" and len(Symbol) = 8 )

To exclude only Zacks subgroups:
not( left(Symbol,2) = "ZG" and len(Symbol) = 11 )

To exclude all Zacks except sectors:
not( left(Symbol,2) = "ZG" and len(Symbol) >= 5 )

To exclude all Zacks except subgroups:
not( left(Symbol,2) = "ZG" and len(Symbol) >= 5 and len(Symbol) <= 8 )

To exclude all Zacks except groups:
not( left(Symbol,2) = "ZG" and (len(Symbol) = 5 or len(Symbol) = 11) )

NOTE: to filter FOR those various symbols ... ie ONLY allow the Filter or Scan to include Zacks symbols of one form or another, simply remove the "not( ... )".



[Edited by Jim Dean on 3/2/2021 10:32 AM]

Attached file : Zacks symbol name sample.png (97KB - 721 downloads)

^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/2/2021 12:15 PM
Post #47940 - In reply to #47928

Hi Jim,

Yes, if I'm using "All Zacks Industry Groups" as the starting population in Omniscan then the various search criteria that you suggested will work to select (or filter out) the various groups and give you a symbol list of Zacks groups (e.g. ZG001, ZG001002, etc.)

However, what I am trying to accomplish is to take a stock list as the starting population (e.g. S&P 500, Nirvana lists like Large Cap stocks) and then try to filter out those stocks that belong to a certain sector. For example, let's say I want a population of stocks that are in the S&P 500 and are NOT energy stocks.

I may be wrong but I don't think there's a way to do this in an OmniScan. Seems like we would need a different reserved variable (instead of Symbol) to return the Zack group or subgroup that a stock symbol belongs to in order to filter a starting population that consists of a list of stocks.

But you are correct that there are ways to get lists of Zacks groups using the methods you suggested. There's plenty of value in that, it's just not what I'm looking to do.
^ Top
Jim Dean

Sage
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/2/2021 1:52 PM
Post #47941 - In reply to #47940

Ahhh ... sorry I guess I had it backwards. You're right, N needs to create functions: Sector(Symbol), Group(Symbol) and SubGroup(Symbol) that return a string value for the ZG symbol related to the current symbol being processed. Since OLang is geared more around numeric returns, I suspect this will be a while coming.

I actually did solve this problem for my MTV routine by creating a master excel csv data file that mapped all the supported stock symbols to the MG sector, group, subgrp ... so that by dint of a bunch of horsing around code, I could determine any of the three associated MG symbols, for whatever stock is current. This worked well, and fast.

The problem of doing this for Zacks is that unlike MG, which has not been updated for about a decade, the mapping of stock symbols to the ZG symbols can change literally every day, to some degree or another. It would be an exercise in futility to try to maintain the excel "map" for Zacks, on account of that.

HOWEVER, I do have a sorta-likely-to-work-around for you. As I understand it, you have a particular Zacks Sector or Group or Subgroup that you want to AVOID ... that is, any "current" stock symbol that is in the verboten ZG should be skipped and not processed. Is that correct?

Second question: is it usually just one ZG######### that you're trying to avoid, or is it a collection of three or four or more of them?

And finally ... are you using daily bars or intraday? (hint - my trick is much more likely to work for daily bars ... although maybe I can implement it for intraday with some hassling around.

PS: the solution uses this capability, in a rube-goldberg kinda way



[Edited by Jim Dean on 3/2/2021 1:56 PM]

^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/2/2021 3:01 PM
Post #47942 - In reply to #47928

Sorry Jim, I wasn't trying to add to your workload. I'm just working on EOD data, nothing intra-day.

I agree, functions like Sector(Symbol), Group(Symbol) and SubGroup(Symbol) would be nice to have.

Normally when you add groups to the starting population, the stocks from each group are added together to make the initial population list. Another approach in place of the functions would be to have a means of specifying an exception population. Any stocks found in the exception population would be removed from the starting population. Don't know, that may be more difficult an approach that the new functions though. Certainly would require a UI change as well as some logic changes. On the plus side, I think it would be more visually intuitive.
^ Top
Jim Dean

Sage
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/2/2021 3:35 PM
Post #47943 - In reply to #47942

I understand. I made this exact request many years ago.

However let’s try to find a solution that works with the current capabilities.

Let’s say that first, you Add all symbols from whatever canned lists you want, to the Population area.

Now, if I understand correctly, it would do the trick if you could apply a technical filter that blocks any symbols that are in some specified Zacks list. Is that correct?

I think I can create an “indicator” function that returns true false, which would have input parameter(s) which allow you to specify the ZG#(s) that you want to *block* - so any symbol from the population that is in the spec’d group would NOT end up in the FL.

If that would completely solve your problem, let me know *how many* such ZG blocking spec’s you’d want to apply together (max). Keep in mind that you can block an entire Sector with a single 2-digit code, or a full Group with a 5-digit input … rather than having to list every included SubGroup # (although you could do that if you choose, only blocking certain subgroups in a group).

And, presuming this works nicely, would it be worth a few bucks for the indicator? It would be usable anywhere OmniScript rules can be input, for OT or VT (but not in the N cloud).
^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/3/2021 5:59 AM
Post #47944 - In reply to #47928

You continue to amaze, if there is a way to get OT to do something, you can make it happen. Right now I'm just in the early stage of a "thought experiment" to see if I can come up with a viable trading strategy. At this point, I can continue to use my manually created list. If I get to the point where the strategy looks viable, then I would be interested in your indicator function as a means of automating the population list. I would probably also have a better idea of the number of Zacks groups/subgroups the function would need to be passed / support.
^ Top
Jim Dean

Sage
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/3/2021 6:26 AM
Post #47946 - In reply to #47944

Ok. I’ll keep an eye out.
^ Top
Hafnium

Regular
2525
Posts: 74

Joined: 1/1/2004
Location: Fairfax, VA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/4/2021 3:07 PM
Post #47947 - In reply to #47928

Tony / Jim

I was trying to develop a scan last year that would only allow the top 3 ranked sectors to download. I never got the scan/indicator to work right ( I am not a programmer). If anyone figures out how to do that, I would be appreciative... However I did figure out how to manipulate Zack group downloads (its not exact and seems to miss a stock or to, but it works fairly well).

To only let Energy Stocks through, use
GetClose("SECTOR") = GetClose("ZG012")

To only allow all Non Energy Stocks to pass use
GetClose("SECTOR") <> GetClose("ZG012")

Give it a try and see if it meets your needs.

^ Top
Jim Dean

Sage
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/4/2021 3:29 PM
Post #47948 - In reply to #47947

That is part of the method that I was planning to use, to identify what sector, etc a given stock was in. It should work ok for daily bars - but to avoid coincidences, I’d suggest checking the Open instead of the Close … also, check the prior bar’s Close since if the most recent download is midday, the Close might change. Checking two prices using that method should work. For intraday, you’d have to use the new timeframe-shift functions to check daily bars, since afaik, the ZG’s aren’t calc’d for intraday bars.

There’s also a way to search for the highest ranks for Zacks sectors etc and exclude symbols unless they are in that universe. Unfortunately, unless some tricksy code is used, any function that does that will likely run pretty slowly.
^ Top
Hafnium

Regular
2525
Posts: 74

Joined: 1/1/2004
Location: Fairfax, VA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/4/2021 3:53 PM
Post #47949 - In reply to #47948

Hi Jim
It would probably be better to check for say the C[1] and the Open together..... Good idea.
The new OT2021 2D prerelease added a new parameter to the MT function. Previously, MT("RSI(10)","D", X), where X was 1 (dynamic) or 2 (previous bar). Parameter 3 is added. " it can now be set to 3 in order to use the previous bar with actual data instead of building the data from the current timeframe. This parameter "may" allow you to retrieve the Zack data from the intraday timeframe - at least its worth a try....

Finally - When I attempted to download only the 3 top sectors (automated) - the scan took about 3 or 4 hours to complete. I finally figured out that my simple code was actually trying to calculate and rank every sector for every stock it checked, it was non-workable....



[Edited by Hafnium on 3/4/2021 4:01 PM]

^ Top
Jim Dean

Sage
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/4/2021 4:25 PM
Post #47950 - In reply to #47949

Yeah - like I said - the rank thing is doable but it requires some pretty careful and tricksy code design to make it reasonably efficient.

I haven’t tried using the new MT option yet. My understanding is that the Zacks data series, and certainly the ZR and ZIR ranks, are solely daily-bar based (like MG’s were/are). If that’s true, then when you are using say 10m bars, you’d need to implement MT extensively, to do whatever you need to do re Zacks info.

Part of the tricksy stuff to speed things up would involve writing csv files and then reading them back in, to avoid repetitive work for each symbol.

[Edited by Jim Dean on 3/4/2021 4:26 PM]

^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/5/2021 6:09 AM
Post #47952 - In reply to #47928

Thank you Jim and Larry.
I'll test it out this weekend.
^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/6/2021 11:54 AM
Post #47956 - In reply to #47928

I tried using GetClose("SECTOR") <> GetClose("ZG012") as a criteria rule in my OmniScan but it didn't work.
I did some more testing and it appears that GetClose("ZG012") works but GetClose("SECTOR") always returns 0.
If I use GetClose("SECTOR") = 0 as a criteria rule, all of the stocks in the population list are returned.
I use GetClose("SECTOR") <> 0, none of the stocks in the population list are returned.

Not sure if I'm doing anything wrong but that's what I'm seeing.

Thanks for all your efforts though.
^ Top
Jim Dean

Sage
20001000
Posts: 3022

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/6/2021 1:26 PM
Post #47957 - In reply to #47956

The correct syntax is Getclose(“$Sector”). This link fully explains it.

[Edited by Jim Dean on 3/6/2021 1:29 PM]

^ Top
TonyJ

Regular
2525
Posts: 59

Joined: 12/11/2003
Location: Marietta, GA

User Profile
 
Subject : RE: Omniscan to filter out sector / industry group
Posted : 3/6/2021 4:01 PM
Post #47959 - In reply to #47928

Doh! I thought I tried that.

Thanks for your patience Jim, I appreciate the help.

[Edited by TonyJ on 3/6/2021 4:03 PM]

Attached file : Doh.jpg (9KB - 474 downloads)

Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.