Announcement

Collapse
No announcement yet.

multiple conditions in an if statement

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

  • multiple conditions in an if statement

    Can someone show me how i can do an if statement with two conditions. For example i want to make my price bars green when the cci is above a certain value and the price is over the 20ema.
    so basically i need something like
    if ccivalue>100 and price>20ema then color bar green
    Is this possible to do both together as so far ive been able to accomplish them separately but not together in one program.
    Thanks In Advance
    Yoda

  • #2
    Yoda:

    if ((ccivalue>100) && (price>20ma)) {
    doSomthing();
    }


    Or is the same except you use two vertical bars ||.

    Chris

    Comment

    Working...
    X