Announcement

Collapse
No announcement yet.

Passing Global Variables

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

  • Passing Global Variables

    Hi,

    I have a 3min chart which traps a certain condition and uses the 'SetGlobalVariable' command to set/pass this condition to a 1min chart which is running at the same time.

    However, I cannot get the 1min script to pick up this variable at the close of the '3rd bar'. It only gets it on completion of the 4th bar.

    Although I can remove the ComputeOnClose, and then see it on the first tick of the 4th bar, I really want to know about it before the start of this bar.

    I guess some way off knowing how the efs engine sequences the running of scripts might be useful. It might then be possible to ensure that the 3min script 'closes' before the 1min script closes.

    Any other ideas on how/if this might be done much appreciated

  • #2
    Hi gardis,

    The charts are run in the order in which they are loaded. It sounds like your efs on your 1 minute chart has cycled through it's main() before the the 3 minute chart does. With your current chart execution order, it sounds like the earliest you could get the data is the tick after the new bar.

    What you could do is set a flag when there is a new bar, then the next time the efs cycles through main on the next tick, the data is available and you can take your action.

    Comment

    Working...
    X