Announcement

Collapse
No announcement yet.

Global Vars

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

  • Global Vars

    Hi,

    Apparently, the overhead associated with Global variables is significant.
    Is there a way [for the efs that creates and maintains a Global varible] to communicate to other [associated] efs' that the global var was updated?

    Example: Assuming that we use a "BasePeriod" [the one used to generate most indicators] of 20, but [with a button] that can be changed to other value, is there a way to inform all other panes that the BasePeriod was changed in one of them?

    Thank you
    Mihai
    Mihai Buta

  • #2
    Re: Global Vars

    Hello Mihai,

    Originally posted by mbuta
    Hi,

    Apparently, the overhead associated with Global variables is significant.
    Is there a way [for the efs that creates and maintains a Global varible] to communicate to other [associated] efs' that the global var was updated?
    An EFS does not have the ability to invoke an execution of an external EFS. Each EFS execution is triggered by the trade updates that occur in the chart in which it is running or trades from external symbols that the formula may be using as a source for one of its series objects. If setComputeOnClose() is used the formula will only update once per bar as each bar interval closes.

    Example: Assuming that we use a "BasePeriod" [the one used to generate most indicators] of 20, but [with a button] that can be changed to other value, is there a way to inform all other panes that the BasePeriod was changed in one of them?

    Thank you
    Mihai
    One way an EFS formula can be informed of the variable change that occurred in another EFS formula is with the use of setGlobalValue() / getGlobalValue() functions. When the button is clicked in the main EFS, it will need to pass the new value to the application global scope with setGlobalValue(). When the external (or secondary) EFS executes it has to check the current value of that application global variable set by the main EFS with getGlobalValue() to see if it is a different value compared to the last time the formula executed. Each individual formula that you want to check for this change in value needs to have this type of routine.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Hi Jason,

      Thank you for clarifications. I know how to set/get GlobalValue, but wanted to avoid it, because it is very time consuming and this paticular type of change is way infrequesnt to warrant the waste of time [on every tick or even NewBar].

      Related question please:
      In a chart with more panes, is there a rule on the order efs's are executed [say, PricePane then Pane#1, etc.], or it is absolutelly random?
      Also, if same study is used in more panes [same parameters, of course], efs engine executes it only once or repeats it for each pane?


      Thnak you.
      Mihai Buta
      Mihai Buta

      Comment


      • #4
        Mihai

        In a chart with more panes, is there a rule on the order efs's are executed [say, PricePane then Pane#1, etc.], or it is absolutelly random?
        See this reply to the same question

        Also, if same study is used in more panes [same parameters, of course], efs engine executes it only once or repeats it for each pane?
        I believe each instance is executed separately
        Alex

        Comment


        • #5
          Alex, thank you.

          Just to make sure: last pane added will be "remembered" as last [first to execute] anytime I reload my page, and this is somthing we can count on.
          Is that correct?

          Thank you.
          Mihai Buta
          Mihai Buta

          Comment


          • #6
            Mihai
            Other than what Jason has already stated in his reply I will only add that you should thoroughly test this in the context of your environment.
            Alex

            Comment

            Working...
            X