Announcement

Collapse
No announcement yet.

MA Extension Rays

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

  • MA Extension Rays

    Has anyone written an EFS that will take a Moving Average and project an extension line or ray further out to the right on the chart ?

    I've been looking through the forum listings but haven't seen this, perhaps it is too simple. But for the 5 minute chart, a 3 period MA on the Russel 2000 futures, an extension is very useful at times. I've been drawing them by hand for awhile ; ) .

    Best Regards,

    Glenn
    San Mateo, CA

  • #2
    Hi fastflyer,

    It seems simple and if everyone expected the solutions' behavior to be similar, it would be. What I have seen is that different people want different behavior.

    Having said that, I'll get off my soapbox.

    As for this particular solution, I have seen several posts recently that discussed extending lines, but they are typically horizontal.

    I would assume that you would want it to work this way... Perform a regression fit of the MA values and use the slope of the regression to extend the last point. I would recommend it be updated only at the end of each bar to minimize cpu resources.

    Is that what you are after? How many bars do you want the extension?

    Comment


    • #3
      Hi Steve,

      Thanks for such a quick reply ! Your clarification would be fine, especially if you already have a regression routine. If not, just use the last two values of the MA.

      For the length, if a Ray was used I'm guessing I could control the length by how much blank space there is to the right of the last bar.

      If I'm guessing wrong, how about a 15 bar extension.

      If it makes any difference, I prefer the ( H L C ) / 3 SMA.

      Best Regards and Thanks So Much,

      Glenn

      Comment


      • #4
        Hi fastflyer,

        You are welcome, here is a screenshot...



        You will see that I created two extensions, just to show that a second one can be readily added. Just comment out the second one in the code to remove it.

        I put the efs in my fileshare here. I will also attach to this post.

        There is another example here which uses the last two values to draw a ray extension. This is quite a handy thread as it shows how to draw a ray extension which can be used in many different situations.
        Attached Files

        Comment


        • #5
          customma_with_extension_line

          Thanks Steve !

          Tried it out today with the 5 minute chart and the 3 period SMA. Looked pretty good.

          You are an ace of a programmer, that was real fast.

          Best Regards,

          Glenn

          Comment


          • #6
            Hi Glenn,

            You are welcome. Good to hear it worked out, and thanks so much for the compliment.

            Comment


            • #7
              MA extension

              Hi Steve,

              Would it be too much trouble to see about how the MA extension would look without the regression ? Say, only using the real time value of the MA as it updates and the value just before that.

              You mentioned before about being CPU intensive, but for me I just work the Russell 2000 future with a Dell precision 470. She isn't new, but it's a Xeon at 2.8 ghz and 1.5 gig of ram.

              And if I might be a real favor mongor - I find myself drawing the same extensions with Bollinger Bands.

              Today was a good example, the Russell reversed - often times she does, sometimes she doesn't - at the bottom of the 5 day Bollinger Band on the 30 minute chart.

              When she started making that move down from the 5 day MA, the bottom of the 5 day Band was angling up nicely to meet her. It was a relatively steady move and sometimes she got above that 3 period MA (15 min) on the 5 min chart, but always held
              below the 30 min MA.

              I watched E-signal's Java tutorial over the weekend thinking maybe I'd give a try to code the MA extension. After seeing your code, I think that would have been a rather interesting endeavor, ha.

              It would be very useful for me. I would be able to just monitor the move rather than draw the extensions manually and update them along the way.

              Do you get paid for this ? Does E-signal send anything your way. My credit card company sends them something every month !

              Very Best Regards, and Thank You So Much

              Glenn

              Comment


              • #8
                Re: MA extension

                Glen,

                Originally posted by stevehare2003
                Hi fastflyer,

                It seems simple and if everyone expected the solutions' behavior to be similar, it would be. What I have seen is that different people want different behavior.

                Having said that, I'll get off my soapbox...
                hmm... I believe that I saw this coming...

                Excuse the glib reply, but you walked right into this...

                I looked at what you requested. I believe it is fairly simple to accomplish with the code I added to the previous efs (in all instances). I'll post a followup tomorrow.

                btw, the code is extremely efficient and has no impact on your resources. You took what I said previously out of context. I coded it to draw a line just once at the beginning of a new bar.

                Originally posted by fastflyer
                Hi Steve,

                Would it be too much trouble to see about how the MA extension would look without the regression ? Say, only using the real time value of the MA as it updates and the value just before that.

                You mentioned before about being CPU intensive, but for me I just work the Russell 2000 future with a Dell precision 470. She isn't new, but it's a Xeon at 2.8 ghz and 1.5 gig of ram.

                And if I might be a real favor mongor - I find myself drawing the same extensions with Bollinger Bands.

                Today was a good example, the Russell reversed - often times she does, sometimes she doesn't - at the bottom of the 5 day Bollinger Band on the 30 minute chart.

                When she started making that move down from the 5 day MA, the bottom of the 5 day Band was angling up nicely to meet her. It was a relatively steady move and sometimes she got above that 3 period MA (15 min) on the 5 min chart, but always held
                below the 30 min MA.

                I watched E-signal's Java tutorial over the weekend thinking maybe I'd give a try to code the MA extension. After seeing your code, I think that would have been a rather interesting endeavor, ha.

                It would be very useful for me. I would be able to just monitor the move rather than draw the extensions manually and update them along the way.

                Do you get paid for this ? Does E-signal send anything your way. My credit card company sends them something every month !

                Very Best Regards, and Thank You So Much

                Glenn

                Comment


                • #9
                  Been There Done That ?

                  That's one of my favorite sayings. In case it isn't obvious, this is the first time I've posted to an EFS Forum. Glib is just fine, really. I'm very impressed with you taking the time to reply, not to mention coding so quickly. Besides being very good at it, Me thinks you've been doing this for more than just a little while !

                  Best Regards,

                  Glenn

                  Comment


                  • #10
                    Hi Glen,

                    As promised...
                    [list=1][*]Would it be too much trouble to see about how the MA extension would look without the regression ? Say, only using the real time value of the MA as it updates and the value just before that.

                    I provided a link to an example of how to do this in my previous post (just using last two points). A simpler alternative in my opinion would be to set the period of the regression to 2. This is equivalent to what you requested btw. I modified the previous efs and added to my File Share. You can get this by following the link in my previous post.

                    [*]And if I might be a real favor mongor - I find myself drawing the same extensions with Bollinger Bands.

                    The additions I made to the other efs were intended to be sufficiently compact and self contained that it can be used with any study, take for example the custom bollinger band efs. I have already modified the existing Advanced BB efs similar to the first efs I posted. I'll post this later.

                    [*]I watched E-signal's Java tutorial over the weekend thinking maybe I'd give a try to code the MA extension. After seeing your code, I think that would have been a rather interesting endeavor, ha.

                    I have been working with this since I started using eSignal and joined the forum. I can assure you that I did not know then what I know now. If you follow the Tutorials and start modifying and coding simple studies, you will come up to speed quickly. FWIW, I started learning by taking efs's that have already been written and modifying them a bit.

                    [*]Do you get paid for this ? Does E-signal send anything your way. My credit card company sends them something every month ![/list=1]

                    No, to my knowledge there is only one person on the Forum that is paid for this, and he works for eSignal. I am not this person.


                    There are a large number of studies that have already been written. My recommendation is that you become familiar with the search tool(s) that are available, this will will allow you to find much of what you want. This requires some of your time to learn and become profficient, but in my opinion, it is time well spent and a good investment.

                    If you need to have some custom coding done and you do not feel you can accomplish this, there is a list of consultants that you can hire for this. I recommend you try your hand at revising some studies before you get to this point.

                    Here is a screenshot of the the revised efs with a lookback of only two points. More in a bit...


                    Comment


                    • #11
                      Glen,

                      Below is a screenprint of the extensions applied to the Advanced Bollinger Band efs from the EFS 2 Custom folder. The modified efs is in this folder

                      In this case, the extension lines were based on a regression of the last 13 values and extended 50 bars. I am not sure I like the way I attached the extension line from the previous bar. I was thinking that it may work out better if I plotted it from the origination point. If you want, I could do that. Let me know, it is a rather straightforward modification.

                      Again, thanks for the compliments.

                      Comment


                      • #12
                        Wow !

                        Hi Steve,

                        Just now saw your reply with the Bollinger Bands. Let me take a look at it and try it out, before I reply again. I'll be more impressed then ! First Impression, Very nice indeed. So, just set the regression to 2. Gotta give that a try, as soon I can see where to make the entry !

                        Warmest Regards,

                        Glenn

                        Comment


                        • #13
                          Can't find new file ?

                          Hey Steve,

                          I clicked on your link to this " folder ". It went to your regressions area and I saw the efs files that were there before. I downloaded them anyway just to make sure they were the ones I had already, they were.

                          I went to the " Recent Additions ( Files) " at http://share.esignal.com/index.jsp

                          There were a lot of .png and .txt files, none by you in the 20 listed.

                          I'm intrigued and will be trying as you suggested to work a little with the files I already have for now to see about following along with the programming.

                          Please let me know if I can get you recent modifications. Does it take awhile before they show up on the site ?

                          Best Regards,

                          Glenn

                          Comment


                          • #14
                            Got The File Now

                            Hi Steve,

                            I took a look a little later and the custom bb is there.

                            Will take a look at it tommorrow. 10:15 on the west coast now.

                            Best Regards,

                            Glenn

                            Comment


                            • #15
                              Very Very Close

                              Greetings Steve,

                              Wow, this is so close to what I've been drawing by hand. I've been digging around and changing things here and there in the code and in the Edit Studies, Study Properties, Formula Parameter window, but can't get the very last thing that would " make it so " for me.

                              Did you ever hear the story of the " Cargo Cult " ? They were in Papau New Guinea,



                              if you're interested.

                              Anyway, I think I know a little of how they felt.

                              When I match up your " Length " parameter with the 20 day Bollinger Band in my 30 minute chart, length = 65 and 2 std dev and my preference of hlc/3, your extension line's first definition points anchor perfectly on the value of the period to the left of the current period.

                              And the Bands and MA match perfectly too - they're industinguishable to the Bollinger Band from the E-signal Basic Study - Fits Perfect !

                              I also did the same check on the 5 minute chart, length = 12 period to get the 1 hour Band. The first point anchors perfectly there too ! And the Bands and MA as well !

                              The thing that reminds me of the cargo cult is I can't seem to figure out what to do to follow your suggestion to set the " Regression to 2 ".

                              I've tried a couple of things that didn't work, the only one worth mentioning, I think, is I altered the Interval Value in the Study Properties window.

                              What I noticed is , when I use the interval of 5 in the 5 minute chart, everythng stays the same. Similarly in the 30 minute chart with an interval of 30.

                              Even I can tell that's fairly robust coding there, Steve.

                              When I change the interval to any other number I see the difference in the Bollinger bands as well as their extension lines and anchor points.

                              Concluding : Steve, how do I set the regression to 2 ?

                              I promise I won't start a cult, but I will be very, very grateful !
                              ( I trust that should boost your ego just a little : ) )

                              Glenn

                              Comment

                              Working...
                              X