Announcement

Collapse
No announcement yet.

Need help with a formula

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

  • Need help with a formula

    Hi, I have been using esignal for awhile now, but this is my first time in the chat. I have a question and am not sure where to post it, so I'll post it here and see if anyone responds.

    Would someone kindly help me with this formula:

    TSI formula is:

    TSI(Close,r,s) = 100 * EMA(EMA(MTM,r),s)/EMA(EMA(|MTM|,r),s)

    Where MTM = Momentum = Close [today] - close[yesterday]
    computed for r =32, s = 5 days...

    I typed it in a notepad file and saved it in the downloads folder as a .txt file, but this file is not in the folder. Obviously, the formula is wrong or something else is wrong.

    Help, please.
    Lark Trader

  • #2
    Re: Reply to post 'Need help with a formula'

    ; charset=us-ascii

    JayF - thank you for your response. Unfortunately, I didn't see where
    the formula was attached, and I didn't understand your instructions.
    Technical support said I had to type in the Javascript code and place it
    in the download folder. I don't think TSI is in esignal where I can
    just tweak it through edit studies. Any further explanation of your
    response would be appreciated.

    [email protected] wrote:

    Hello lark,

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Lark Trader

    Comment


    • #3
      Re: Reply to post 'Need help with a formula'

      ; charset=us-ascii

      Would you please send me the formula again. It was not attached to your
      original reply. Thanks.

      [email protected] wrote:

      Hello lark,

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Lark Trader

      Comment


      • #4
        lark,

        My first attempt at the TSI was incorrect, so I will attempt a new one soon. Please ignore my original response, and I'll work on a new version as soon as I can scrape up some time.
        Regards,
        Jay F.
        Product Manager
        _____________________________________
        Have a suggestion to improve our products?
        Click Support --> Request a Feature in eSignal 11

        Comment


        • #5
          Re: Reply to post 'Need help with a formula'

          ; charset=us-ascii

          Thank you. Under File Sharing I found someone by the name of Matt who
          posted a TSI.efs, but my download was unsuccessful. And, NOW it is not
          listed. I don't understand what happened to it and why it isn't in the
          list any longer. I thought I had found it under specialty scripts. If
          I ever find it again, I'll let you know.

          [email protected] wrote:

          Hello lark,

          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          Lark Trader

          Comment


          • #6
            Try this URL to download a TSI formula. Please let me know if this formula works for you, or if the numbers are different then what is expected.

            Ergotic_TSIMAG.efs
            Regards,
            Jay F.
            Product Manager
            _____________________________________
            Have a suggestion to improve our products?
            Click Support --> Request a Feature in eSignal 11

            Comment


            • #7
              I see that you are receiving posts by email, and the first URL might have been bad. Please try this...

              http://share.esignal.com/download.jsp?groupid=1&folder=EFS Tweaks&file=Ergotic_TSIMAG.efs
              Regards,
              Jay F.
              Product Manager
              _____________________________________
              Have a suggestion to improve our products?
              Click Support --> Request a Feature in eSignal 11

              Comment


              • #8
                Re: Reply to post 'Need help with a formula'

                ; charset=us-ascii

                I just found it again. I am copying the code Matt posted, but there is
                a syntax error somewhere. I placed it in my downloads folder and tried
                it. Any help you can provide to get this working and to tweak it so it
                matches the parameters in my original email would be so greatly
                appreciated. I know people using this with tradestation, but I believe
                their scripting is different than esignal.

                /************************************************** *****************
                Description : This Indicator plots Ergotic_TSI indicator
                Provided By : Developed by TS Support, LLC for eSignal. (c) Copyright
                2002
                ************************************************** ******************/
                function preMain()
                {
                setStudyTitle("Ergotic_TSI");
                setCursorLabelName("ErgTSI", 0);
                setCursorLabelName("SigLin", 1);
                setCursorLabelName("ZeroLine", 2);
                setDefaultBarFgColor(Color.fushcia, 0);
                setDefaultBarFgColor(Color.grey, 1);
                setDefaultBarFgColor(Color.cyan, 2);
                }
                var XA1_1 = 0.0;
                var XA2_1 = 0.0;
                var XA3_1 = 0.0;
                var aXA1_1 = 0.0;
                var aXA2_1 = 0.0;
                var aXA3_1 = 0.0;
                var XA_1 = 0.0;

                var XA1 = 0;
                var XA2 = 0;
                var XA3 = 0;
                var aXA1 = 0;
                var aXA2 = 0;
                var aXA3 = 0;
                var XA = 0;

                function main(sPrice, r, s, u, ZeroLine, SmthLen)
                {
                if (sPrice == null) sPrice = "Close";
                if (r == null) r = 4;
                if (s == null) s = 8;
                if (u == null) u = 6;
                if (ZeroLine == null) ZeroLine = 0;
                if (SmthLen == null) SmthLen = 3;
                // makes sense
                var Price = getValue(sPrice, 0, -2);
                // MAG
                if(Price == null) {
                return;
                }
                var vPrice = Price[0] - Price[1];
                // MAG (moved from bottom of formula)
                if (getBarState() == BARSTATE_NEWBAR)
                {
                XA1_1 = XA1;
                XA2_1 = XA2;
                XA3_1 = XA3;
                aXA1_1 = aXA1;
                aXA2_1 = aXA2;
                aXA3_1 = aXA3;
                XA_1 = XA;
                }
                /**
                XA1 = XA1_1;
                XA2 = XA2_1;
                XA3 = XA3_1;
                aXA1 = aXA1_1;
                aXA2 = aXA2_1;
                aXA3 = aXA3_1;
                XA = XA_1;
                **/


                // constants
                var FactorR = 2 / (r + 1);
                var FactorS = 2 / (s + 1);
                var FactorU = 2 / (u + 1);

                // MAG removed 'var'
                XA1 = FactorR * vPrice + (1 - FactorR) * XA1_1;
                XA2 = FactorS * XA1 + (1 - FactorS) * XA2_1;
                XA3 = FactorU * XA2 + (1 - FactorU) * XA3_1;
                vPrice = Math.abs(Price[0] - Price[1]);
                // MAG removed 'var'
                aXA1 = FactorR * vPrice + (1 - FactorR) * aXA1_1;
                aXA2 = FactorS * aXA1 + (1 - FactorS) * aXA2_1;
                aXA3 = FactorU * aXA2 + (1 - FactorU) * aXA3_1;
                var Val1 = 100 * XA3;
                var Val2 = aXA3;
                var TSI = 0.0;
                if (Val2 != 0) TSI = Val1 / Val2;
                else TSI = 0.0;
                var Factor = 2 / (SmthLen + 1);

                // MAG removed 'var'
                XA = Factor * TSI + (1 - Factor) * XA_1;
                return new Array(TSI, XA, ZeroLine);

                [email protected] wrote:

                Hello lark,

                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Lark Trader

                Comment


                • #9
                  lark,

                  With the link provided in my last email, that version should work fine. I believe there was a non-functional version posted on the File Sharing site, and then Matt came back at some later point with a corrected version.
                  Regards,
                  Jay F.
                  Product Manager
                  _____________________________________
                  Have a suggestion to improve our products?
                  Click Support --> Request a Feature in eSignal 11

                  Comment


                  • #10
                    Re: Reply to post 'Need help with a formula'

                    ; charset=us-ascii

                    JayF - thanks for your help. But, I still don't have the code your
                    messages refer to. When I click on the link in your previous email, it
                    doesn't result in a message with the code in it. I'm sure it's probably
                    something I'm not doing. So, if it wouldn't be too much to ask, could
                    you cut & paste the code into an email message and send it to me via my
                    regular email address which is [email protected]
                    <mailto:[email protected]> . Sorry for being such a newbie. Thanks.

                    [email protected] wrote:

                    Hello lark,

                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    Lark Trader

                    Comment


                    • #11
                      lark
                      If you actually looked at the messages/thread while online in the Bulletin Board (ie where you posted your original request) you would have the correct links.
                      To get to this thread just click on the "This thread is located.." link that is provided at the bottom of the email message sent to you by eSignal Forums.
                      Alex

                      Comment


                      • #12
                        Re: Reply to post 'Need help with a formula'

                        ; charset=us-ascii

                        Thanks, Alex. I was able to get to the right forum this time and see
                        JayF's
                        messages to me.

                        JayF - I saved your
                        <http://share.esignal.com/download.js...d=1&folder=EFS
                        Tweaks&file=Ergotic_TSIMAG.efs> Ergotic_TSIMAG.efs file as is (in it's
                        entirety) to the esignal, Formulas, downloads folder. But, when I go to
                        my charts and try to add this indicator, I still get a pop-up box that
                        says there's a syntax error.







                        [email protected] wrote:

                        Hello lark,

                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        Lark Trader

                        Comment


                        • #13
                          Here are some questions on the subject...

                          - What version of eSignal are you running?
                          - Are you adding the updated version of the EFS to your chart or the old one?
                          - What is the text of the Syntax Error?
                          - What symbol and interval are you using when getting the error?

                          On a ES U3, 5-minute chart, the attached EFS is working for me. FYI, I renamed it so it wouldn't get confused with another version.
                          Attached Files
                          Regards,
                          Jay F.
                          Product Manager
                          _____________________________________
                          Have a suggestion to improve our products?
                          Click Support --> Request a Feature in eSignal 11

                          Comment


                          • #14
                            Re: Reply to post 'Need help with a formula'

                            ; charset=us-ascii

                            JayF - I received an .efs file from another user - and this one works
                            okay. Thank you for trying to help me.

                            Best Regards, Deena

                            [email protected] wrote:

                            Hello lark,

                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            Lark Trader

                            Comment

                            Working...
                            X