Announcement

Collapse
No announcement yet.

Percent Spreads For Stock Pairs?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Percent Spreads For Stock Pairs?

    I am trying to compare the intraday percentage change between pairs of stocks. As far as I can tell this is not possible using the advanced charting functions but is possible with the .efs file "DailyPercentComp".

    For some reason however, the % change readouts I am getting from the DailyPercentCompdo not seem to be accurate....the figures are completely different that the percentage change for any particular day and if they are based on the first bar in the series of days shown in the selected time period, then this figure isnt correct either!? I have also tried using "SymOverlay2" and that doesn't seem to be accurate as well...

    What am I missing with these efs files? are there others that do a better job of showing % change spreads between pairs? Is there a way to show on the upper chart level the % change spread at all? As far as I can tell this isnt possible at all in esignal and I am very surprised this is the case in addition to being disappointed since this is the only reason I purchased the software int he first place.

  • #2
    Re: Percent Spreads For Stock Pairs?

    tsferro
    From what I am seeing the DailyPercentComp script appears to be returning the correct values [at least on the spreads I tried].
    Enclosed below are some screenshots showing the percent change values of some spreads as returned by the script and for comparison as calculated in Excel [using DDE]
    You may want to provide an example of a spread that is returning incorrect values at your end so that someone at eSignal can try to replicate the issue you are seeing
    Alex








    Originally posted by tsferro
    I am trying to compare the intraday percentage change between pairs of stocks. As far as I can tell this is not possible using the advanced charting functions but is possible with the .efs file "DailyPercentComp".

    For some reason however, the % change readouts I am getting from the DailyPercentCompdo not seem to be accurate....the figures are completely different that the percentage change for any particular day and if they are based on the first bar in the series of days shown in the selected time period, then this figure isnt correct either!? I have also tried using "SymOverlay2" and that doesn't seem to be accurate as well...

    What am I missing with these efs files? are there others that do a better job of showing % change spreads between pairs? Is there a way to show on the upper chart level the % change spread at all? As far as I can tell this isnt possible at all in esignal and I am very surprised this is the case in addition to being disappointed since this is the only reason I purchased the software int he first place.

    Comment


    • #3
      perhaps i am misinterpreting the data?

      Alexis~ thanks for your response. Perhaps I am misinterpreting the data. In the screenshot I am attaching, you can see that I am trying to compare the % changes between GS and IYF. In the bottom left of the screenshot you can see that IYF % change on the day is +0.79%, but in the PDC window it reads "+2.92". GS % on the day is -1.04% yet in the PDC window it reads "+1.47".

      Forgive my ignorance but I believe I am missing something here. Any thoughts?
      Attached Files

      Comment


      • #4
        Re: perhaps i am misinterpreting the data?

        tsferro
        The discrepancy you are seeing is very likely due to the fact that in the Quote Window the Percent Change is based on the previous Close. Right click on the Pct header and select Compute Change-> From Open [as shown in the enclosed screenshot] and you should see the values match
        Alex




        Originally posted by tsferro
        Alexis~ thanks for your response. Perhaps I am misinterpreting the data. In the screenshot I am attaching, you can see that I am trying to compare the % changes between GS and IYF. In the bottom left of the screenshot you can see that IYF % change on the day is +0.79%, but in the PDC window it reads "+2.92". GS % on the day is -1.04% yet in the PDC window it reads "+1.47".

        Forgive my ignorance but I believe I am missing something here. Any thoughts?

        Comment


        • #5
          that did it!

          thanks Alexis. do you know if it is possible to calculate the % change within the PDC function as from the previous day's close as opposed to from the open?

          Comment


          • #6
            Re: that did it!

            tsferro
            You would need to modify the script to do that. Replace line 151 ie
            [i]aOpen[i] = open(0, sym(aSymbols+",D"));
            with the following
            [i]aOpen[i] = close(-1, sym(aSymbols+",D"));
            then save the script with a new name
            Once you make this change the script should calculate the percentage change from the prior daily Close
            Alex




            Originally posted by tsferro
            thanks Alexis. do you know if it is possible to calculate the % change within the PDC function as from the previous day's close as opposed to from the open?

            Comment


            • #7
              one more thing

              that did the trick Alexis, thanks again. since i am a brand new user and you have been so helpful, i was wondering if i could tap your knowledge for one more question in relation to what i am trying to do, namely:

              what/how do i change the code in order to invert the value of "Symbol 2" in the formula parameters? simply put, i would like to examine the absolute spread of inversely correlated pairs. i would like to be able to put an inversely correlated stock in "Symbol 2" and have that value inverted (i.e. % change of "-5.25%" would be charted as "+5.25%" for Symbol 2 in the DPC window, and conversely a change of "+1.33%" would be charted in the DPC window as "-1.33%".

              thanks again for your patience and assistance, it is much appreciated!

              -t

              Comment


              • #8
                Re: one more thing

                tsferro
                To do that you would need to edit the formula and change line 158 from
                [i]else aReturnDPC[i] = Ret_Calc(close(0, sym(aSymbols[i])), aOpen);
                to
                [i]else aReturnDPC[i] = Ret_Calc(close(0, sym(aSymbols[i])), aOpen)*(-1);
                Once you make this change the symbols 2, 3 and 4 will display inverted values
                Alex


                Originally posted by tsferro
                that did the trick Alexis, thanks again. since i am a brand new user and you have been so helpful, i was wondering if i could tap your knowledge for one more question in relation to what i am trying to do, namely:

                what/how do i change the code in order to invert the value of "Symbol 2" in the formula parameters? simply put, i would like to examine the absolute spread of inversely correlated pairs. i would like to be able to put an inversely correlated stock in "Symbol 2" and have that value inverted (i.e. % change of "-5.25%" would be charted as "+5.25%" for Symbol 2 in the DPC window, and conversely a change of "+1.33%" would be charted in the DPC window as "-1.33%".

                thanks again for your patience and assistance, it is much appreciated!

                -t

                Comment


                • #9
                  pushing my luck now!

                  incredible! i was poking around with the code last night with no luck myself!

                  now the LAST thing i am looking to do is plot the difference between Symbol1 and Symbol2. i am only interested in the difference in percentage change between two stocks, so what should i change in the code so that (Symbol1) - (Symbol2) is plotted? is it possible to do this so that once Symbol2 is entered via the "Edit Studies" function, only the difference between Symbol1 & Symbol2 is plotted in the DPC window?

                  as always, thanks Alexis.

                  Comment


                  • #10
                    Hi tsferro

                    I am Vijay kapoor my email address is [email protected]
                    I see that you and I are trying get the same thing
                    Interested in the difference in percentage change between two
                    Futures.

                    all the best let me know if you get it

                    I will if I get some thing.

                    have fun

                    VK

                    Comment


                    • #11
                      will do Vijay...

                      i am trying to mess around with the code to get the % change spread between 2 stocks, but i just keep messing it up!

                      will let you know if i figure it out one of these days....

                      Comment


                      • #12
                        Re: pushing my luck now!

                        tsferro
                        From the context of your posts it is not clear to me what you are trying to do ie whether you want to calculate the daily percentage change of the spread of two stocks or the difference between the individual daily percentage changes of two stocks.
                        In the first case all you need to do is enter the spread as the chart symbol. The plot returned by the original script will be the daily percentage change of that spread. For information on how to create spreads in eSignal see this article in the eSignal KnowledgeBase
                        In the second case you will need to replace the return statement in line 162 with the following

                        return aReturnDPC[0]-aReturnDPC[1];

                        Keep in mind that once you make this change the script will only plot the difference between the individual daily percent changes of the charted symbol [ie Symbol1] and of Symbol2 (so you may want to save it with a different name)
                        In the following screenshot you can see the result of this modification in the bottom pane while the top pane displays the individual daily percentages returned by the original script



                        At this point I believe you should have sufficient examples available to allow you to continue modifying the script to your requirements.
                        If you are unfamiliar with programming in efs then I would suggest that you review the JavaScript for EFS video series and the Core JavaScript Reference Guide. Those will provide you with a thorough introduction to programming in JavaScript which is at the foundation of EFS. Then go through the EFS KnowledgeBase and study the Help Guides and Tutorials which will provide you with many of the specifics of EFS.
                        Alex


                        Originally posted by tsferro
                        incredible! i was poking around with the code last night with no luck myself!

                        now the LAST thing i am looking to do is plot the difference between Symbol1 and Symbol2. i am only interested in the difference in percentage change between two stocks, so what should i change in the code so that (Symbol1) - (Symbol2) is plotted? is it possible to do this so that once Symbol2 is entered via the "Edit Studies" function, only the difference between Symbol1 & Symbol2 is plotted in the DPC window?

                        as always, thanks Alexis.

                        Comment


                        • #13
                          The difference between the individual daily percentage changes of two stocks

                          Example :

                          Chart = Daily percentage changes ES - Daily percentage changes NQ

                          Comment


                          • #14
                            bsesen
                            You may want to review my prior post in which I already explained the changes required to do this
                            Alex


                            Originally posted by bsesen
                            The difference between the individual daily percentage changes of two stocks

                            Example :

                            Chart = Daily percentage changes ES - Daily percentage changes NQ

                            Comment


                            • #15
                              I did not understant this part

                              In the second case you will need to replace the return statement in line 162 with the following

                              Comment

                              Working...
                              X