• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.

              http://books.google.ca/books?id=_KjO...esult&resnum=4

              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 Debayan Sen, Today, 01:50 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Debayan Sen  
                              Started by eleven, Yesterday, 10:03 PM
                              1 response
                              9 views
                              0 likes
                              Last Post eleven
                              by eleven
                               
                              Started by tvbecv, Yesterday, 09:23 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post tvbecv
                              by tvbecv
                               
                              Started by reedstickets, Yesterday, 08:07 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post reedstickets  
                              Started by timko, Yesterday, 07:39 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post timko
                              by timko
                               
                              Working...
                              X