Announcement

Collapse
No announcement yet.

Strategy.isInTrade() - interrupter error

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

  • Strategy.isInTrade() - interrupter error

    All,

    I thought that I would post a general information post so hopefully people don’t waste the hours I did chasing the error.

    if (Strategy.InTrade() == true){

    if (Strategy.IsLong() == true)
    {
    Tradetext = "long";
    }
    else
    {
    Tradetext = "short"
    }

    }


    Above I’ve copied and pasted some code. The syntax of the Strategy.InTrade() line is slightly incorrect. The syntax should read, Strategy.isInTrade(). This wasn’t picked up by the EFS interpreter nor at run time (it was just hitting the code and returning to the calling function). Due to the lack of functionality in the complier in debug mode unfortunately it took me many hours to track the error down. I just wanted to post a message so:

    1) Hopefully, someone at Esignal will do something about it.
    2) So hopefully others don’t waste their time tracking down the same error

    Kind regards,

    Dan
    Last edited by drolles; 01-18-2009, 12:20 PM.

  • #2
    Hello Dan,

    Strategy.InTrade() is syntactically correct, which is why the syntax checker does not report a syntax error. The method name may not be a valid EFS extension, but there is nothing wrong with the syntax. It is legal in JavaScript to add custom methods and functions. It is entirely possible for someone to add their own method to the Strategy object call InTrade(). The type of error you've encounter is simply a logic error. The syntax checker can not check for logic errors.
    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
      Jason,

      Thank you very much for your reply.

      Thank you also for the clarification regarding the interpreter function. I now understand that it is syntactically correct as it could be a user defined function. Hence, the interpreter will not find the error.

      However, I would have thought it would be picked up at run time; given that Strategy.InTrade() isn’t a defined function in the Strategy Object?

      Kind regards,

      Dan

      Comment

      Working...
      X