Announcement

Collapse
No announcement yet.

MACD Color Code

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

  • #16
    akiri
    There are a couple of ways you can do that. One way is to set the conditions to evaluate if the MACD line is above or below the Signal line eg
    PHP Code:
    if(vMACD.getValue(MACDStudy.MACD)>vMACD.getValue(MACDStudy.SIGNAL))
        
    setBarFgColor(Color.blue,0);//assign the color to the first element of the return array
    if(vMACD.getValue(MACDStudy.MACD)<vMACD.getValue(MACDStudy.SIGNAL)) 
         
    setBarFgColor(Color.red,0);

    The other is to evaluate if the MACD histogram is above or below 0 eg
    PHP Code:
    if(vMACD.getValue(MACDStudy.HIST)>0)
        
    //as above
    if(vMACD.getValue(MACDStudy.MACD)<0
        
    //as above 
    The result will be the same with either solution.
    Alex

    Comment


    • #17
      Thanks

      Thanks Alexis, I will work on your ideas to implement that.

      AK

      Comment


      • #18
        akiri
        My pleasure
        Alex

        Comment

        Working...
        X