Announcement

Collapse
No announcement yet.

Preventing duplicate output to Formula Output

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

  • Preventing duplicate output to Formula Output

    Hi,

    How can I prevent repeated debugPrint statements via “function postMain()”when closing out a chart.

    See the attached image. The script should only send 9 lines to the Formula Output window.

    Any help is appreciated.

    wayne
    Attached Files

  • #2
    Re: Preventing duplicate output to Formula Output

    Hi Wayne,

    How many times do you use efsInternal() in your efs?



    Originally posted by waynecd
    Hi,

    How can I prevent repeated debugPrint statements via “function postMain()”when closing out a chart.

    See the attached image. The script should only send 9 lines to the Formula Output window.

    Any help is appreciated.

    wayne

    Comment


    • #3
      Hi Steve,

      None, just two calls [onAction1() and onAction2()].

      So since there are 4 output iterations of the Post function data I assume that it is one for function main and one for each of the onAction calls and maybe one at closing?

      Is there a way around this?

      It is just for quick test purposes. For longer term I am looking at a promising previous post of yours at: http://forum.esignalcentral.com/show...e%2A#post97955

      I haven't implemented it yet but is looks like a great way to get output.
      Thanks.

      wayne
      Last edited by waynecd; 03-28-2009, 02:01 PM.

      Comment


      • #4
        Hi Wayne,

        It appears as if postMain is being called four times, which implies to me that it had been copied, perhaps when efsInternal was used. Then when the efs is being shut down, the function is called for each established namespace that was created by your efs. An alternate explanation is that there are 4 instances where this efs is being run

        Regardless, based on the output you posted, a simple fix would be to put a conditional around your set of debugPrintln statements that checked the number of trades. Set it up so that if greater than zero, you would get your output

        Comment


        • #5
          Hi Steve,

          So easy I wish I thought of it.

          Thanks again for all your great help.

          wayne
          Last edited by waynecd; 03-28-2009, 01:40 PM.

          Comment


          • #6
            Hi Wayne,

            Your most welcome.

            btw, you can always stick a date in the output to help you figure out when it was written to the formulaoutput.log.

            for example add this after your last debugPrintln() output.

            PHP Code:
            debugPrintln(new Date()); //~ a timestamp, eg --> Sat Mar 28 2009 17:31:35 GMT-0400 (Eastern Daylight Time)
            debugPrintln(""); //~ a space to seperate from other output 
            Last edited by ; 03-28-2009, 02:42 PM.

            Comment


            • #7
              Hi Steve,

              Great tip.

              I'm also using a technique from some of your code that puts the efs code line # at the beginning of debugPrintln() to ID where the output is comming from.

              thanks,

              wayne

              Comment

              Working...
              X