Announcement

Collapse
No announcement yet.

How do i change downbar(red) formula?

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

  • How do i change downbar(red) formula?

    I'm new to esignal and I want to stop the PRICE BAR AND VOLUME from going RED because the intra-day price goes below the OPENING PRICE.
    I want the bar to go RED ONLY if the close or the INTRA-DAY PRICE is BELOW the previous day's CLOSE.
    Thanks.

  • #2
    yella belly
    The enclosed efs will paint the bar green/red when the close is above/below the prior close (black if equal)
    Alex

    PHP Code:
    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("Up/Down bar");
        
    setShowCursorLabel(false);
        
    setColorPriceBars(true);
        
    setDefaultPriceBarColor(Color.black);     
    }
    function 
    main() {

        if(
    close(0)>close(-1))
            
    setPriceBarColor(Color.lime);
        if(
    close(0)<close(-1))
            
    setPriceBarColor(Color.red);

        return;

    Comment


    • #3
      Thanks very much.
      Do you think it's better to use this rather than the default at esignal?

      Comment


      • #4
        yella belly
        Which default are you referring to? The Up/Down colors you select in Study Properties for the chart?
        If that is the case then the Study Properties does not have the option of painting the bars based on the prior Close which is what I thought you wanted.
        Alex

        Comment


        • #5
          Alex,
          Yes i do want the option of painting the bars based on the pervious day's close rather than todays opening.

          In my first reply what I was really asking is why esignal chose to paint bars based on the opening?

          Is that system better?

          Do you think it's a better system to paint bars based on opening or the previous day's close.
          I would appreciate your opinion.
          Thanks.
          Yella Belly.

          Comment


          • #6
            Yella Belly

            what I was really asking is why esignal chose to paint bars based on the opening?

            Very likely because that is the same convention used to define up/down days with candlesticks
            Alex

            Comment


            • #7
              Alex,
              The real question is.
              Which is more valid for technical analysis: Painted bars based on the previous close or today's opening?

              Yella Belly

              Comment


              • #8
                Yella Belly
                I don't use either method to paint bars so the reply to your question will have to come from someone else.
                Alex

                Comment


                • #9
                  Alex,
                  Out of curiosity, what system do you use and why?
                  Yella Belly.

                  Comment


                  • #10
                    Yella Belly
                    I use either Advanced Get XTL or my own studies to color the bars.
                    For information on XTL and/or Advanced Get Studies click here
                    Alex

                    Comment

                    Working...
                    X