Announcement

Collapse
No announcement yet.

Help!...modification of MAofTrix

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

  • Help!...modification of MAofTrix

    Hi Alexis,

    I don't know if PM is working so I'll post here...

    If you have a spare moment, I was wondering if you might modify your maoftrix.efs file to output the following:

    Trix[Current Period] - Trix[n Periods Ago]

    Basically a momentum of Trix. If possible (or easily done) please have the Moving Average track the above formula.

    I've tried myself, but I'll need more instruction for working with this language than I currently have.

    Any help at all would be appreciated.

    Best,
    James

    PS: Happy Holidays, and may the new year bring health and wealth to you and your family!

  • #2
    James
    Happy Holidays to you too and thank you for the wishes.
    I think the attached efs does what you asked.
    It computes the Momentum of TRIX (default lookback is 1) and the MA of Momentum of TRIX (default length is 5).
    The efs may need some cleaning up also because I am having an odd issue when running it side by side to MAofTRIX.efs. Will look into this further and post updates later. Never the less for the time being it should provide you with the correct plots.
    Alex
    Attached Files

    Comment


    • #3
      Thanks Alexis,

      That is exactly what I was looking for!

      There is an odd issue that occurs when the price updates...the indicator does an odd little move...I suppose that it what you mean about it and the maoftrix calc running together.

      I've looked into your code and I doub't I'll be much help.

      None-the-less, thank you for your time.

      Best,
      James

      Comment


      • #4
        James
        Actually that is another issue, but so far as I have seen it happens only when you load (or Reload) the efs. Once it is running it does not seem to exhibit that behavior any more. Never the less I am looking into that as well.
        The issue I was referring to happens if you are running MAofTRIX and MAofMOMofTRIX and in Edit Studies you change the Lookback on the latter. At that point MAofTRIX gives me an error.
        Again am looking into this issue and will post an update once I find what the problem is.
        Alex

        Comment


        • #5
          Thank you Alexis.

          Didn't run the two of them side-by-side so I didn't notice that. My indicator seems to only do that false little move after it has been running.

          I'll try exiting out of eSignal and reloading...maybe that will clear it up a bit.

          -james

          Follow up:

          Alexis, I've noticed an interesting issue...that strange little movement with the indicator when price updates occurs on weekly and daily charts, but not on the intra-day charts...maybe a vector issue concerning the amount of data?
          Last edited by arvane; 12-15-2003, 07:40 AM.

          Comment


          • #6
            Hello Alex and James,

            I took at look at your code and noticed a common problem with the routine for updating the global arrays with the pop/unshift methods. Basically, the updates to the arrays should be done at the top of main. The first time through the formula, the variable being stored in the array will be null. So check for null and do nothing on the first execution. Then later in main when the variables are recalculated, immediate update the [0] element of the global arrays. I cleaned up the formula for you, so it should fix the problems you were having. Please try the formula below and let me know.

            (arvane)MAofMOMofTRIX2.efs

            Alex, post a copy of that MAofTRIX.efs and I take a look at that as well.
            Jason K.
            Project Manager
            eSignal - an Interactive Data company

            EFS KnowledgeBase
            JavaScript for EFS Video Series
            EFS Beginner Tutorial Series
            EFS Glossary
            Custom EFS Development Policy

            New User Orientation

            Comment


            • #7
              Jason
              Thanks for the fix, the explanation and the cleanup. The script was indeed beginning to look a bit messy.
              Attached is the other efs that appears to interfere.
              Alex
              Attached Files

              Comment


              • #8
                Step out for a second and miss all the fun

                Thanks Jason and Alexis (again),

                james

                Comment


                • #9
                  Hello Alex,

                  I was able to see the problem where changing the Lookback period in the arvane formula caused the MAofTrix to get out of wack. I'm not sure what the specific problem here is. I think it may be an advanced issue related to the ref() function. However, I was able to solve the problem by adding some simple error checking to the return value of ref(). See line 62. I recommend to everyone to make it a habit of adding some type of error checking routine anytime you make an EFS call that is expected to return some valid data, especially with the ref() function. In this formula there are some instances where ref() is returning null or is only able to return a valid number (or array) for the first element. Since we're asking for a return array that should have a length of 2 (i.e ref(-1,-2)), the error check here could be to simply look for a length of 2 for vRef (line 62). As long as the prior bars that ref(-1,-2) is referencing had valid data returned to the chart for those bars, we'll get a return array with a length of 2.

                  I also made the same "order of process" changes to this formula to prevent any real time issues similar to the arvane formula. Test this one next to the original. The new formula below should resolve any problems we were having with the change of the Lookback period from the new arvane formula as well.

                  MAofTRIX2.efs
                  Jason K.
                  Project Manager
                  eSignal - an Interactive Data company

                  EFS KnowledgeBase
                  JavaScript for EFS Video Series
                  EFS Beginner Tutorial Series
                  EFS Glossary
                  Custom EFS Development Policy

                  New User Orientation

                  Comment


                  • #10
                    jason,

                    the Alert.playsound("blip.wav") doesn't seem to be activating in your revised MAofTRIX2.efs. I added back the original drawShapeRelative from maoftrix(2).efs, and that doesn't activate, either.

                    Suggestions?
                    Michael

                    Comment


                    • #11
                      Dear Alex & Jason,

                      While we're at it, although I had posted in thread #26229 that the maoftrix(2).efs script that Alex kindly tweaked for me had been working perfectly in my trials, I find in extended realtime tests that there are still frequent delays between when the crossover occurs and when the yellow arrows appear.

                      Specifically, the lines will crossover and the arrow will eventually appear at the crossover bar, which means its position is correct. But it won't appear until the next bar (or two) forms, which means it is delayed.

                      Is it possible to enable the arrows to appear in realtime simultaneously with the actual crossover, just as they do flawlessly in the macdx-over2.efs script, referenced in thread #5171?

                      Thank you both for your help.

                      jrbarr

                      Comment


                      • #12
                        Hello Michael,

                        I found the problem with this formula and fixed it in the new version below. Basically, nLength needed to be replaced with len in the if() statement around line 61 so that the second part of it now reads BarCntr > len. The alert should work now. Let me know if you see any other problems.

                        MAofTRIX2.efs
                        Jason K.
                        Project Manager
                        eSignal - an Interactive Data company

                        EFS KnowledgeBase
                        JavaScript for EFS Video Series
                        EFS Beginner Tutorial Series
                        EFS Glossary
                        Custom EFS Development Policy

                        New User Orientation

                        Comment


                        • #13
                          Thanks, Jason.

                          I cut and pasted Arrow alerts and looks fine. will monitor tomorrow.
                          Michael

                          Comment

                          Working...
                          X