Announcement

Collapse
No announcement yet.

Condition based on colour of bar

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

  • Condition based on colour of bar

    Hi,

    Hope somebody can help me.

    I'm trying to incorporate an if command in my formula which goes:

    if the colour of the current bar is, say green, then perform an action (eg. an alert). But I can't seem to get the code right.
    I was trying getBarState (color.green) but it didn't seem to like color.

    Can anybody help please?

    Thx

    Mephisto

  • #2
    Mephisto
    efs does not recognize colors. The solution is to also add a flag when a condition is true.
    For example
    if(close()>MA){
    setBarFgColor(Color.green);
    vFlag=1;
    }
    Then you can check the state of the flag
    if(vFlag==1) etc
    Alex

    Comment


    • #3
      Thanks Alex.

      Comment

      Working...
      X