Announcement

Collapse
No announcement yet.

Added condition to paint Bg

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

  • Added condition to paint Bg

    I've been trying to paint Bg when MA is higher or lower than previous bar. I started by using the EFS template created by Alex, and added that part but now want to add a condition where the background goes back to default if the close moves across the MA line even if the previous condition is still true. This way, I won't have just a two-color background but with 3 or more colors. Also, I'm not sure of the syntax in telling the Bg color to go back to default if the "else" statement is true. Any help will be greatly appreciated.

    Thanks,
    Kirk
    Attached Files

  • #2
    Kirk
    There are a couple of errors in lines 74 and 76 where close should be Close.
    That aside to accomplish what you want remove the else and its corresponding command ie. setBarBgColor(Color.yellow). If neither of the prior conditions is met the efs will default to the background color you have set in preMain()
    Alex

    Comment


    • #3
      Thanks, Alex, now it's working like a charm.

      kz

      Comment


      • #4
        Kirk
        My pleasure
        Alex

        Comment

        Working...
        X