Announcement

Collapse
No announcement yet.

prob calling interval outside chart inv().

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

  • prob calling interval outside chart inv().

    Jason,
    Thx for the reply last week about calling time intervals outside the chart one is working in. I followed your advice, and after studying the material you referred me to, I set up the attached example. It crashed. So, I am looking for a little help.
    This is set up initially as a 2 min MAStudy on a 2 min chart, and then I try to call a 1 minute MAStudy in line 14. No go.

    What is the correct format for the "inv(1)" that I am trying to insert.
    The goal of the chart is to have the color of the bars change from red tio green, as the 1 minute MA (6 period)crosses the 2 min MA (6 period).

    thx
    Tilmon
    Attached Files

  • #2
    Hi Tilmon,

    You are using efs1 commands which are not compatible with the "inv(1)" feature that was added with efs2.

    Please check this out in the Knowledgebase

    Comment


    • #3
      Tilmon,

      Here is an thread that Alex put together which has some great examples of how to use efs2 commands.



      Hope this helps.

      Comment


      • #4
        Still need help on interval prob

        Steve,
        thx for all the useful references, but they did not clear up the problem I have in the script I had attached. I studied and cataloged those references.
        Perhaps it would be helpful if I attempt a specific response to the pages you passed as reference. I was already working from that same inv() page in the EFS2 Function Reference Manual. But, the example given there is rather lean, and does not include the type of MAStudy object I am using, which is always a little more confusing to me. Also, I have never understood why the syntax format given on the top of that page includes a standard left bracket, followed immediately by a comma. I've never seen exactly that format in any scripts ".....[, ...." So, I don't get that part. Shouldn't the left bracket be on the other side of the comma?
        The EFS2 Reference is (imho) greatly "under-exampled". There are many pages in which the syntax banner for the operative command at the top of the page, includes 4, or 5 suffix conditions or flags, which in combination yield 20 or more permutations and combinations (not including when "Object"s are stuffed in place of conditions. As in my present case.
        The typical EFS2 Reference page gives one example in shorthand form:


        preMain...
        function main() {


        .....my code

        ......ATR
        }
        return my var ( price);

        There's page after page of that stuff. And for a beginner it is not adequate. A simple standard short program like ATR.efs, using the VARIATION for the COMMAND of that page's example would be better, because it would place the code conditions in context. There could be a full set of combinations and permutations of the command factors in one stanrdard example as an appendix.

        In that regard, the reference you sent me containing Alexis' wonderful "Template Program" is something I have been thirsting for since last April when I began working with EFS. It's terrific. Again (imho) it should be attached as a complimentary exhibit to EFS Tutorial #1, and referrred to in the first Video Introduction.Every new EFS student needs that software architecture template on DAY ONE. I am so thankful you directed me to it now, even attached to an inv() knowledgebase reference.

        Anyway, the script I attached in my first query generates a total eSignal crash so fast, that I do not get any diagnostics, and still do not know how to call a MASTudy.EXPONENTIAL for a time interval outside the one I am working in.

        EVen though there are two dozen examples of variations of the inv() in the reference you sent, I found none that explained directly the mistake I am making, or how to correct it, or where to insert the inv(1) call in the type of vMAStudy.MA object I am using.

        Thanks for all the useful references. They are now part of the essential library I have been assembling.

        thx,

        Tilmon

        Comment


        • #5
          Tilmon

          But, the example given there is rather lean, and does not include the type of MAStudy object I am using,
          That is because the efs2 functions no longer have the Object/Method construct of the efs1 functions you are using. If you want to use the inv() function you need to apply the efs2 functions [ie sma(), ema(), etc] as shown at the EFS KnowledgeBase page that Steve indicated.

          Also, I have never understood why the syntax format given on the top of that page includes a standard left bracket, followed immediately by a comma. I've never seen exactly that format in any scripts ".....[, ...." So, I don't get that part. Shouldn't the left bracket be on the other side of the comma?
          The square bracket is a commonly used convention in Help files to indicate that the parameter is optional.
          The comma is included inside the square bracket because it also is optional ie you would include the comma ONLY if you were using that optional parameter (see this page as an example of the use of square brackets to indicate optional arguments in a function)

          There are many pages in which the syntax banner for the operative command at the top of the page, includes 4, or 5 suffix conditions or flags, which in combination yield 20 or more permutations and combinations (not including when "Object"s are stuffed in place of conditions.
          Not sure as to how you get 20 or more permutations or combinations. Perhaps you may want to provide a specific example.
          Anyhow in this post I provide virtually all the permutations you may encounter with the efs2 functions (with the exclusion of the parameters specific to a particular function like the Stochastic, MACD, etc).

          Anyway, the script I attached in my first query generates a total eSignal crash so fast, that I do not get any diagnostics
          That is because the inv() function is not compatible with the efs1 study you are using

          and still do not know how to call a MASTudy.EXPONENTIAL for a time interval outside the one I am working in
          The syntax for the exponential average is ema(parameters). In the specific case of your example it would be
          ema(6, close(inv(1)))
          You can find an example of each efs2 study in the EFS2 Custom folder in the Formulas directory of eSignal. These are all enabled for use with external symbols and intervals.
          Alex

          Comment


          • #6
            call Tick interval from minute interval?

            Whew!! that was a tough one, but I GOT IT. Successfully converted to the EFS2 format, and called a 1 min study from a 2 minute chart.
            Thx to both Steve and Alexis. Especially Alexis for forcing me to think through the structure in the Custom Built-In EFS2 script reference.

            I didn't even know there were differences between EFS1 and EFS2. I think what happened, as may be common to newcomers, is that at first (last April) I started out by printing out all the EFS Library "Magazine Scripts" and using them as templates, because they were the only fully working models I could find. Many of those older issue scripts were/are in EFS1 and use the Object.Study model. I did not yet know about the file sharing or even the forums, much less the scroll back forum posts. Learned about those last week. Meanwhile I developed quite a habit of using the older Object.MAStudy style from those older examples.
            Then the Formula Wizard scriptswhipped up the MAStudy frenzy more.


            Next problem. After successfully calling a 1 min study from a 2 minute chart, I tried to call a 40Tick interval study from a 2 minute chart, and got an error message.

            I had used successfully, from a 2 min chart:
            study2 = ema(6, close(inv(1)));

            I tried:
            study2 = ema(6, close(inv(40T)));

            It didn't work, (I know the "close" is unnecessary). But, is there a way to call a Tick interval study from within a minute interval chart?

            Comment


            • #7
              Re: call Tick interval from minute interval?

              hi tilmon,

              You are welcome. Glad to hear you got it.

              You have heard this before, "you can lead a horse to water, but you can't make them drink". I would say that it makes for a great analogy in this case...

              Originally posted by tilmon
              ...forcing me to think ...

              Comment


              • #8
                tilmon

                study2 = ema(6, close(inv(40T)));
                It didn't work, (I know the "close" is unnecessary). But, is there a way to call a Tick interval study from within a minute interval chart?
                As specified in this article of the EFS KnowledgeBase on the inv() function if you are passing a non-numeric interval to inv() you must enclose the value in quotes (BTW this is also mentioned in this post)
                Alex

                Comment


                • #9
                  interval call problem solved

                  Alexis,
                  Placing the Quotation marks in the proper place relative to the non-integer interval call reference solved the problem, and the script ran correctly.
                  Thank you for your help on this thread. Case closed. On to next challenge. Once again I discovered belatedly that the answer was "hiding" (in plain view) in the first reference document the Knowledgebase article whichSteve sent me several days ago, and which you referenced a second time, yesterday. Red-faced here. I got wrapped up in all the examples like inv("IBM",5), and overlooked the tell-tale clue in the text of the lead paragraphs. Caught it this time.

                  Thx,

                  Tilmon

                  Comment

                  Working...
                  X