OmniTrader Professional Forum OmniTrader Professional 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 Professional Forum
OmniLanguage Discussion
Calculating indicator values for a specific symbol
Last Activity 9/9/2010 6:14 PM
7 replies, 210 viewings

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

^ Top
BDJ

Member
25
Posts: 35

Joined: 5/15/2008

User Profile
 
Subject : Calculating indicator values for a specific symbol
Posted : 7/26/2010 8:58 AM
Post #16614

Hello all,

Is it possible to calculate the ATR on a specific symbol (not the symbol being analyzed) in Omni Language (OL) indicator or stop code?

For example, if one were running an analysis on QQQQ, is it possible to use the calculation of the average true range (ATR) of SPY (or some other specific symbol) in OL stop or indicator code run on QQQQ - the current symbol being analyzed or charted?

If so, could someone please provide a few lines of sample code to demonstrate this procedure?

Thanks in advance,

Brian Johnson

^ Top
Jim Dean

Icon
100050010025
Posts: 1645

Joined: 3/13/2006
Location: Lawrenceville, GA

User Profile
 
Subject : RE: Calculating indicator values for a specific sy
Posted : 7/26/2010 9:26 AM
Post #16615 - In reply to #16614

Hi, Brian:

Here ya have it. Fill in whatever symbol you want ... this shows how it can be set up to choose between several. OLang does not permit input of strings, though.

To prove it out, plot MSFT on the chart, and select option two ... the two ATR lines overlap perfectly.



[Edited by Jim Dean on 7/26/2010 9:28 AM]

Attached file : DemoGetSymATR.png (11KB - 101 downloads)
Attached file : aJDndGetSymATR.rtf (1KB - 16 downloads)

^ Top
BDJ

Member
25
Posts: 35

Joined: 5/15/2008

User Profile
 
Subject : RE: Calculating indicator values for a specific sy
Posted : 7/26/2010 9:41 AM
Post #16617 - In reply to #16614

Jim,

As always, I appreciate your prompt and thorough response.

I am experimenting with a volatility based system that is tuned to SPY, but I needed a way to standardize the system across other symbols and I thought of using the ratio of the ATRs.

To test my hypothesis, I need to calculate the ATR of the SPY, while analyzing other symbols. It looks like your sample code will solve my problem. Thanks again.

Brian


^ Top
jb

Veteran
10025
Posts: 127

Joined: 6/6/2006

User Profile
 
Subject : RE: Calculating indicator values for a specific sy
Posted : 7/31/2010 5:36 AM
Post #16660 - In reply to #16614

Hi all I have just fired up the site the first time for a while to see if I could see how to use a specific symbol in an indicator and before I could do a search I found the answer here. What a good resource this is. Many thanks to you all especially Jim ....JB
^ Top
Donald Cole

Legend
100100100
Posts: 305

Joined: 3/8/2006
Location: Perris,Ca

User Profile
 
Subject : RE: Calculating indicator values for a specific sy
Posted : 7/31/2010 10:59 AM
Post #16663 - In reply to #16660

JB,

Good to see your back Hope all is Good.
^ Top
jb

Veteran
10025
Posts: 127

Joined: 6/6/2006

User Profile
 
Subject : RE: Calculating indicator values for a specific sy
Posted : 8/1/2010 7:27 PM
Post #16668 - In reply to #16614

Donald thanks very much for the welcome more than kind. I have been having a quick try with Jims code with a variation or two of the symbols it does not seem to like YM.

I am not quite sure whaty to make of the line (30) that defines the ATR source info

xATR = ATR(xH,xL,xC,ATRpds)by having high low and close listed.

The standard ATR only accepts one data set this seems to be some sort of catch whichever data is set approach. I would be grateful for an explanation.
Thanks all...JB
^ Top
Jim Dean

Icon
100050010025
Posts: 1645

Joined: 3/13/2006
Location: Lawrenceville, GA

User Profile
 
Subject : RE: Calculating indicator values for a specific sy
Posted : 8/1/2010 7:31 PM
Post #16669 - In reply to #16668

ATR is an overloaded function, like most all OL indicators. You can see the options in the editor by typing ATR( … a helper popup will appear to show you the options. I believe this is documented in Help. I know I've written about this before. Try searching for "overloaded".
^ Top
jb

Veteran
10025
Posts: 127

Joined: 6/6/2006

User Profile
 
Subject : RE: Calculating indicator values for a specific sy
Posted : 8/1/2010 7:39 PM
Post #16670 - In reply to #16614

Thanks Jim I ll take a look

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.