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
Awesome Oscillator
Last Activity 7/6/2025 3:47 AM
14 replies, 8724 viewings

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

^ Top
JSmish

Member

Posts: 8

Joined: 11/13/2012
Location: Castle Rock, CO

User Profile
 
Subject : Awesome Oscillator
Posted : 11/13/2012 1:47 PM
Post #21404

Looking for coding assistance for the Awesome Oscillator which is not part of OmniTrader yet. The definition is:

"The Awesome Oscillator shows the difference between a 5-period Moving Average and a 34-period Moving Average, both calculated for the midpoints of the candles, (High+Low)/2."

It is a unique indicator which reflects the tendencies in the market. I hope to paste it into OmniTrader and have it become an indicator.

Thanks,
JSmish

^ Top
JSmish

Member

Posts: 8

Joined: 11/13/2012
Location: Castle Rock, CO

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/13/2012 3:12 PM
Post #21405 - In reply to #21404

I should add that the resulting indicator consists of red or green bars moving above and below a mid line. I've watched the chart pattern trader use this for the past few weeks and it has been spot on!
^ Top
JSmish

Member

Posts: 8

Joined: 11/13/2012
Location: Castle Rock, CO

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/13/2012 3:17 PM
Post #21406 - In reply to #21404

Here's the link for a full description.

http://www.actfx.com/Download50013.aspx
^ Top
jawjahtek

Member
25
Posts: 37

Joined: 5/30/2006
Location: Georgia, USA

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/13/2012 7:38 PM
Post #21407 - In reply to #21404

Actually, this is just a version of MACD using SMAs and the Median Price.
Here is Nirvana's code for MACD, modified as needed.
Good luck to you; I would not consider this indicator "awesome" or "spot on", and I would not expect N to include it in OT.

#Indicator
#PARAM "ShortPeriods", 5
#PARAM "LongPeriods", 34

Dim fMACDao as Single

fMACDao = SMA((H+L)/2, ShortPeriods) - SMA(H+L)/2, LongPeriods)
Plot("MACDao", fMACDao)
Return 0
^ Top
JSmish

Member

Posts: 8

Joined: 11/13/2012
Location: Castle Rock, CO

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/14/2012 10:56 AM
Post #21409 - In reply to #21404

Thank you. I created the omni language indicator using the code provided but only the name AwesomeOscillator appears on the chart template.
JSmish
^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/14/2012 11:00 AM
Post #21410 - In reply to #21409

Try this - adds if/then for warmup delay, necessary when a complex argument is used with a called function like SMA:

#Indicator
#PARAM "ShortPeriods", 5
#PARAM "LongPeriods", 34

Dim fMACDao as Single

if bar > LongPeriods then

fMACDao = SMA((H+L)/2, ShortPeriods) - SMA(H+L)/2, LongPeriods)
Plot("MACDao", fMACDao)

end if

Return fMACDao

[Edited by Jim Dean on 11/14/2012 11:01 AM]

^ Top
JSmish

Member

Posts: 8

Joined: 11/13/2012
Location: Castle Rock, CO

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/14/2012 11:36 AM
Post #21411 - In reply to #21404

Same thing.
Compilation pointed out line 9 has too many closing parenthesis.
When editing the indicator in chart options, there is only one line not two.
^ Top
SteveL

Veteran
10025
Posts: 133

Joined: 2/15/2007
Location: Boulder, CO

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/14/2012 11:50 AM
Post #21412 - In reply to #21411

A left paren is missing in the "fMACDao =" statement. Here is the corrected statement with balanced parenthesis:

fMACDao = SMA((H+L)/2, ShortPeriods) - SMA((H+L)/2, LongPeriods)


^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/14/2012 11:54 AM
Post #21413 - In reply to #21412

Thx Steve ... since no error was mentioned initially I did not look at it closely enuf. Your fix should do it.
^ Top
JSmish

Member

Posts: 8

Joined: 11/13/2012
Location: Castle Rock, CO

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/14/2012 12:05 PM
Post #21414 - In reply to #21404

TaDah! Thanks again. Anyway to have it look like a macd hist with bars above and below 0?
^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/14/2012 12:27 PM
Post #21415 - In reply to #21414

Use
Plothist("MACDao", fMACDao, 0)
^ Top
JSmish

Member

Posts: 8

Joined: 11/13/2012
Location: Castle Rock, CO

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 11/14/2012 12:36 PM
Post #21416 - In reply to #21404

Great, thanks again!
^ Top
Jim

New User

Posts: 2

Joined: 10/27/2014
Location: Saint Louis, MO

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 10/27/2014 5:44 PM
Post #23124 - In reply to #21404

Hi,
Does anyone have a reference for how to plot a color change code for this histogram?

If the current bar is greater than the previous bar, then plot green

If the current bar is less than the previous bar, then plot red.
Thanks, Jim

#Indicator
#PARAM "ShortPeriods", 5
#PARAM "LongPeriods", 34

Dim fMACDao as Single

if bar > LongPeriods then

fMACDao = SMA((H+L)/2, ShortPeriods) - SMA((H+L)/2, LongPeriods)
Plothist("MACDao", fMACDao, 0)

end if

Return fMACDao


^ Top
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 10/28/2014 3:56 AM
Post #23125 - In reply to #23124

#Indicator
#PARAM "ShortPeriods", 5
#PARAM "LongPeriods", 34

Dim fMACDao as Single

if bar > LongPeriods then

fMACDao = SMA((H+L)/2, ShortPeriods) - SMA((H+L)/2, LongPeriods)

If fmacdao > fmacdao[1] then
Plothist("MACDao", fMACDao, 0, green)
Else
Plothist("MACDao", fMACDao, 0, red)
End if

end if

Return fMACDao
^ Top
Jim

New User

Posts: 2

Joined: 10/27/2014
Location: Saint Louis, MO

User Profile
 
Subject : RE: Awesome Oscillator
Posted : 10/28/2014 6:56 AM
Post #23126 - In reply to #21404

Thanks, it works perfect
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.