Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Hilbert Sine Wave

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hilbert Sine Wave

    Hi Everyone...

    Hope you all are doing well. Need not ask if you heard about Hilbert Sine Wave. If not, just check it on the following link. Its worth spending some time on notes here.
    The Better Sine Wave Indicator is the ultimate tool for identifying price cycles and trends in trading. Works in any market and any timeframe.

    The indicator is readily available for TS and I just wondered if some Guru had a try on coding it for NT. If yes, it will be the most sought after indicator on NT, of course IMHO.

    Thanks,
    Yusuf SHAIKH

    #2
    I don't know if anyone has built this indicator into this platform sucessfully.

    I have been studying John Elhers's work and reviewing all documentation at mesa.com. I am teaching myself C# and learning to write code. John provides his indicators in easylanguage.

    Since there are so many indicators available in easylanguage, I am learning that too. What this boils down to is that I am working on it as I learn.

    I am currently trying to import his SineWave indicator to this platform.

    Its been a couple weeks. I think I am getting close. There are still things I don't fully understand about both types of code.

    If I get this indicator figured out, I'll post it.

    RJay
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    Comment


      #3
      Thanks a lot...

      Hi...
      Just read your post. I am sure this will be great for everyone on NT. Thanks for you effort and interest.
      Good Luck & God Bless.
      Yusuf SHAIKH

      Comment


        #4
        Hilbert Sinewave -- I've got it!

        Hi All,

        I've coded the Hilbert Sine Wave Indicator for NinjaTrader, as translated from a TradeStation indicator that I found online. I'm also working on translating the version of the Hilbert Sine Wave Indicator that John Ehlers proposed in his book, Rocket Science for Traders, and should have that up in a few days. So there will be at least 2 versions of it to play with, and likely a third, if I put my own version up there

        Is it OK to post my website, where I have placed the indicator? Some forums have rules about posting websites, so thought I'd ask before I proceed.


        Matt

        Comment


          #5
          We prefer you post it in our File Sharing area.
          RayNinjaTrader Customer Service

          Comment


            #6
            Matt,

            I went to your web site to have a look.

            Did you use pages 101 - 103 of Rocket Science for Traders to build this indicator?

            I see you posted Tradestation pictures too.

            Are they both developed from the same script?

            Can you post side by side pictures of both applications of the same market and time frame for comparison?

            Thanks,

            RJay
            RJay
            NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

            Comment


              #7
              Originally posted by rt6176 View Post
              Matt,

              I went to your web site to have a look.

              Did you use pages 101 - 103 of Rocket Science for Traders to build this indicator?

              I see you posted Tradestation pictures too.

              Are they both developed from the same script?

              Can you post side by side pictures of both applications of the same market and time frame for comparison?

              Thanks,

              RJay
              Hi RJay, sorry for the delayed response, I was out of town today.

              I actually have 3 Hilbert Sine Wave Indicators on my site - 1 TS and 2 NinjatTrader.... The 2 NinjaTrader Indicators were taken from 2 different sources.

              The one that is labeled Original is the original code from pages 101-103 that you reference

              The other Hilbert Sine Wave Indicator is from some unknown EasyLanguage Code that I found online.

              So which one do I like better? Well.... I think that the Original page has some images with both indicators plotted on them.... The one that is really jagged is the Original Hilbert Sine Wave Indicator.... if you look at page 104, you can see that indeed that is how John Ehlers was seeing it.

              So personally, I like the unknown source because of its smoothness and less whipsaw behaviours, but they both tell a story, so I think that it would just be a matter of personal preference.

              I'm glad you all liked it, I had some excellent feedback about this indicator, so let me know what else interests you, and I'll see about getting more online.

              Cheers,

              Comment


                #8
                Matt,

                As I posted below, I have also been working on this indicator.

                Since you have Tradestation, maybe you can answer a question for me.

                When the loops for RealPart and ImagPart are completed in Tradestation.

                Are their final values in degrees or radians?

                Thanks,

                RJay
                RJay
                NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                Comment


                  #9
                  Radians vs Degrees

                  Originally posted by rt6176 View Post
                  Matt,

                  When the loops for RealPart and ImagPart are completed in Tradestation.

                  Are their final values in degrees or radians?

                  Thanks,

                  RJay
                  RJay,

                  I provide full source on my site, so you can see how I handled the sin/cos/atan diffs, but in short, TS is in degrees, and NinjaTrader is in radians.... I got hung up on it as well, esp. the atan, since you aren't handing in a value in degrees or radians, but the return value is returned in degrees/rads and needs to be converted *After* the call to the inverse function....

                  Here's an example, taken directly from the sources I'm using for TS and NinjaTrader:

                  TS:
                  ArcTangent(AbsValue((Quadrature+Quadrature[1]) / (InPhase+InPhase[1])));

                  NinjaTrader:
                  180/Math.PI * Math.Atan( Math.Abs((Quadrature[0]+Quadrature[1]) / (InPhase[0]+InPhase[1])));



                  And Here's how I handled Sin:

                  TS:
                  RealPart = RealPart + Sine(360 * count / Period) * (Price[count]);
                  ImagPart = ImagPart + Cosine(360 * count / Period) * (Price[count]);


                  NinjaTrader:

                  RealPart = RealPart + Math.Sin( Math.PI/180 * 360 * count / Period) * (Price[count]);
                  ImagPart = ImagPart + Math.Cos( Math.PI/180 * 360 * count / Period) * (Price[count]);


                  I hope that helps!!

                  Comment


                    #10
                    Matt,

                    I like the second one on your site better. It looks more like the TradeStation display.

                    Your indicator and mine have outputs that are similar.

                    Mine looked a little different. No suprise there. I used a different script.

                    Mine is a lot smoother. Not as many signals.

                    I was also using a version that didn't include the section...

                    // resolve phase wraparound, and limit delta phase errors

                    This allowed glitches to show up in the wave form.

                    --------------------------------------------------------------

                    I also opted to convert all degrees to radians for the program computations.

                    I was under the impression from microsoft's website that Sin,Cos, and Atan could only process radians And conversion was needed.

                    As I understand from your previous post, I may have gotten confused by the info at the following locations:

                    -----------------------------------------------------------------------



                    "
                    The angle, a, must be in radians. Multiply by pi/180 to convert degrees to radians.
                    "
                    "
                    double angle = Math.PI * degrees / 180.0;

                    double sinAngle = Math.Sin(angle);
                    double cosAngle = Math.Cos(angle);
                    "
                    --------------------------------------------------------------------



                    Calculate the tangent of x degrees.
                    angle = x;
                    radians = angle * (Math.PI/180);
                    result = Math.Tan(radians);

                    Calculate the arctangent of the previous tangent
                    radians = Math.Atan(result);

                    -------------------------------------------------------------------
                    I ran my conversions before the initial math functions until all variables were in radians. The later math functions did not need any conversions.

                    You ran conversions before the sin and cos math functions.

                    Both of the atan's had the conversions after the math function.

                    Your indicator display agrees with these decisions. I'm still a little confused.

                    Anyway, I'm moving on to my next learning project.

                    Keep up the good work,

                    RJay
                    Last edited by RJay; 07-19-2008, 06:11 PM.
                    RJay
                    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                    Comment


                      #11
                      Matt,

                      You were right !!!!!!!

                      I have confirmed that your calculations are correct and I was distracted by a bunch of numbers on Microsoft's web site. I'm glad your on top of this math stuff.

                      I ran sample calculations on these web sites to confirm your script is right and my assumptions were wrong.





                      The up side is I'm learning alot about this stuff.

                      Thanks for setting me straight,

                      RJay
                      Last edited by RJay; 07-23-2008, 06:53 AM.
                      RJay
                      NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                      Comment


                        #12
                        rt,

                        has this been coded into an indicator, or were you guys using the output window to view calculations / trig functionality?

                        Thanks,
                        Anthony
                        mrlogik
                        NinjaTrader Ecosystem Vendor - Purelogik Trading

                        Comment


                          #13
                          Originally posted by mrlogik View Post
                          rt,

                          has this been coded into an indicator, or were you guys using the output window to view calculations / trig functionality?

                          Thanks,
                          Anthony
                          Hi Anthony,

                          There are several indicators on this website currently using Trig functions.

                          I actually built a specific test script to confirm the trig calculations.

                          I always use the output window to verify anything I'm working on. I have to see and confirm the outcome of what I'm doing.

                          It just makes sense,

                          RJay
                          RJay
                          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                          Comment


                            #14
                            Originally posted by mrlogik View Post
                            rt,

                            has this been coded into an indicator, or were you guys using the output window to view calculations / trig functionality?

                            Thanks,
                            Anthony
                            Anthony,

                            The Hilbert Sine Wave has been coded into an indicator.

                            RJay had coded one before, but there are trig diffs between TradeStation and NinjaTrader, so he was just testing the differences to make sure that I had properly coded it in NinjaTrader.


                            RJay,
                            I minored in math, so I may have a few extra tricks up my sleeve



                            TazaTek

                            Comment


                              #15
                              TazaTek,

                              Thanks for the reply. I downloaded the indicator from your site and am playing around with it now.

                              Thanks for you hard work.

                              Anthony
                              mrlogik
                              NinjaTrader Ecosystem Vendor - Purelogik Trading

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by TraderBCL, Today, 04:38 AM
                              2 responses
                              17 views
                              0 likes
                              Last Post TraderBCL  
                              Started by martin70, 03-24-2023, 04:58 AM
                              14 responses
                              106 views
                              0 likes
                              Last Post martin70  
                              Started by Radano, 06-10-2021, 01:40 AM
                              19 responses
                              609 views
                              0 likes
                              Last Post Radano
                              by Radano
                               
                              Started by thanajo, 05-04-2021, 02:11 AM
                              4 responses
                              471 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Working...
                              X