Announcement

Collapse
No announcement yet.

How can I plot multiple MACD's on the same screen?

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

  • How can I plot multiple MACD's on the same screen?

    How can I plot multiple MACD's on the same screen so that they chart on the same plot?

  • #2
    One would use an EFS file returning multiple MACDs.

    Here is such a file:
    PHP Code:
    function preMain() 
    {
        
    setPriceStudy(false);
        
    setStudyTitle("MultiMACD");
        
    setCursorLabelName("macd(12, 26, 9)"0);
        
    setCursorLabelName("macd(7, 13, 5)"1);
        
    setCursorLabelName("macd(50, 20, 6)"2);
        
    setComputeOnClose(true);
        
        
    setDefaultBarFgColor(Color.fushcia0);
        
    setDefaultBarFgColor(Color.red1);
        
    setDefaultBarFgColor(Color.green2);
     
        
    setDefaultBarThickness(20);
        
    setDefaultBarThickness(21);
        
    setDefaultBarThickness(22);
        
        
    addBand(0PS_SOLID1Color.white"ZeroLine");
        
    addBand(2.5PS_SOLID1Color.white"AnotherLine");
        
    addBand(-2.5PS_SOLID1Color.white"AnotherLine2");
           
        
    setStudyMin(-5);
        
    setStudyMax(5);
    }

    var 
    macd1 null;
    var 
    macd2 null;
    var 
    macd3 null;

    function 
    main() 
    {
        if (
    macd1 == null) {
            
    macd1 macd(12269);
            
    macd2 macd(7135);
            
    macd3 macd(50206);
        }
        return new Array( 
    macd1.getValue(0), macd2.getValue(0), macd3.getValue(0) );

    This EFS produces an indicator that looks like this:

    Comment

    Working...
    X