Announcement

Collapse
No announcement yet.

Not all ticks (T&S) in main()

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

  • Not all ticks (T&S) in main()

    I was under the impression that all the sales that you see in the T&S window would also flow through the main() function. This does not appear to be the case.

    Has this changed recently? If not, is there a setting to make all the ticks flow through the main() function.

    I cam to this conclusion by watching a T&S window and a debug statement in a main() function and noticed that a subset of the ticks went through main().

    Thanks
    Last edited by wildfiction; 01-05-2006, 03:14 PM.
    Standing on the shoulders of giants.

  • #2
    wildfiction
    See this post
    Alex

    Comment


    • #3
      That's just what I needed to know - thanks Alex.

      Next question: I'm trying to determine the time - to the second - of each tick arriving in the main() function but I'm having problems. So far I can only get the time that the bar was started. I'm trying stuff like this but not helping:

      PHP Code:
          var vTime getValue("Time");
          
      debugPrintln("");
          
      debugPrint(vTime.getSeconds());
          
      debugPrint(vTime.getMinutes() + ":");
          
      debugPrint("   Time=" vTime.getHours() + ":");
          
      debugPrint("   MSecs=" vTime.getTime()); 
      Standing on the shoulders of giants.

      Comment


      • #4
        Hi wildfiction,

        Try new Date().getSeconds()

        If you want to get more than just the seconds, you should create one date object, then access the individual methods.

        http://kb.esignalcentral.com/article...ticle=2236&p=4

        Here is a link to my fileshare area. There is one efs there that has quite a few time function implementations. Be careful, accessing the date object takes about 100 times longer than accessing bar time.

        Comment


        • #5
          Thanks Steve,

          I had already been playing with your time based files from your fileshare before you posted the reply - I had found them through another post that you'd made - many thanks for that!!

          Your suggestion allows me to solve my problem. One of my indicators has a start and end time to gather certain information. It's running on a volume chart and is trying to combine time based information with the volume chart. Because a volume chart has no fixed start/end time for each bar I need to collect and time stamp the data as it comes in, in order to do that calcs.

          So what I've done is to set a flag and if I'm between that start and end times specified then I use the java date object and the system time (which is expensive) but once the end time has passed I switch the flag which then switches the time object to a bar based object (less expensive) so the EFS is only slowed down during that period.

          Of course if the end time has already passed for the day in question then the EFS just uses bar based times - again through a flag.

          I can't think of a more logical way at the moment to do this.

          Thanks again for your help.
          Standing on the shoulders of giants.

          Comment


          • #6
            In fact what I'm looking for in the main() function is a "Tick" object which has the following members:

            price
            volume
            time

            Which is essentially what we're seeing on the T&S window.

            When we access the time, close, high, low during the main() function we are accessing the info based on the current bar so the time is the start time of the bar.

            Of the 3 members I mentioned above we can get the "price" by using close(0), and the volume by maintaining a "lastVolume" var and then doing a diff on it with volume(0) but I can't see how we can get the "time" member...

            Am I making sense?
            Standing on the shoulders of giants.

            Comment

            Working...
            X