Announcement

Collapse
No announcement yet.

EFS event prior to New Bar state?

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

  • EFS event prior to New Bar state?

    Is there an EFS event, which occurs prior to the New Bar event?

    I'd like to accumulate some intrabar stuff, and then know when I can put it on the graph, while still on the current bar.

    I presume that once the New Bar is started any results could not be placed on the chart at the previous bar without some graphical offsetting, or some such technique.

    Thanks!

  • #2
    There is no signal for a "last tick in a bar". Only for "first tick in a bar".

    You can accumulate your values, making sure you check for NEWBAR first thing in main(). If it is a newbar you draw on the graph using one of the draw<something>relative commands using a -1 for the bar position. You can then reset you variables (if you need to).

    Garth
    Garth

    Comment


    • #3
      Asking for clarifications on similar issues

      Hi,
      I encounter some similar issues with my scripts (performance, missing drawings in real time) and I thought that someone can clarify a few things here, rather than starting a new thread.

      Background info: Trying to optimize the CPU overhead, I make some calculations/plotting once every minute and some on NEWBAR only. I have only 4-5 lines that execute every tick, in a 3000+ lines script (BarState, BarCounter).

      I ran into two problems:

      Problem #1.
      In real time, drawings/plots/alerts are not executed/triggered sometimes, although they appear correct if I reload the efs.

      a/ This tells me that I get different results when I calculate/test in real time rather than historical data, but I do not know why nor how to correct it. Any ideas?

      b/ When testing high(), low() in real time, is it the high/low of that tick, or of the entire bar so far?

      Problem # 2.
      Because I am running a heavy loaded page (six charts, each one running a price study (1.75 milliseconds) and 4 indicator panes (30-70 milliseconds, depending on what is plotted), I get some delay at the open, which is understandable, but was manageable until I added some 60-70 lines of new code in a 3000+ lines script (test for pivot conditions and drawings dots and some text if found).
      If an active symbol, like QQQ, is displayed, I get permanent looping (no errors, just looping) and never recovers. I have to close eSignal and re-start it.
      Those new 50 lines execute only if script is used as PriceStudy and they increased the execution time by 13 milliseconds (from 1.62 to 1.75).

      What can be done to overcome this problem? I need the entire script and, I believe, that execution times are reasonable, based on what I saw floating around. I do have 1.5GHZ CPU, 256MB Rambus RAM, I increased the Heap Size to 64Mb and Stack size to 65MB and Stack Size to 128KB.

      Is the a way to "skip" some unwanted tick calculations, because it seems to me that this is my problem: Main() is called on every tick and if the symbol is active, like QQQ, I am done.

      Thank you in anticipation.
      Best regards,
      Mihai
      Mihai Buta

      Comment


      • #4
        Mihai,


        Problem #1.

        a/ I would look at some of Alex's efs's. He does a very good job at ensuring the data is in sync with the previous bar, and his efs's are layed out very well. Here is a
        link to a thread that has a real good discussion in this regard which also addresses, I believe, your item b/

        b/ see the above link, but to answer you directly, it the high/low of the entire bar so far, updated every tick.

        Problem #2.


        You may consider trying to run the performance measurement efs I put together a while back. It tests the performance of the processor, memory and hard drive by running different operations which use these components and provides a measure of performance relative to the performance PC recommended by eSignal. It may provide you some good information.

        Just looking at what you have as far as a PC, depending on the operating system, you may do well to double your memory to 512 meg.

        Regarding your execution time, the execution time difference you listed as going from (from 1.62 to 1.75) would either be 130 miliseconds or .13 milliseconds depending on the units you are using. I suspect .13 based on how the performance monitor reports time, plus that is in the ballpark for complex efs run times.

        Are you running version 7.7?

        With regards to trying to troubleshoot what is taking the majority of the execution time, I would suggest copying your code and running it in tick playback with the performance monitor on. Then, start off by commenting out chunks of code, then seeing what affect each section has on the execution time (it sounds like you have been doing a variant of this). The advantage of tick playback is that you can get a lot of data on the performance of your code relatively quickly.

        Comment


        • #5
          Mihai,

          Regarding unwanted Tick calculations, you could count ticks and perform your calculations, based on the previous bars ticks (or a moving average perhaps), 4 times per bar. e.g. previous bar had 100 ticks, you want calculation preformed 4 times per bar, run it every 25 ticks. Alternatively, you could also add into the mix price change based on getMostRecentTrade(), or perhaps another measure of price change.

          Comment

          Working...
          X