Announcement

Collapse
No announcement yet.

EFS Understanding

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

  • EFS Understanding

    OK, lets say I have two or more securities on a chart can someone let me know if its possible to choose which security an efs will chart data for?

    Cheers

    Carlton

  • #2
    Hi Carlton,

    I just wanted to gather a little more information regarding your question. If you have more than one security on a chart window, the chart window will automatically plot both. I'm not sure I understand if you are looking to toggle between two charted securities or something else. Please let me know. Thanks.

    Comment


    • #3
      Hi Duane,

      Thanks for getting back to me.

      The best way to describe what I'm trying to is with the attached efs. This efs I was compiled by Alex, and I would like by indicator to be able to do that as well. I will send my efs after I have posted Alex's, as I don't think you can post two attachments at the same time.

      Cheers

      Carlton
      Attached Files

      Comment


      • #4
        And here is my efs that I would like to emulate the one I just posted.

        Thx

        C
        Attached Files

        Comment


        • #5
          Hi,

          I'm going to repost this thread in the hope that someone tries to help me out.

          Cheers

          Carlton

          Comment


          • #6
            Carlton

            The solution to your issue is probably too complex to fully explain by me, but I looked at the two efs and here is my suggestion.

            Use the var fp1 section as shown in the original efs in the second efs

            Change all occurances of hi/lo/c/o/volujme/etc (these are shown in blue) in the second efs to the format shown in line 40 of the original efs.

            I might suggest you write a simple efs to show the specific symbol h/l/c/o/v values in the cursor window first to be sure you have the right values, then add similar code to the second efs.

            Comment


            • #7
              Hi David,

              I made the changes as you suggested, however I completely couldn't get it to work - I kept on getting numerous syntax errors.

              Carlton

              Comment


              • #8
                David,

                Did you actually mean replace all the hi/lo/c/o/volujme/etc with "getValue"?

                Thx

                Carlton

                Comment


                • #9
                  David,

                  I kept on getting a number of the following syntax errors:

                  "Invalid Series Name(0) "

                  Comment


                  • #10
                    You need to determine how to reference the h/l/c/o of an alternate symbol.

                    Write a simple efs to show this inthe cursor window.

                    You are trying to do too much at a time right now.

                    Comment


                    • #11
                      David,

                      To be honest, I'm not sure how to do this mate. However, I think I understand what you mean when you say I have to figure out how to somehow reference the h/l/c/o of an alternate symbol - just not sure how to do it.

                      Carlton

                      Comment


                      • #12
                        Hi,

                        I seriously can't get this to work. Any help would be greatly appreciated.

                        Thank you.

                        Carlton

                        Comment


                        • #13
                          Carlton,

                          You don't have to use getValue, as open(), close(), etc allow the use of an alternate symbol as well.

                          I assume the main goal is to plot the Demand Index of an alternate symbol on the chart (say the DI of the Nasdaq on some tech stock).

                          You have Alex's code as a template on how to access alternative symbols, you can also look at the EFS help file that Chris has put into the public domain.

                          Both show that the last parameter for getValue or its derivatives (open(), close(), etc) is for an alternative symbol.

                          example:

                          close([nRelative Offset], [nNumBars],[Symbol])


                          The fact that all the possible parameters to close are in [brakets] means that they are optional.

                          so:

                          close("IBM");

                          will get you the close value of IBM for whatever interval chart you are running the EFS on.

                          high(0, -5, "MSFT");

                          Will get you the last five values from MSFT.

                          So, what I would do is take whatever symbol you want (doesn't matter for step 1, as long as it is a valid symbol) and use the literal name in all cases of open(),close(),high(), low() and volume().

                          For example there is a line in the code in question:

                          WghtClose = (high(0) + low() + 2 * close()) * .25;

                          You could change this to:

                          WghtClose = (high(0,"$NDX") + low("$NDX") + 2 * close("$NDX")) * .25;

                          And it would (or at least should) calculate the values using the Nasdaq 100 Index.

                          You could also verify the results a bit by adding a debugPrintln():

                          WghtClose = (high(0,"$NDX") + low("$NDX") + 2 * close("$NDX")) * .25;

                          debugPrintln("WghtClose =" + WghtClose + " high(0,"$NDX") = " + high(0,"$NDX") + " low("$NDX") " + low("$NDX") + " close("$NDX") = " + close("$NDX"));

                          And then make sure the value look correct for open(), high() and low() and run the math yourself to verify WghtClose.

                          Do this across all the EFS. But first Note:

                          This EFS doesn't do error checking of the returns. Notice how in Alex's script he does the following:

                          vValue = getValue("Close", 0, -nLength,Sym);

                          if(vValue == null) {
                          return;
                          }

                          That check for a null return is critical to prevent errors. So to prevent errors I would take the next step of doing the following:

                          var nHigh = high(0,"$NDX") ;
                          var nLow = low("$NDX");
                          var nClose = close("$NDX"));

                          if (nHigh == null || nLow == null || nClose == null){
                          return;
                          }

                          WghtClose = (nHigh + nLow+ 2 * nClose) * .25;

                          After you get the above to work, you can then try using a variable for the symbol (if you really need a variable...if not leave it a literal).

                          Hope this helps...

                          Garth
                          Garth

                          Comment


                          • #14
                            I'm a genius,

                            I got it to work. If someone could just take a quick look at it just to make sure show that its ok, I would appreciate it.

                            Basically, all I did was follow David's suggestion and added "Sym" practically everwhere :-)

                            Garth, I'm going to check out your suggestions, however, if it my tweak works I'll most probably stick with it - but thanks anyway.

                            David, cheers mate.

                            Carlton
                            Attached Files

                            Comment


                            • #15
                              Garth,

                              I have just read your comments, and I was wondering you would be kind enough just to check out whether I've included enough code to check for errors. As you can imagine, I would hate to use this script to trade if its unreliable, and I can't think of anything worse for a trader to trade with indicators he doesn't have full confidence in.

                              Thanks again mate.

                              Cheers

                              Carlton

                              Comment

                              Working...
                              X