Announcement

Collapse
No announcement yet.

Need help to color background price panel when condition = 0

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

  • Need help to color background price panel when condition = 0

    Hi,

    I could not be able to figure out how to color the background price panel when the condition = 0.

    I got a SyntaxError: "invalid assignment left-hand side" when I ran the statement below in an efs:

    if(vMACD.getValue(MACDStudy.MACD) = 0 )
    setBarBgColor(Color.yellow,0);


    With the inequalities "< " or ">", I got the efs colors the background price panel ok but I would like to color it when the condition = 0.

    Could someone pls give me some explaination why I got that SyntaxError and may be some guidance on how I would do it.

    Any help is greatly appreciated.

  • #2
    Re: Need help to color background price panel when condition = 0

    Ted608
    The operator you are using in your conditional statement is an assignement operator ie = instead of a comparison operator ie ==
    For more information on JavaScript operators see this article in the EFS KnowledgeBase
    Alex


    Originally posted by Ted608
    Hi,

    I could not be able to figure out how to color the background price panel when the condition = 0.

    I got a SyntaxError: "invalid assignment left-hand side" when I ran the statement below in an efs:

    if(vMACD.getValue(MACDStudy.MACD) = 0 )
    setBarBgColor(Color.yellow,0);


    With the inequalities "< " or ">", I got the efs colors the background price panel ok but I would like to color it when the condition = 0.

    Could someone pls give me some explaination why I got that SyntaxError and may be some guidance on how I would do it.

    Any help is greatly appreciated.

    Comment


    • #3
      Seems to me you just need to double the equal sign "==" as opposed to "="

      PHP Code:
      if (vMACD.getValue(MACDStudy.MACD) == ) {
           
      setBarBgColor(Color.yellow,0);
           [... 
      additional stmts];

      Try that.

      Cheers,
      Ryan.

      Comment


      • #4
        Thank you ...

        Thank you so much rdehavelyn and Alexis. You people have helped me save countless of hours and frustration!

        Ted608

        Comment


        • #5
          You are most welcome.

          Regards, Ryan.

          Comment

          Working...
          X