Hilbert sine wave indicator - NinjaTrader | futures io social day trading
futures io futures trading


Hilbert sine wave indicator
Updated: Views / Replies:48,239 / 77
Created: by ntsst3 Attachments:27

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
 27  
 
Thread Tools Search this Thread
 

Hilbert sine wave indicator

  #71 (permalink)
Elite Member @ Ibiza
Ibiza. Spain
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG
Favorite Futures: CL
 
noyss's Avatar
 
Posts: 72 since Jul 2012
Thanks: 121 given, 29 received


Zondor View Post
They SHOULD, work exactly the same, unless the second one has coding errors.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
[/URL]


Did you refer to the __Oscillator_HilbertSinewave?

As you can see, __Oscillator_HilbertSinewave doesn´t plot support and ressistance as good as your first one


Last edited by noyss; April 28th, 2014 at 10:44 AM.
Reply With Quote
 
  #72 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,327 since Jul 2009
Thanks: 1,246 given, 2,635 received

Bumps in the road to a correct and workable Sine Wave for NT

Note that the version Cory posted and I updated seems to be based on the code in John Ehlers' book, Cybernetic Analysis for Stocks and Futures. There is what appears to be a different version in one of his other books, Rocket Science for Traders. That one had some very minor differences in the input smoothing but the only significant difference is that the Rocket Science version had some typos that were not corrected in the Sine Wave that was on the Ninjatrader forum.

The corrections to the Rocket Science version are here (the real and imaginary parts got interchanged): http://www.mesasoftware.com/bookcompanions.htm
 
Code
pages 98 and 102 and 116 and 120 & 121: the code should be corrected to be: 
....... RealPart = RealPart + Sine(360*count/DCPeriod)*(SmoothPrice[count]); 
....... ImagPart = ImagPart + Cosine(360*count/DCPeriod)*(SmoothPrice[count]); 
....... If AbsValue(ImagPart) > 0 then DCPhase = Arctangent(RealPart/ImagPart); 
....... If AbsValue(ImagPart) <= .001 then DCPhase = DCPhase + 90*Sign(RealPart):
So there really should be only one version of this indicator, as the Cybernetics Analysis and Rocket Science versions are the same animal, both based on the Hilbert Transform.

For test purposes I am adding code to various indicators to measure the actual backfill time to the millisecond. It appeared that drawing support and resistance lines (using DrawText method) on the price panel caused unacceptable performance issues, increasing the backfill time from a few milliseconds to ten or more seconds. The solution would be to use one indicator to plot the sine wave in an indicator panel, and another indicator to PLOT, not DRAW, the support and resistance lines in the price panel. In this case at least, the DrawText method seems to be a voracious resource hog. Harry @Fat Tails had already mentioned this, but the resource hit is not minor... it is a disaster.

To further confuse the issue, there is the new Even Better Sine Wave in the latest Ehlers book, Cycle Analytics for Traders.

@noyss, could you share the code for the TOS version, preferably as a text file?

"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.”
Prof. Albert Bartlett

Last edited by Zondor; May 26th, 2014 at 01:11 PM.
Reply With Quote
The following user says Thank You to Zondor for this post:
 
  #73 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,327 since Jul 2009
Thanks: 1,246 given, 2,635 received

Rocket Science version now plots correctly.


I fixed the version of the Sine Wave that was posted on the Ninjatrader forums.

The program logic flow was wrong. Now, for the first time, the Rocket Science version plots correctly. Now it is actually usable.

It really is essentially the same as the Cybernetics Analysis version except for additional input smoothing options which may not improve the usefulness of the results anyway.

The Cybernetics version is three years newer than the Rocket version.

I did NOT fix the ridiculously inefficient code that was MINDLESSLY copied from the books. After fixing that, another possibility is an MTF version that will work on a time frame other than that of the chart master instrument.

The time needed for the indicator to backfill the historical bars prints to the output window.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.”
Prof. Albert Bartlett
Attached Files
Register to download File Type: cs _____NTForumSineWave.cs (27.6 KB, 408 views)

Last edited by Zondor; May 26th, 2014 at 02:38 PM.
Reply With Quote
The following 17 users say Thank You to Zondor for this post:
 
  #74 (permalink)
Elite Member
Boston, MA
 
Futures Experience: Intermediate
Platform: MultiCharts, TradeStation, NinjaTrader, ThinkorSwim
Favorite Futures: ES
 
Posts: 22 since Jul 2011
Thanks: 15 given, 12 received

I tried the EasyLanguage version of Ehler's "Even Better Sine Wave" indicator and I get a "floating point invalid operation" error message. I believe I have been faithful to the original. Any thoughts as to what I'm doing wrong here?



var:
alpha1(0), HP(0), a1(0),b1(0),c2(0),c3(0), Filt(0), c1(0), count(0), wave(0), pwr(0);


alpha1 = (1 - sine(360/40))/ cosine(360/40);
a1 = expvalue(-1.414*3.14159/10);
b1 = 2*a1*cosine(1.414*180/10);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;


//High pass filter cyclic components whose periods are shorter than duration input
HP = 0.5*(1 + alpha1)*(CLOSE - CLOSE[1]) + alpha1*HP[1];
//Smooth with a Super Smoother Filter
Filt = c1*(HP + HP[1])/2 + c2*Filt[1] + c3*Filt[2];
//3 Bar average of Wave amplitude and power
Wave = (Filt + Filt[1] + Filt[2])/3;
Pwr = (Filt*Filt + Filt[1]*Filt[1] + Filt[2]*Filt[1])/3;

//Normalize the Average Wave to Square Root of the Average Power
IF PWR <> 0 THEN
Wave = Wave/SquareRoot(Pwr);

PLOT1(WAVE);

Reply With Quote
 
  #75 (permalink)
Elite Member
Boston, MA
 
Futures Experience: Intermediate
Platform: MultiCharts, TradeStation, NinjaTrader, ThinkorSwim
Favorite Futures: ES
 
Posts: 22 since Jul 2011
Thanks: 15 given, 12 received


tortoise View Post
I tried the EasyLanguage version of Ehler's "Even Better Sine Wave" indicator and I get a "floating point invalid operation" error message. I believe I have been faithful to the original. Any thoughts as to what I'm doing wrong here?



var:
alpha1(0), HP(0), a1(0),b1(0),c2(0),c3(0), Filt(0), c1(0), count(0), wave(0), pwr(0);


alpha1 = (1 - sine(360/40))/ cosine(360/40);
a1 = expvalue(-1.414*3.14159/10);
b1 = 2*a1*cosine(1.414*180/10);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;


//High pass filter cyclic components whose periods are shorter than duration input
HP = 0.5*(1 + alpha1)*(CLOSE - CLOSE[1]) + alpha1*HP[1];
//Smooth with a Super Smoother Filter
Filt = c1*(HP + HP[1])/2 + c2*Filt[1] + c3*Filt[2];
//3 Bar average of Wave amplitude and power
Wave = (Filt + Filt[1] + Filt[2])/3;
Pwr = (Filt*Filt + Filt[1]*Filt[1] + Filt[2]*Filt[1])/3;

//Normalize the Average Wave to Square Root of the Average Power
IF PWR <> 0 THEN
Wave = Wave/SquareRoot(Pwr);

PLOT1(WAVE);

Never mind. Fixed it.

Yikes, this is indicator really blows. Lol.

Reply With Quote
 
  #76 (permalink)
Trading Apprentice
SINGAPORE
 
Futures Experience: Intermediate
Platform: Multichart
Favorite Futures: oil
 
Posts: 1 since Sep 2015
Thanks: 0 given, 0 received

Hi Tortoise,

I am running into the same problem and been scratching my head off, how do you fixed the floating point issues?
Many thanks,

Reply With Quote
 
  #77 (permalink)
Trading Apprentice
Frankfurt Germany
 
Futures Experience: Intermediate
Platform: MT 5
Favorite Futures: EUR
 
Posts: 5 since Apr 2014
Thanks: 0 given, 3 received

Hi,

I am quite new to this forum and have stumbled upon this topic by pure accident, but maybe it would be useful for you to share my experiences.

I have only limited experiences in trading, but was fascinated by Ehlers approaches some years ago. About two years ago, I started working on the different versions of Ehlers Sinewave indicators, first using Excel, later up to now MT5. Beginning with the Homodyne from Rocket Science, the Deltaphase from one of his later books (can't remember the title right now) and the Better Sine Wave from one of his last books. Since I have been professionally involved in Fourier Analysis long years ago, I have even been able to develop my own sinewave indicators, using the same maximum entropy algorithm Ehlers is claiming to use in his Mesa indicators. My indicators include variable lookback periods and nice spectrum displays. (Unfortunately I can't post a screenshot due to the resitrictions of this forum for newbies...)

To my experience, all indicators of this type are working great in a stable cycle mode.... but only there. One of the reasons is, that they are lagging due to a lot of necessary smoothing and detrending. If I remember correctly, the Homodyne lags about 20 bars. The complex calculations all try to extract the period of the so called "Dominant Cycle" from the price data, which takes about 20 bars or more. So the output is an average DC valid during the past 20 bars. The assumption for trading (and plotting the support and resistance lines) is, that this DC will continue in the future.

Unfortunately, to my limited experience, in a lot of cases this assumption will fail.

So I would recommend the homodyne based sine wave indicator as a useful confirming signal, excellent during cycle modes, but be very careful during trend modes, esp. during downtrends. My attempt was to use it in an automated trading system, but I have not been able to be profitable so far. I have only very limited experience in trading, maybe I simply have not been able to find a currency pair with useful cycle modes or a successful combination with other indicators.

Reply With Quote
The following 2 users say Thank You to blackfriday for this post:
 
  #78 (permalink)
Trading Apprentice
Frankfurt Germany
 
Futures Experience: Intermediate
Platform: MT 5
Favorite Futures: EUR
 
Posts: 5 since Apr 2014
Thanks: 0 given, 3 received


tortoise View Post
I tried the EasyLanguage version of Ehler's "Even Better Sine Wave" indicator and I get a "floating point invalid operation" error message. I believe I have been faithful to the original. Any thoughts as to what I'm doing wrong here?



var:
alpha1(0), HP(0), a1(0),b1(0),c2(0),c3(0), Filt(0), c1(0), count(0), wave(0), pwr(0);


alpha1 = (1 - sine(360/40))/ cosine(360/40);
a1 = expvalue(-1.414*3.14159/10);
b1 = 2*a1*cosine(1.414*180/10);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;


//High pass filter cyclic components whose periods are shorter than duration input
HP = 0.5*(1 + alpha1)*(CLOSE - CLOSE[1]) + alpha1*HP[1];
//Smooth with a Super Smoother Filter
Filt = c1*(HP + HP[1])/2 + c2*Filt[1] + c3*Filt[2];
//3 Bar average of Wave amplitude and power
Wave = (Filt + Filt[1] + Filt[2])/3;
Pwr = (Filt*Filt + Filt[1]*Filt[1] + Filt[2]*Filt[1])/3;

//Normalize the Average Wave to Square Root of the Average Power
IF PWR <> 0 THEN
Wave = Wave/SquareRoot(Pwr);

PLOT1(WAVE);


Try

HP = (1 - alpha1 / 2)*(CLOSE - CLOSE[1]) + alpha1*HP[1];

Reply With Quote
The following user says Thank You to blackfriday for this post:

Reply



futures io > > > > Hilbert sine wave indicator

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
Blue Wave Trading BigDog Trading Reviews and Vendors 17 January 9th, 2014 06:49 AM
latest in 'wave' indicator with special affect. cory Off-Topic 0 May 3rd, 2011 01:35 PM
Sine Weighted MA (SWMA) Sam7768 NinjaTrader 16 November 28th, 2010 12:55 PM
Wave indicator Big Mike The Elite Circle 27 January 7th, 2010 12:01 PM
Next Wave down will be bigger ! ?? max-td Traders Hideout 11 August 17th, 2009 01:17 PM


All times are GMT -4. The time now is 12:22 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-12 in 0.16 seconds with 36 queries on phoenix via your IP 54.145.16.43