Announcement

Collapse
No announcement yet.

EFS multiple formula execution order?

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

  • EFS multiple formula execution order?

    I have a producer/consumer relationship between two efs formula instances in the same advanced chart, and they will communicate via a global variable in the process instance.

    I need the producer to set a global value *before* the consumer reads it. This will probably occur on bar closing for each formula, and so there is an issue of order of execution here. Which formula will be invoked first?

    What determines the order of invocation of formula instances within a chart. Is it the order in which the formulas are added to the chart? Can I rely upon a particular execution order being maintained within a chart, once it is set up?

    Thanks for any info or hints on this topic, or a technique I could employ to determine reliably that the producer has "produced" prior to the consumer comsuming for the bar in question.

    TIA

  • #2
    bfry,

    I too am using multiple efs's and have been faced with a similar problem (or so I thought). I have 6 "producers" feeding a "retailer" who figures things out and provides that information to a "consumer". It just so happens that I always attach the clock time with all my global variables that I send out, so I am checking to see if they are coming in out of order. I am not sure why, but everything is sequential for me regardless of how I load them into the advanced chart.

    You are going to have to perform some testing.

    First, I would send times with each packet of global variables, and test them at the destination to see if they are out of sequence. (subtract them and if they are negative, debugPrintln...) All you are doing is checking sequential timing.

    Secondly, if you are having problems with them being out of sequence, slow down the efs reading the global variables.

    You can do this by adding debugPrintln statements. I had put this together but never had to use it. Put this into the efs recieving the globals.

    if (sendertime>receivertime)
    dcounter++
    for (i=0;i<dcounter;i++)
    debugPrintln(i);
    debugClear();//this keeps the slowdown constant

    you can open up the formulaoutput.log in the e-Signal directory to see what is going on with the debug window to determine how many debug statements are required.

    If this last step is required, you have been able to prove that by slowing the one efs down, you are getting the sequencing correct.

    Long term, you probably don't want to use the debugPrintln statement to slow it down, maybe call the date object instead, otherwise, the formulaoutput.log could get too big and cause problems.

    Those are a few easy ideas, let me know if you need more, the others I have would probably require significant efs modification.

    Comment


    • #3
      Steve, as usual your suggestions are greatly appreciated. I've really benefited from your advice on advanced efs features !!

      Comment

      Working...
      X