Announcement

Collapse
No announcement yet.

Hanging of efs on load

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

  • Hanging of efs on load

    I've written what I consider to be a pretty simple script, basically I take values from the "first hour" of the market and use them for the rest of day.
    The problem I'm having is that when I load or edit the formula, the chart will hang for a little while, then finally draw.
    I noticed that if I call setComputeOnClose(), I don't have this problem, but I can't call that because I need the information as soon as it comes, instead of one bar later.
    Any suggestions??

    ALP

  • #2
    Hello ALP,

    This type of problem is typically related to the specific EFS code. Please post your formula using the attachment feature when replying on-line and I'd be happy to take a look and see what the cause might be. It would also be helpful to give me your time template settings and the symbol/interval combinations you are using with the study.
    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
      Originally posted by JasonK
      Hello ALP,

      This type of problem is typically related to the specific EFS code. Please post your formula using the attachment feature when replying on-line and I'd be happy to take a look and see what the cause might be. It would also be helpful to give me your time template settings and the symbol/interval combinations you are using with the study.
      Well, I can't post my actual code because it was written under contract, but I can summarize what I've done and hopefully that will help.

      Flow as follows:
      (declaration of external variables)
      function preMain(){
      setPriceStudy(true);
      setStudyTitle("...");
      setShowCursorLabel(true);
      setCursorLabelName("...");
      setShowTitleParameters(false);
      //setComputeOnClose();

      (function parameters set)
      setPlotType(PLOTTYPE_FLATLINES, 0);
      }
      function Main((pass function parameters)){
      (Code here that really only computes something at one hour past open, but returns a value with every bar)
      }
      (Then a couple of external functions that are small)

      As for the time and symbol settings, it doesn't seem to matter, but one of the typical time settings I use is 125t with the default symbol.

      Does anything stand out as a little questionable?
      Thanks,
      ALP

      Comment


      • #4
        Hello ALP,

        It's not possible to tell what code in your study is causing the problem without seeing the code. The process I go through to debug this type of problem starts with commenting out all the code in main() in logical sets of commented blocks (i.e. /* */). Save and run the code to see if the problem occurs. At this point, only preMain() is executing any code and does not usually contain the offending code, but its worth checking first. Then, uncomment one block at a time starting from the top of main(), save and retest. Do this until the problem reappears. This will identify the block of code that contains the problem code or a call to an external function if the problem resides there. Then comment out each line of code in that same block with single line comments (i.e. //). Then start uncommenting each line separately or sets of lines until you narrow it down to the specific line. Hope this helps.
        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


        • #5
          Thank you for your help. I believe it's working now.

          ALP

          Comment

          Working...
          X