Announcement

Collapse
No announcement yet.

Help with internal function call

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

  • Help with internal function call

    I have a very short form of my efs script that is failing. I have an internal function which I call from main() for a CURRENTBAR.
    But even when I comment out the call to efsInternal("functionA"), the function appears to be called as evidenced by the println statement inside functionA.

    Can you tell me what is happening? I have tried to debug this for a long time and can not figure out why functionA is called when there is no active reference to it.

    Sample efs attached

    Thanks
    Attached Files

  • #2
    Attached formula output window jpg

    Here is the output into the formula output window.
    Notice the functionA only gets called once we have a CURRENTBAR which it should, but why is it being called in the first place?
    Attached Files

    Comment


    • #3
      Hello crazytiger,

      The debug statement that you are seeing is coming from the second debugPrintln() statement that is inside main(). The debug statement inside functionA() is not being executed.



      BARSTATE_CURRENTBAR will be returned by getBarState() for each trade that occurs in real time on bar 0. You may want to review Beginner Tutorial 4 on bar state and bar indexing.
      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


      • #4
        Oh, I posted the wrong code. I had a much more complicated efs but I pared it down to this example. IN my other example with everything in there, it really appeared to be calling the internal function even though the debug statement and the call to efsinternal was commented out.
        I am going to re-check it and get back to you.

        Comment


        • #5
          Hi Jason,
          I sent you a PM.
          I didn't want to post all of my script here.
          Can you take a look at it when you have a chance?
          I looked at my entire script for a very long time.
          It really looks like the script has a problem via the output messages to the formula output window.
          Thanks.

          Comment


          • #6
            Hello crazytiger,

            You'll need to post your code here. If your code is proprietary and you do not wish to post it publicly, then create an example set of code that reproduces the problem you're experiencing and we'll go from there.
            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


            • #7
              That's okay. I dicsovered that a basic Javascript function call rather than a EFS efsInternal call works. So problem solved.

              Comment

              Working...
              X