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.


[Random Quote] -

  Current location        Thread information  
OmniTrader Pro Resource Forum
OmniLanguage Frequently Asked Questions
How do I create an indicator of an indicator?
Last Activity 12/2/2008 10:19 AM
0 replies, 4884 viewings

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

^ Top
Matthew Greenslet

Idol
2000252525
Posts: 2077

Joined: 2/27/2006

User Profile
 
Subject : How do I create an indicator of an indicator?
Posted : 6/2/2008 2:53 PM
Post #9027

Q: How do I create an indicator of an indicator?
A:


All of the indicators have a default data set (I.E the o,h,l,c of a each bar or data point in the set). For example: SMA(14) will always be calculated using the close prices from each bar.

You can override this "default data set" with any OL function you like. The programming term for this is an 'overload'. The available overloads for an OmniLanguage function are shown from the 'tool tip'. The tool tip is usually shown as you type, however in you inserted the function from the right menu you can display to tool tip by removing and adding back the opening parentheses in the function.

Trye it with the SMA. Start typing SMA(. Right after you open the parenthesis you will see a pop up that says '1 of 2' SMA(Periods).This tells you that you only need to pass in one variable which would be the periodicity you want to use to calculate the SMA. As in the example above you would just call SMA(14) passing in 14 as the number of periods to use in the calculation.

With the tool tip up if you hit the down arrow you will see the second method which is SMA(Data, Periods). This shows you that you can change the data set that the indicator will look at. You know that H function will reference the high price, L for Low, C for close, O for open and V for volume. You can place any function into the data parameter to change this. So if you wanted a SMA of the volume you would use SMA(V, 14). This would give you a 14 period SMA of calculated on each bar using the volume price for that bar.

You can also use other indicators. For example if you wanted a 20 period EMA of 14 period EMA (For more details see the Smoothed EMA example from Chapter 4 of the Pro user guide under Writing an Indicator, Page 41) you would use EMA(EMA(14), 20). You will notice that I had to pass in the number of parameters (14) for my base EMA. This tells the EMA(20) function to calculate the 20 period EMA on each bar using the value of the 14 period EMA.

[Edited by Matthew Greenslet on 6/2/2008 2:55 PM]

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.