Announcement

Collapse
No announcement yet.

MACD crossover efs

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

  • MACD crossover efs

    Hello,

    I have a doubt about an example on the MACD crossover.
    It is located at this link:



    I don't know if you can help me.

    I understand the down arrow on the bar for indicating the crossover, but the item "flags" with value "shape. BOTTOM",
    I didn't understand that.
    I tried to change it and see if something happened on the chart, but it remained the same.
    So, what does it mean practically?

    Thanks

  • #2
    MACD crossover

    I try again to send you the link, because I think is not correct:


    Comment


    • #3
      Marknav
      The xxx.TOP and xxx.BOTTOM flags are used to align text, shapes and images. The flags refer to the top and bottom of the graphic object so xxx.TOP will align the top of the graphic object to the specified location while xxx.BOTTOM will align the bottom of the graphic object to the specified location.
      Note that due to a bug those flags are not currently working with the drawShapeXxx() functions.
      To illustrate how the flags work I will use the drawTextRelative() function with the Text.TOP and Text.BOTTOM flags. In the following example I locate the text on the High of the bar and use the Text.TOP flag
      PHP Code:
      function preMain(){
          
      setPriceStudy(true)
      }

      function 
      main(){
          if(
      isLastBarOnChart()){
              
      drawTextRelative(0,high(0),"TEST",Color.red,Color.yellow,Text.CENTER|Text.TOP,"Arial",12)
          }

      In the following image you can see that the top of the text is aligned to the High of the bar.



      In this second example I instead use the Text.BOTTOM flag while still locating the text on the High of the bar.
      PHP Code:
      function preMain(){
          
      setPriceStudy(true)
      }

      function 
      main(){
          if(
      isLastBarOnChart()){
              
      drawTextRelative(0,high(0),"TEST",Color.red,Color.yellow,Text.CENTER|Text.BOTTOM,"Arial",12)
          }

      In the following image you can see that the bottom of the text is now aligned to the High of the bar.
      Alex

      Comment


      • #4
        Thanks a lot for your reply, Alex.

        Comment

        Working...
        X