Announcement

Collapse
No announcement yet.

Compute on close not working in efs

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

  • Compute on close not working in efs

    Any one know how to get the attached working on close instead of tick by tick.
    setComputeOnClose (true) doesn't seem to do it!
    Attached Files

  • #2
    Russell
    The function is setComputeOnClose() not setComputeOnClose(true)
    Alex

    Comment


    • #3
      how is setComputeOnClose() different

      how is setComputeOnClose() different from using
      if (getBarState() != BARSTATE_NEWBAR) return; ?

      main() doesn't seem to execute until the 1st tick of the next bar anyway, unless i'm doing something wrong? it makes sense because how would efs know that the last tick has occured for a bar until it gets to the new bar?

      I'm trying to write info to a file at the end-of-day. How can I accomplish that if the new bar doesn't occur until morning?

      Thanks.

      Comment


      • #4
        There isn't much difference between the two - except that waiting for the NEWBAR means your efs will be called on each tick only to return after doing the check. WIth ComputeOnCLose() the EFS isn't called until the bar closes.

        What interval are you running your study on?
        Garth

        Comment


        • #5
          Time frame is "daily". Am trying to write data at end-of-day to a file.

          Comment


          • #6
            If it isn't critical for the data to be written exactly at the close, you could always just load the formula sometime after the close, and it will capture the data at the time of close, without having to worry about NEWBARS or ComputeOnClose().

            If for some reason you need this printed in near realtim you could just check the time using rawtime and once the closing time is there, wait until no more ticks come in for a few minutes and then write the last value to your file.

            Neither option is great, but they should work.

            G
            Garth

            Comment


            • #7
              Thanks. I can live with that.

              Comment


              • #8
                RE: Reply to post 'Compute on close not working in efs'

                Doh! It just gets worse and worse

                Thanks

                -----Original Message-----
                From: [email protected] [mailto:[email protected]]
                Sent: 01 April 2003 18:41
                To: [email protected]
                Subject: Reply to post 'Compute on close not working in efs'


                Hello Russell,

                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                Comment

                Working...
                X