Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adaptive SuperTrend

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

    Adaptive SuperTrend

    Hello,
    I saw a long discussion about SuperTrend. I thought the indicator was good, but still had a few whipsaw trades. So, I think this should clean it up a little. The concept of SuperTrend is based on checking how volatile the price is at some point. What I did was to check how large the period of the trend is and get a nice indicator with less whipsaw trades. In the shot you can see ES, 15-minute, with SuperTrend in its default settings and the adaptive version. The regular supertrend signals 7 different trades, while the adaptive version only one trade.
    Hope that improves it a little.
    Have fun!
    Attached Files

    #2
    Thanks, looks interesting.
    Last edited by Elliott Wave; 04-14-2009, 03:10 PM.

    Comment


      #3
      By the way, you can change the period's setting and get it to be more volatile if you want to take advantage of the changes in price...

      Comment


        #4
        Its not plotting for me, anyone else getting it to work?

        Comment


          #5
          Originally posted by Elliott Wave View Post
          Its not plotting for me, anyone else getting it to work?
          I just read this and imported it. I get a plot but it is so high it was almost off the chart. Ten points above current price on 1 min ES chart.
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #6
            eDanny, you need to set it between 0 and 1, I think the default is 0.5. That is actually a percentage of the cycle period (0.5 is 50%, 0.2 is 20% and so on). I think for one minute bars you need to set it at .1 or so.
            Elliot, I will check to see if there is something in the code.

            Comment


              #7
              Originally posted by lgarcia3 View Post
              eDanny, you need to set it between 0 and 1, I think the default is 0.5. That is actually a percentage of the cycle period (0.5 is 50%, 0.2 is 20% and so on). I think for one minute bars you need to set it at .1 or so.
              Elliot, I will check to see if there is something in the code.
              It turns out I was having a similar issue as eDanny, the plot was completely off the chart! When I changed the value to 0.1 it displays.

              I might suggest changing the default value to something low that should display on all instruments and then the user can adjust from there.

              Interesting code, I'd never heard of the Homodyne Discriminator before (insert dumb joke here), I'll have to look more into it.

              Predict the future more accurately in today's difficult trading times The Holy Grail of trading is knowing what the markets will do next. Technical analysis is the art of predicting the market based on tested systems. Some systems work well when markets are "trending," and some work well when they are "cycling," going neither up nor down, but sideways. In Trading with Signal Analysis, noted technical analyst John Ehlers applies his engineering expertise to develop techniques that predict the future more accurately in these times that are otherwise so difficult to trade. Since cycles and trends exist in every time horizon, these methods are useful even in the strongest bull--or bear--market. John F. Ehlers (Goleta, CA) speaks internationally on the subject of cycles in the market and has expanded the scope of his contributions to technical analysis through the application of scientific digital signal processing techniques.


              Once any kinks are worked out, I might suggest trying to fit this code into the frame-work of the existing SuperTrend as it has a bunch of other bells and whistles like alerts and bar coloring...

              Thanks again for sharing.

              Comment


                #8
                Hi Elliot,
                I use 15-minute bar most of the time, and yes, 0.5 was convenient for me
                As far as homodyne, it has been very useful for me. The result is actually the period of the cycle. Homodyne discriminator is just the mathematical process. I actually have improved several indicators with that same technique. I have also implemented most of the work he has done and it is very useful. I will share those later.
                By the way, if someone creates a strategy and want to share it here, it would be greatly appreciated.

                Comment


                  #9
                  Originally posted by lgarcia3 View Post
                  Hi Elliot,
                  I use 15-minute bar most of the time, and yes, 0.5 was convenient for me
                  As far as homodyne, it has been very useful for me. The result is actually the period of the cycle. Homodyne discriminator is just the mathematical process. I actually have improved several indicators with that same technique. I have also implemented most of the work he has done and it is very useful. I will share those later.
                  By the way, if someone creates a strategy and want to share it here, it would be greatly appreciated.
                  How do you pick the "reference frequency" ?. Trial and error, or directly from the price data oscillations?. You replaced one old parameter with a new one between 0 and 1. Why do you say the result is the period of the cycle?. The period of the cycle isn't set from the new 0-1 parameter?.

                  Thanks for your code and your responses. Looks very interesting.
                  Last edited by jcook; 04-15-2009, 04:26 PM.

                  Comment


                    #10
                    Hi Jcook, basically it is a percentage of the period at x moment in time. In other words, say that at 8:30 the calculation of the period is 8 and your setting is 0.5, then your multiplier becomes half the period or 4.
                    Now, the period per se comes from the cycle theory developed by John Ehlers. He bases his research on phasors and waves theory (you can read more about it here: http://en.wikipedia.org/wiki/Phasor_(electronics)). A cycle is something that has a definite start and end. According to him, a cycle of market data may be a full trend from 800 to 850 of S&P for instance. The period is actually how fast it takes that cycle to complete. If it is 4, like the example I mentioned before, that is 4 bars of price data, 8 would be 8 bars of data. In essence, the period is a spam of time. When you have a very low period, say 3, that means it is taking no time for the price to move or that the market is trending really fast, if your period is 20 bars, that means the price is moving very slowly up and down, or it's just trading (which we normally don't care about). If you know that, then you can have the indicator adjust itself, and there is no need to change your position because all it is doing is stopping for a little bit before moving upwards (or downwards) again. That is why I use the period. How much of it you want to use, it depends on how much you want to trade. I would suggest you optimize it and change it to your needs. Yesterday, playing with it, I noticed that for smaller time frames (like minute bars) it works better with about 0.08, 0.1, 0.15 or so. For larger time frames like 15-minute bars, 0.5 was better. And yes, I did trial and error; but, again, you can always optimize it with NT.
                    Hope that explains it a little.
                    Last edited by lgarcia3; 04-15-2009, 09:16 PM.

                    Comment


                      #11
                      Great!. Thanks.

                      Comment


                        #12
                        anyone else having issues getting this to run in a strategy?

                        Comment


                          #13
                          Originally posted by BigDog008 View Post
                          anyone else having issues getting this to run in a strategy?
                          I haven't tried it in a strategy but I seem to be having intermittent plotting issues still. Sometimes, for no apparent reason it will plot extremely high or low and cause the chart scale to get messed up.

                          I'll post again if I figure out whats causing the issue.

                          Comment


                            #14
                            Hi lgarcia.

                            I've been playing a little with your code. Say I want to set a fixed period for the next 3 hours of 1 minute bars (Say I think the dominant half-cycle (peak to through) is about 60 minutes. How can I calculate the exact input parameter to use?. Thanks.




                            Originally posted by lgarcia3 View Post
                            Hi Jcook, basically it is a percentage of the period at x moment in time. In other words, say that at 8:30 the calculation of the period is 8 and your setting is 0.5, then your multiplier becomes half the period or 4.
                            Now, the period per se comes from the cycle theory developed by John Ehlers. He bases his research on phasors and waves theory (you can read more about it here: http://en.wikipedia.org/wiki/Phasor_(electronics)). A cycle is something that has a definite start and end. According to him, a cycle of market data may be a full trend from 800 to 850 of S&P for instance. The period is actually how fast it takes that cycle to complete. If it is 4, like the example I mentioned before, that is 4 bars of price data, 8 would be 8 bars of data. In essence, the period is a spam of time. When you have a very low period, say 3, that means it is taking no time for the price to move or that the market is trending really fast, if your period is 20 bars, that means the price is moving very slowly up and down, or it's just trading (which we normally don't care about). If you know that, then you can have the indicator adjust itself, and there is no need to change your position because all it is doing is stopping for a little bit before moving upwards (or downwards) again. That is why I use the period. How much of it you want to use, it depends on how much you want to trade. I would suggest you optimize it and change it to your needs. Yesterday, playing with it, I noticed that for smaller time frames (like minute bars) it works better with about 0.08, 0.1, 0.15 or so. For larger time frames like 15-minute bars, 0.5 was better. And yes, I did trial and error; but, again, you can always optimize it with NT.
                            Hope that explains it a little.

                            Comment


                              #15
                              this is a great indicator ! im using settings 0.0006 on 2 minute bars, could someone build a paint bar option into it ....please

                              thank you lgarcia3 !

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by TraderBCL, Today, 04:38 AM
                              2 responses
                              16 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 KenneGaray, Today, 03:48 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post KenneGaray  
                              Started by thanajo, 05-04-2021, 02:11 AM
                              4 responses
                              471 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Working...
                              X