Announcement

Collapse
No announcement yet.

Tick crossing zero alert

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

  • Tick crossing zero alert

    I am trying to get an alert (via the Triggered Alert List) when $tickq crosses above or below zero on my 5 minute chart.

    I'm not even sure now what efs's I merged to get the one below, but something is wrong because I get the "crossing up above zero" alert often (even when its crossing down), but never the "crossing below zero" alert.

    Any ideas where I've gone wrong?

    Thanks
    shaeffer
    Attached Files

  • #2
    Hello shaeffer,

    Add the following global variable and change your if statements to reference vTick1 instead of vTick,-1.

    var vTick1 = getValue("Close", -1);
    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
      Hi Jason,

      I entered your global variable suggestion into line#3 (I thought I read that global variables have to be outside main or premain), but got an error "getValue() can only be called in main()". So I moved it into main, and get no errors, but also no Triggered Alert.

      Did I enter this wrong?

      Regards
      shaeffer
      Attached Files

      Comment


      • #4
        Another weird thing happening is that the top lighter green background extends further to the right than the other background colors? Any idea why?
        Attached Files

        Comment


        • #5
          On a whim, I eliminated setComputeOnClose(), which seems to have solved both problems. The alert now triggers, and the background colors now line up on the right side.

          I guess it was conflicting with the getValue("Close") commands.

          Comment

          Working...
          X