Ehlers Universal Oscillator - ThinkOrSwim Programming | futures io social day trading
futures io futures trading


Ehlers Universal Oscillator
Updated: Views / Replies:2,513 / 3
Created: by ebtrader1 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Ehlers Universal Oscillator

  #1 (permalink)
Trading Apprentice
east brusnwick
 
Futures Experience: Master
Platform: tradestation
Favorite Futures: ES
 
Posts: 1 since Nov 2014
Thanks: 0 given, 0 received

Ehlers Universal Oscillator

I found Ehlers has a new oscillator out in Jan 2015 issue of TASC that combines the ssf with gain control.

If anyone has some free time, it would be great if you could convert to thinkscript and post. to save you time, keep in mind the supersmootherfilter is already in the TOS library so you can reference it.

the ssf part is no problem for me to convert to ssf. however, with the gain control, i am having a tough time understanding how to convert 2 of these easylanguage lines. any suggestions?

The lines I am having trouble scripting are:
 
Code
If Currentbar = 1 then 
	Peak = .0000001 ;
If Peak <> 0 then 
	Universal = Filt / Peak ;


I guess the first line is initialization of peak. Do you know how that is done in Thinkscript. The second line has a <>. Do you know what that means and how it is done in thinkscript?

Your help is much appreciated as always. If I can figure out those 2 lines, then I am home free.



Here is the EasyLanguage:

 
Code
_Ehlers_Universal Oscillator (Indicator)

// Universal Oscillator
// (c) 2014 John F. Ehlers
// TASC January 2015
inputs:
	BandEdge( 20 ) ;
variables:
	WhiteNoise( 0 ),
	a1( 0 ),
	b1( 0 ),
	c1( 0 ),
	c2( 0 ),
	c3( 0 ),
	Filt(0),
	Peak(0),
	Universal( 0 ) ;

once
	begin
	if BandEdge <= 0 then
		RaiseRunTimeError( "BandEdge must be > zero" ) ;
	end ;

WhiteNoise = ( Close - Close[2] ) / 2 ;

// SuperSmoother Filter
a1 = ExpValue( -1.414 * 3.14159 / BandEdge ) ;
b1 = 2 * a1 * Cosine( 1.414 * 180 / BandEdge ) ;
c2 = b1 ;
c3 = -a1 * a1 ;
c1 = 1 - c2 - c3 ;
Filt = c1 * ( WhiteNoise + WhiteNoise [1] ) / 2 + 
c2 * Filt[1] + c3 * Filt[2] ;
If Currentbar = 1 then 
	Filt = 0 ;
If Currentbar = 2 then 
	Filt = c1 * 0 * ( Close + Close[1] ) / 2 + c2 * Filt[1] ;
If Currentbar = 3 then 
	Filt = c1 * 0 * ( Close + Close[1] ) / 2 + c2 * Filt[1] +
c3 * Filt[2] ;

// Automatic Gain Control (AGC)
Peak = .991 * Peak[1] ;
If Currentbar = 1 then 
	Peak = .0000001 ;
If AbsValue( Filt ) > Peak then 
	Peak = AbsValue( Filt ) ;
If Peak <> 0 then 
	Universal = Filt / Peak ;
Plot1( Universal ) ;
Plot2( 0 ) ;


if Universal crosses over 0 then
	Alert( "Osc cross over zero line" )
else if Universal crosses under 0 then	
	Alert( "Osc cross under zero line" ) ;


_Ehlers_Universal Oscillator (Strategy)

// Universal Oscillator
// (c) 2014 John F. Ehlers
// TASC January 2015
inputs:
	BandEdge( 20 ) ;
variables:
	WhiteNoise( 0 ),
	a1( 0 ),
	b1( 0 ),
	c1( 0 ),
	c2( 0 ),
	c3( 0 ),
	Filt(0),
	Peak(0),
	Universal( 0 ) ;

once
	begin
	if BandEdge <= 0 then
		RaiseRunTimeError( "BandEdge must be > zero" ) ;
	end ;

WhiteNoise = ( Close - Close[2] ) / 2 ;

// SuperSmoother Filter
a1 = ExpValue( -1.414 * 3.14159 / BandEdge ) ;
b1 = 2 * a1 * Cosine( 1.414 * 180 / BandEdge ) ;
c2 = b1 ;
c3 = -a1 * a1 ;
c1 = 1 - c2 - c3 ;
Filt = c1 * ( WhiteNoise + WhiteNoise [1] ) / 2 + 
c2 * Filt[1] + c3 * Filt[2] ;
If Currentbar = 1 then 
	Filt = 0 ;
If Currentbar = 2 then 
	Filt = c1 * 0 * ( Close + Close[1] ) / 2 + c2 * Filt[1] ;
If Currentbar = 3 then 
	Filt = c1 * 0 * ( Close + Close[1] ) / 2 + c2 * Filt[1] +
c3 * Filt[2] ;

// Automatic Gain Control (AGC)
Peak = .991 * Peak[1] ;
If Currentbar = 1 then 
	Peak = .0000001 ;
If AbsValue( Filt ) > Peak then 
	Peak = AbsValue( Filt ) ;
If Peak <> 0 then 
	Universal = Filt / Peak ;

if Universal crosses over 0 then
	Buy next bar at Market ;

if Universal crosses under 0 then
	SellShort next bar at Market ;

Reply With Quote
 
  #2 (permalink)
Elite Member
Florida
 
Futures Experience: Advanced
Platform: NinjaTrader 8
Favorite Futures: YM, ES, NQ, CL, ZB
 
trendwaves's Avatar
 
Posts: 742 since Dec 2012
Thanks: 2,822 given, 2,433 received

"<>" is a logical operator for "not equal to"

the if statement in the code is protecting the calculation from a divide by zero error.

so what it is saying is:

if the dividend Peak is not equal to zero then calculate Universal

You need to use the BarNumber() function call to replicate the Currentbar = 1 conditional

This is needed because Peak is initialized to zero, and for the first bar the Peak Calculation
will set Peak equal to zero causing the divide by zero fault in the calculation of Universal.


def Peak = 0.0 ;

Peak = .991 * Peak[1] ;

If BarNumber() == 1 then Peak = 0.0000001 ;

If Peak <> 0 then Universal = Filt / Peak ;

Be Patient and Trade Smart

Last edited by trendwaves; February 1st, 2015 at 10:55 AM.
Reply With Quote
The following user says Thank You to trendwaves for this post:
 
  #3 (permalink)
Trading Apprentice
viterbo
 
Futures Experience: None
Platform: ProRealTime
Favorite Futures: Currency Futures
 
Posts: 1 since Jan 2017
Thanks: 0 given, 0 received

incomprehensible expression.


Please, someone may explain to me this expression?

Peak = .991 * Peak[1] ;

Peak is not defined before, so how can the term Peak[1] be evaluated?

Thanks.

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
new york city
 
Futures Experience: Beginner
Platform: neuroshell
Favorite Futures: emini ES
 
Posts: 1 since Jan 2017
Thanks: 0 given, 0 received

universal

I am working through Elher's stuff right now on Think or Swim platform and I had to figure it out earlier today

Good news is that TD has already coded it for and article in traders.com and here is how they did it.



def peak = if IsNaN(filter) then peak[1] * 0.991 else Max(AbsValue(filter), peak[1] * 0.991);



here is the full code and credit to them.

#
# TD Ameritrade IP Company, Inc. (c) 2015-2016
#

declare lower;

input cutoffLength = 20;

def whiteNoise = (close - close[2]) / 2;
def filter = reference EhlersSuperSmootherFilter(price = whiteNoise, "cutoff length" = cutoffLength);
def peak = if IsNaN(filter) then peak[1] * 0.991 else Max(AbsValue(filter), peak[1] * 0.991);

plot UniversalOsc = filter / peak;
plot ZeroLine = 0;

UniversalOsc.SetDefaultColor(GetColor(1));
ZeroLine.SetDefaultColor(GetColor(7));

Reply With Quote

Reply



futures io > > > > > Ehlers Universal Oscillator

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
UniRenko, Universal Renko Bar Type monpere NinjaTrader 579 Today 05:09 PM
Universal Hot Crazy Matrix and markets drago1 Off-Topic 0 August 16th, 2014 07:54 PM
Jeffs Universal Moving Average Jeff Castille The Elite Circle 23 July 3rd, 2013 08:36 PM
John Clayburg Universal System tallblackboots Traders Hideout 2 December 8th, 2012 03:30 PM
Universal Trading System dee50 Trading Reviews and Vendors 1 January 8th, 2012 11:33 AM


All times are GMT -4. The time now is 07:15 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-11 in 0.09 seconds with 19 queries on phoenix via your IP 54.92.194.75