Announcement

Collapse
No announcement yet.

ReferenceError problem

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

  • ReferenceError problem

    Hi,

    Can someone please tell me why I'm getting the following syntax error message on just a few securities when the chart has an interval on 30mins. For example, if I set the chart to 30mins for GLG I get "line 186: ReferenceErrorMIold is not defined". However, when I use the same efs with, say PCU again on a 30min chart it works fine?

    Just so you know I did define it in the main function, however the results are totally different

    Any help would be greatly appreciated as this is becoming rather annoying.

    I have attached the efs.

    Cheers

    Carlton
    Attached Files

  • #2
    Carlton,

    Here's the problem..

    This is the way it is currently coded.

    Line 46 function main(Length,Sym,Value) {
    Line 47 if(getBarState()==BARSTATE_NEWBAR)
    Line 48 DMIold=DMI

    On line 48, you can see that there isn't a semicolon after the end of the line. This is causing a problem on line 186 and line 187 when the command is being referenced.

    Add a semicolon to the end of Line 48 and line 186 and 187 should work properly. I'm also seeing a huge draw on the CPU when changing symbols. This is most likely the cause of the issues you are experiencing.

    Comment


    • #3
      Duane,

      Thanks for getting back to me. I added the semi-colon to line 48 as you suggested, however it didn't work. I then decided to add it to line 47 and it worked. Did you mean line 47 instead of line 48?


      Cheers

      Carlton

      Comment


      • #4
        Duane,

        I should mention that when I do add the semi-colon to line 47 I lose the colour coding to let me know if the indicator is uptrending or downtrending. Which leads me to think that the semi-colon should be on line 48 as you suggested.

        Carlton

        Comment

        Working...
        X