Announcement

Collapse
No announcement yet.

How do I get the bar state of another timeframe?

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

  • How do I get the bar state of another timeframe?

    Hi,

    The EFS2 documentation doesn't show that getbarstate() works with multiple timeframes? Here's the situation. I have one script that communicates with another script through a getglobalvalue()/setglobalvalue() pair. Each script is using a different timeframe for the same symbol. Script A doesn't set a new global value unless there is a barstate_newbar event in its timeframe.

    If I wanted to use the inv() function to pull A's timeframe into B's script to take advantage of the new EFS2 functions (so i would only need to have one script), shouldn't there be an easy way of finding out if another timeframe has had one of the 3 different types of BARSTATE events occur?

    Something like...

    if (getBarState(inv(10)) == BARSTATE_NEWBAR)
    {
    // insert code to react to new bar occuring in the 10 min
    // timeframe of the current symbol
    }


    [I'm either not seeing something in the docs or I think this is a design oopsie]

  • #2
    SteveH,

    At present, there is not a function or command to return the barstate of another interval. As it was explained to me, relative to using the efs() or efsInternal() functions, the resources involved for getting the barstate are the same as grabbing a data value from there.

    Having said that, my suggestion is that you try putting your efs together, then see how resource intensive it is. Should the resources for your application be excessive, we can see what the developers recommend. Since this is a beta version, it is an excellent time to determine if this is a significant issue.

    Comment


    • #3
      Hi Steve, currently this is not available. This has been requested during our EFS2 development, and hopefully I will be able to provide an easy implementation of this for Beta/2. No guarantees though =).

      Comment


      • #4
        Was reading through the documentation and wanted to check and see how this was implimented in EFS2, if it was?

        What function that is?

        Excellent book on JavaScript for beginners

        Comment


        • #5
          FibbGann
          Click here and download the eSignalEFS2.chm Help file. The functions are getBarStateInterval() and getBarStateSymbol()
          Alex

          Comment


          • #6
            Thanks ALex, the old one most not have been updated for that. One problem though lately when I have tried downloading the new CHM's, everytime I open them all the pages appear blank with "Action cancled." I know why this is happening, but I am not sure how to resolve it. Any ideas?


            Thread split by eSignal Moderator. See here for continuation
            Excellent book on JavaScript for beginners

            Comment

            Working...
            X