Announcement

Collapse
No announcement yet.

how frequent is a stidy got updated while computing on close?

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

  • #16
    Jason, Hi, please could you comment on the queries I raised about the object life cycle effects in my Feb 22nd post.
    Thanks
    Dave

    Comment


    • #17
      Re: Re: -

      Clearpicks,

      Yes, as I understand it, your RSI is "reinstantiated" with each new bar thru the realod/RT data collection process. It should DUMP the old instantiated RSI and replace it with the new one.

      You can also do this (reinstantiating) thru analysis comparison to adjust values for any indicator. It makes for an adaptive type of indicator (if needed).

      Originally posted by clearpicks
      Hello Jason,

      If my code looks like

      var myStudy = null;
      function main() {
      if ( getCurrentBarIndex() < 0 && getBarState() == BARSTATE_NEWBAR ) {
      myStudy = rsi( 14, sym("IBM,D"), -1);
      debugPrintln("myStudy= " + myStudy);
      }

      return myStudy;
      }


      Will the series of "IBM,D" be created many times (because rsi( 14, sym("IBM,D"), -1) is called on every OLD bar), or EFS2 is smart enough to reuse the "IBM,D" series already been created?


      - Clearpicks
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment


      • #18
        Hello Clearpicks,

        I'm in the process of clarifying some specific details regarding this thread with our developers. I should have more info by tomorrow or Monday.
        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


        • #19
          Re: how frequent is a stidy got updated while computing on close?

          Hello Clearpicks,

          I have some more information for you regarding your original question.

          Originally posted by clearpicks
          If I set an EFS compute on close and in this EFS there is a builtin study called, for example

          setComputeOnClose(true);
          ......
          var volBBTopStudy = upperBB(20, 2, volume(sym(volSymbol)));
          ......

          My question is whether volBBTopStudy is updated on every tick of volSymbol or it is only updated at the end of each bar of the primary symbol? Thanks in advance.


          - Clearpicks
          All built-in study functions that create a series object within a formula that is using setComputeOnClose() will update on close only, not tick by tick.

          Only series objects created using efsExternal() will continue to be updated on a tick-by-tick basis if the formula being called is not using setComputeOnClose(). We will be reviewing the implementation of efsExternal() and setComputeOnClose() in a future version. This behavior may be changed, but no decision has been made at this time.


          Originally posted by clearpicks

          If my code looks like

          var myStudy = null;
          function main() {
          if ( getCurrentBarIndex() < 0 && getBarState() == BARSTATE_NEWBAR ) {
          myStudy = rsi( 14, sym("IBM,D"), -1);
          debugPrintln("myStudy= " + myStudy);
          }

          return myStudy;
          }


          Will the series of "IBM,D" be created many times (because rsi( 14, sym("IBM,D"), -1) is called on every OLD bar), or EFS2 is smart enough to reuse the "IBM,D" series already been created?


          - Clearpicks
          The IBM,D series will only be created once, the first time the call is executed. The formula will simply reference the existing rsi(14, sym("IBM,D")) on each subsequent execution of the function.

          In the case where myStudy is only declared locally to main(), the same scenario occurs. Only the local javascript variable is removed from memory after each execution of main(), but the underlying series object that was initialized by the first call will remain in memory for the life of the formula.

          If a formula contained logic to dynamically change the number of periods for the rsi() call, the EFS2 engine sees a new set of parameters and will create and new instance of a series object with the new parameters. The other series created will still remain in memory until the formula is removed from the chart or eSignal is shutdown.

          Dave, a trade (or tick) generates an execution of main() for all interval types except P and tick (T). A trade at the same price or new price constitutes a tick, or execution of main. There is a known problem with the price change chart and the executions of main(), which has been previously reported. For tick charts (T), bid/ask updates also generate an execution of main(). There is also one exception to these general rules, which corresponds to the electronically traded futures contracts (non-tick intervals). Currently, only a price change or a trade at the same price that occurs simultaneously with a bid/ask change generates an execution of main. This also has been reported and will be reviewed.
          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


          • #20
            Jason, Hi, Thanks for the summary.
            I'm finding some points somewhat counter-intuitive and different to what I thought I had discovered, so could we just clarify a few things here. Please correct any errors, there are a few queries too I'm afraid

            Object lifetime:
            1) Series objects are not deleted when the local (inside main(){}) variable goes out of scope.
            2) When a series is assigned to a variable EFS looks at all the series that have previously been created and reuses them if the parameters match. PS: What scope? Is is same EFS, same indicator pane, same chart, same eSignal app instance?
            3) This (1 and 2) applies to all types of series, ie built-in, efsExternal().
            4) Except for when both ComputeOnCall is set and the study is built-in, all these series will be updated at each main() call (ie whether currently referenced by a variable or not).

            Hence, no point in using local variables to control object lifetime and CPU use (but may make code clearer of course)? An example is, comparing an hourly moving average with an hourly candle close - I had assumed it made sense to create the series on the fly as it is used so infrequently, apparently not.

            Ticks and main():
            I can see my interpretation has been skewed because I only ever look at the ES, thus I'm caught out by
            There is also one exception to these general rules, which corresponds to the electronically traded futures contracts (non-tick intervals). Currently, only a price change or a trade at the same price that occurs simultaneously with a bid/ask change generates an execution of main
            When you say "non-tick", please qualify what you mean (generally that is), ie which charts are classed as "tick" - I assume a Volume chart is a "tick" chart, hence in this case it is not affected?

            Does this mean, for say the ES on a 1 min chart:
            There is always a call to main if the price changes?
            If several trades occur at JUST the bid and the bid does not change there is no call to main()? [And the same for the ask.]
            Presumably the call to main() "catches up" when the bid/ask does change and a trade occurs (ie the total volume will be updated).

            Is it possible that if the trade price does NOT change, but the bid and ask do so that trade occurs at both the bid and ask but always at the same price then there is no call?

            There is a known problem with the price change chart and the executions of main(), which has been previously reported.
            You mean "P" (only) here, I assume. I'm not sure what the problem is in terms of how it affects the other statements, please explain.


            For tick charts (T), bid/ask updates also generate an execution of main().
            A call to main() resulting from a change in bid/ask but no trade could be detected in main() by seeing no change in volume()?
            Well I had assumed that, but when I wrote some efs that processed Volume (ie tick?) charts I found that I never got a call with no change in volume, thus assumed I didn't get the bid/ask changes. I may have made a mistake, please could you confirm.

            For clarity perhaps we could have a table of all chart types (time frame) and what data is and should be received, to include lines for the electronic futures to clearly show what is received?


            Thanks
            [edited for clarity (I hope), gmt 2008-03-04 10:15]
            Last edited by Dave180; 03-04-2008, 02:18 AM.

            Comment


            • #21
              Hello Dave,

              Originally posted by Dave180
              Jason, Hi, Thanks for the summary.
              I'm finding some points somewhat counter-intuitive and different to what I thought I had discovered, so could we just clarify a few things here. Please correct any errors, there are a few queries too I'm afraid

              Object lifetime:
              1) Series objects are not deleted when the local (inside main(){}) variable goes out of scope.
              Correct.


              2) When a series is assigned to a variable EFS looks at all the series that have previously been created and reuses them if the parameters match. PS: What scope? Is is same EFS, same indicator pane, same chart, same eSignal app instance?
              Same EFS.


              3) This (1 and 2) applies to all types of series, ie built-in, efsExternal().
              All EFS2 series objects.


              4) Except for when both ComputeOnCall is set and the study is built-in, all these series will be updated at each main() call (ie whether currently referenced by a variable or not).
              Correct.


              Hence, no point in using local variables to control object lifetime and CPU use (but may make code clearer of course)? An example is, comparing an hourly moving average with an hourly candle close - I had assumed it made sense to create the series on the fly as it is used so infrequently, apparently not.
              This would be more of a preference determined by each user.


              Ticks and main():
              I can see my interpretation has been skewed because I only ever look at the ES, thus I'm caught out by


              When you say "non-tick", please qualify what you mean (generally that is), ie which charts are classed as "tick" - I assume a Volume chart is a "tick" chart, hence in this case it is not affected?
              Correct.


              Does this mean, for say the ES on a 1 min chart:
              There is always a call to main if the price changes?
              Correct.


              If several trades occur at JUST the bid and the bid does not change there is no call to main()? [And the same for the ask.]
              Main() will execute on the first trade.


              Presumably the call to main() "catches up" when the bid/ask does change and a trade occurs (ie the total volume will be updated).
              Total volume will be updated on the subsequent execution of main().


              Is it possible that if the trade price does NOT change, but the bid and ask do so that trade occurs at both the bid and ask but always at the same price then there is no call?
              If the trade price is not a price change but either the bid or ask price changed, main() will be executed.


              You mean "P" (only) here, I assume. I'm not sure what the problem is in terms of how it affects the other statements, please explain.
              The price change interval type (i.e 10P) is not registering the proper count of price changes. It appears to be counting changes in bid or ask as well.


              A call to main() resulting from a change in bid/ask but no trade could be detected in main() by seeing no change in volume()?

              Well I had assumed that, but when I wrote some efs that processed Volume (ie tick?) charts I found that I never got a call with no change in volume, thus assumed I didn't get the bid/ask changes. I may have made a mistake, please could you confirm.
              Only on a "T" (note: this is not the same as "1T") interval as that type of tick chart can show the bid and ask prices as a price series on the chart. Volume does not increase as there wasn't a trade, but a bar (or tick position) is created in the chart to display the new bid/ask price. This does not apply to "xxxV" or any other interval. A change in bid or ask price when no trade has occurred only generates an execution of main() on at chart using "T" as the interval.
              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

              Working...
              X