Announcement

Collapse
No announcement yet.

PPO Indicator

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

  • PPO Indicator

    Anyone have code for the PPO indicator?






    Thanks

    Duke

  • #2
    Hi Duke, here is the code!

    Code:
    var slowma = null;
    var fastma = null;
    
    function preMain()
    {
        setStudyTitle("Price Osc");
        setCursorLabelName("Price Osc", 0);
        setDefaultBarFgColor(Color.red, 0);
        addBand(0, PS_SOLID, 1, Color.lightgrey);
    
    }
    
    
    function main(FastLen, SlowLen) {
    	
    	if(FastLen == null)
    		FastLen = 10;
    	if(SlowLen == null)
    		SlowLen = 20;
    	if(fastma == null)
    		fastma = new MAStudy(FastLen, 0, "Close", MAStudy.SIMPLE);
    	if(slowma == null)
    		slowma = new MAStudy(SlowLen, 0, "Close", MAStudy.SIMPLE);
    
    	return fastma.getValue(MAStudy.MA) - slowma.getValue(MAStudy.MA);
    }

    Comment

    Working...
    X