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 2017 Upgrade Forums
OmniScan
How can I get a ranking relative to sector
Last Activity 4/10/2018 4:36 PM
4 replies, 433 viewings

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

^ Top
kmcintyre

Veteran
100100252525
Posts: 276

Joined: 8/30/2007
Location: Valley Center, CA

User Profile
 
Subject : How can I get a ranking relative to sector
Posted : 11/20/2016 9:28 PM
Post #38442

I would like to scan for stocks that are in the top X percent of their sector AND the sector is in the top 20% of the market.

Can I get there in OmniScan?

Can I get there in OmniLanguage?

If I write a custom indicator that returns the ranking for the sector and the stock within the sector, (something like sector rank * 10 + stock rank), could I use that indicator in OmniScript?

Thanks

Keith


[Edited by kmcintyre on 11/20/2016 9:30 PM]

^ Top
Jim Dean

Idol
20005001001002525
Posts: 2761

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

User Profile
 
Subject : RE: How can I get a ranking relative to sector
Posted : 11/21/2016 4:44 AM
Post #38443 - In reply to #38442

Simple answer is "it's really a pain" to fully automate this since OLang can't manipulate arrays or have any internal sort routines - but, if you're referring to the nine MG Sectors not the 31 Groups or the 239(?) Subgroups, then it's so much of a pain it is ridiculous.

If you are familiar with oscript coding and know how to use getclose(), Sector, and iif(), here is a manual method …

If you are willing to use manual two step process involving OScan, and don't need to be able to backtest it (i.e. just for the HRE), it's do-able.
A. Find the Sectors (20% = 2 of 9 sectors)
1. Write oscript that determines how getclose(Sector) performs against market (such as $SPX). Save as technical ranking formula in Oscan.
2. In Oscan use a filter to find just the MG Sectors - ones that start with MG and have only 3 characters in their name - from the MG Symbols canned list.
3. Apply the ranked filter via Oscan to find the Sectors that pass.
B. Find the stocks
1. Write a filter that selects symbols only from the two winning Sectors, using Sector = "MGx" or Sector = "MG y" … x and y are the two winning sector numbers from part A.
2. write an oscript ranking for how that symbol performs against its sector using getclose(Sector) - need iif() to select the appropriate Sector.
3. Load in MG Industries symbol list and apply that filter and ranking to find the symbols that qualify.

I don't know why I wrote all that out. Most people would glance at it and say it's too much trouble. Actually it's more trouble to write out than to actually do.

There is a way to totally automate it for backtesting but it's a royal pain to code and goes beyond standard OLang capabilities.

[Edited by Jim Dean on 11/21/2016 4:46 AM]

^ Top
kmcintyre

Veteran
100100252525
Posts: 276

Joined: 8/30/2007
Location: Valley Center, CA

User Profile
 
Subject : RE: How can I get a ranking relative to sector
Posted : 11/21/2016 9:17 AM
Post #38450 - In reply to #38442

Wow! I guess I've been really spoiled by object oriented programming paradigms. And the ability to iterate through arrays and keep local and static variables, Ya know, typical .NET stuff.

Backtesting is required. OScan dynamic lists seemed like a good place to start. Filter blocks sound like they are hard to program. But if I ever want to add this to a GA analysis, I'd really need a custom indicator.

Jim, do you have code that could be adapted to indicators to return sector, sub group, and industry group ranking for a stock symbol? I might be interested if the price is right!

Cheers

Keith

^ Top
Jim Dean

Idol
20005001001002525
Posts: 2761

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

User Profile
 
Subject : RE: How can I get a ranking relative to sector
Posted : 11/21/2016 9:23 AM
Post #38452 - In reply to #38450

Hi, Keith

Yah I concur ... OLang's inability to process arrays creates some severe limitations for some needs.

Email me with detailed spec's if you want a quote for custom coding. It's nontrivial but can be done: JimDean@TradeTight.org
^ Top
Jim Dean

Idol
20005001001002525
Posts: 2761

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

User Profile
 
Subject : RE: How can I get a ranking relative to sector
Posted : 11/21/2016 9:30 AM
Post #38453 - In reply to #38452

I just noticed your original specific request:
"If I write a custom indicator that returns the ranking for the sector and the stock within the sector, (something like sector rank * 10 + stock rank), could I use that indicator in OmniScript?"

The key word here is RANK. That implies a sorted list. If you meant "SCORE" ... ie a value that could be manually sorted in a FL column, and the value is calc'd as the component vs its container's value ... that's easily scriptable or OLang-able. BUT ... that's not back-testable per se.

MAYBE ... can't recall for sure ... maybe DSS would help out with this ??

But if SORTING is required to determine RANK (typically binned), then that's where it gets messy. Sorting and binning both require array manipulation.

[Edited by Jim Dean on 11/21/2016 9:32 AM]

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.