Announcement

Collapse
No announcement yet.

set BarBgColor Problems

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

  • set BarBgColor Problems

    Is there a referance for the types of colors which can be used in the setBarBgColor function? Once the color is set, can the color be set back to the background color?

    Best Regards,

    Alan

  • #2
    Alan
    You can use any RGB value or one of the available "plain language" colors. For a list of these see the EFS KnowledgeBase under EFS Function Reference
    Alex

    Comment


    • #3
      Thank you for the assistance.

      Best Regards,

      Alan

      Comment


      • #4
        Alan

        Once the color is set, can the color be set back to the background color?

        Depends by what you mean with "set back to the background color". If you mean can one remove the color applied with setBarBgColor() then that cannot be done. However using the setBar() function you can paint the bar background in the same color as the chart background.
        To simplify the process you may want to set a global variable before preMain() such as for example var vColor = Color.white;
        Then in premain add setDefaultChartBG(vColor);
        At that point when using setBar() to repaint the background of an historical bar you can reference the same vColor variable used to paint the chart background.
        Alex

        Comment


        • #5
          Works great !

          Thank you,

          Alan

          Comment


          • #6
            setBar Color Updating

            The following code sets the color based on the formula logic. The colors update correctly when using historical data but not on real time tick data. The colors only change when reentering the symbol of reloading the efs. Is it possible to have the color run real time on tick data as the formulas change?

            Best Regards,

            Alan










            if(MA6 >= MA4) {
            setBarBgColor(Color.blue);

            }


            if((MA5 <= MA3)){
            setBarBgColor(Color.white);

            }

            return new Array (MA6, MA4);



            }

            Comment


            • #7
              Alan
              It is possible and there are several examples available in these Forums.
              If this is not happening with your code there probably is an error in the logic.
              Alex

              Comment


              • #8
                set bar

                I found my formula error. Thank you for the guidance.

                Best Regards,

                Alan

                Comment

                Working...
                X