Announcement

Collapse
No announcement yet.

Tic Jump Question

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

  • Tic Jump Question

    Howdy,
    Quick question in regards to fast forwarding through a downloaded tic file. I run the following bit of script on a 10 minute chart.

    function main() {
    var nClose = close(inv("5s"));
    debugPrintln("bar " + getCurrentBarIndex() + " close: " + nClose + "\n");
    return;
    }


    If i play back the tic file normally i get numerous values for close() from the 5 second chart as expected. However, if I fast forward or jump to the end of the tic file .... I get one value only per bar whereas I would expect to see a value for every tic in the file. Any ideas on how to get all values for close from a 5 sec chart while fastforwarding through on a 10 min chart or is it impossible?

    Thanks,
    Chris

  • #2
    I believe this is because of the sync issues with pulling data from multiple charts. I think esignal realizes it's the last bar and pulls the last 5s close (meaning the current close) into the last bar.

    You may be able to run a backtest or whatever on every bar other than the last bar. From my experience, when I build a system that backtests and runs in RT to auto-trade, I never rely on anything but RT actions for the current bar.

    Hope this helps.
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Re: Tic Jump Question

      Chris

      However, if I fast forward or jump to the end of the tic file .... I get one value only per bar whereas I would expect to see a value for every tic in the file
      As Jason already explained to you in this post on the same topic the "...the "jump" action initiates a reload of both studies...".
      When the efs reloads it runs through the historical bars of the 10 minute chart executing only once per bar. In doing so it does not have any knowledge of what happened in each 5 second period that constitutes that 10 minute bar. All it sees in that single execution is the value of the last 5 second period for each corresponding 10 minute bar.
      This is why Jason also indicated that to retrieve the indiviidual values of the 5 seconds interval you need to drill down to that interval on every 10 minute bar and loop through all the 5 seconds bars that are contained within that 10 minute period.
      Alex


      Originally posted by Chris747
      Howdy,
      Quick question in regards to fast forwarding through a downloaded tic file. I run the following bit of script on a 10 minute chart.

      function main() {
      var nClose = close(inv("5s"));
      debugPrintln("bar " + getCurrentBarIndex() + " close: " + nClose + "\n");
      return;
      }


      If i play back the tic file normally i get numerous values for close() from the 5 second chart as expected. However, if I fast forward or jump to the end of the tic file .... I get one value only per bar whereas I would expect to see a value for every tic in the file. Any ideas on how to get all values for close from a 5 sec chart while fastforwarding through on a 10 min chart or is it impossible?

      Thanks,
      Chris

      Comment


      • #4
        Thanks Dojii and Alex for getting back to me so quickly.
        Alex, I thought that by requesting close(int("5s") I was "drilling" down to that interval on each 10 minute bar. It solved my problem in regards to getting my timing issue straight and assumed it would do the same for this value. So if I read you correctly there is no way to do what I am trying to do ?

        Thanks,
        Chris

        Comment


        • #5
          Chris

          Alex, I thought that by requesting close(int("5s") I was "drilling" down to that interval on each 10 minute bar
          You are while the script is processing real time data as the script executes on every tick. However on historical bars (while the efs is loading or re-loading) the script executes only once per bar hence it only retrieves the last lower interval value that corresponds to the higher time frame..

          So if I read you correctly there is no way to do what I am trying to do ?
          I don't believe that is what I (or Jason) said. It can be done but you need to execute a loop based on the lower interval data at each 10 minute bar. The loop will then cycle through all the lower interval bars that constitute the higher time frame. You can find a basic example in this thread.
          Keep in mind that doing this on each bar is going to be processor intensive.
          Alex


          Originally posted by Chris747
          Thanks Dojii and Alex for getting back to me so quickly.
          Alex, I thought that by requesting close(int("5s") I was "drilling" down to that interval on each 10 minute bar. It solved my problem in regards to getting my timing issue straight and assumed it would do the same for this value. So if I read you correctly there is no way to do what I am trying to do ?

          Thanks,
          Chris

          Comment

          Working...
          X