Advertisement
saisri

MACD_12-26-9+HIST + ADXR band

Jul 15th, 2012
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. _SECTION_BEGIN("MACD_12-26-9+HIST + ADXR band");
  2. r1 = Param( "Fast avg", 12, 2, 200, 1 );
  3. r2 = Param( "Slow avg", 26, 2, 200, 1 );
  4. r3 = Param( "Signal avg", 9, 2, 200, 1 );
  5. m1= MACD(r1,r2);
  6. s1= Signal(r1,r2,r3);
  7. ////////////////////////////////////////////// HIST //////////////////////////////////////
  8.  
  9. hist=m1-s1;
  10. Colorhist=IIf(hist>Ref(hist,-1),colorYellow,colorRed);
  11.  
  12. Plot( hist*2, "MACD Histogram", Colorhist, styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );
  13. Plot( hist*2, "MACD Histogram", Colorhist, styleNoTitle | styleNoLabel, maskHistogram );
  14. PlotOHLC( 0, hist*2, 0 , 0 , "hist",Colorhist, styleCloud | styleNoLabel);
  15. /////////////////////////////////////// MACD //////////////////////////////////////////////////////////////////
  16.  
  17. Colorm=IIf(m1>Ref(m1,-1),colorGreen,colorDarkRed);
  18. Plot( m1, "MACD12269", Colorm, styleHistogram );
  19. Plot( m1, "MACD", colorRed, styleNoLabel );
  20.  
  21. Plot( s1, "Signal", colorTeal, styleNoLabel|styleThick);
  22. PlotOHLC( 0, m1, 0 , 0 , "MACD",Colorm, styleCloud | styleNoLabel);
  23. //////////////////////////////////////////// ADXR BAND //////////////////////////////////////////////////////
  24.  
  25. pds=14;
  26. Adxr = ( ADX(pds) + Ref( ADX(pds), -14 ) )/2;
  27. //Plot(ADxr,"",colorWhite,4);
  28.  
  29. //Plot( PDI(14), "+DI",ColorRGB(0,100,20),styleThick | styleNoLabel);
  30. //Plot( MDI(14), "-DI",ColorRGB(100,0,20),styleThick | styleNoLabel);
  31. A = PDI(14);
  32. B = MDI(14);
  33.  
  34. //PlotOHLC( 0, A , B , B , "Cloud", IIf(A > B ,ColorRGB(0,25,10),ColorRGB(35,0,10)), styleCloud | styleNoLabel);
  35.  
  36. ColorA=IIf(ADXr>25,IIf(A>B,IIf(ADXr>EMA(ADXr,3),colorBrightGreen,colorGreen),IIf(ADXr>EMA(ADXr,3),colorRed,colorDarkRed)),colorBlack);
  37.  
  38.  
  39. Plot( 3,"",ColorA, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  40. Plot( 4,"",colorBlack, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  41.  
  42. ////////////////////////////////////////////////// MACD TRENDING BAND /////////////////////////////////////////////////////////////////
  43.  
  44. r1_5=r1*5;
  45. r2_5=r2*5;
  46. m_5= MACD(r1_5, r2_5);
  47. s_5= Signal(r1_5,r2_5,r3);
  48.  
  49.  
  50. r1_10=r1*10;
  51. r2_10=r2*10;
  52. m_10= MACD(r1_10, r2_10);
  53. s_10= Signal(r1_10,r2_10,r3);
  54.  
  55.  
  56. r1_20=r1*20;
  57. r2_20=r2*20;
  58. m_20= MACD(r1_20, r2_20);
  59. s_20= Signal(r1_20,r2_20,r3);
  60.  
  61.  
  62. r1_40=r1*40;
  63. r2_40=r2*40;
  64. m_40= MACD(r1_40, r2_40);
  65. s_40= Signal(r1_40,r2_40,r3);
  66.  
  67.  
  68. r1_80=r1*80;
  69. r2_80=r2*80;
  70. m_80= MACD(r1_80, r2_80);
  71. s_80= Signal(r1_80,r2_80,r3);
  72.  
  73.  
  74.  
  75. ColorT=IIf(m1>0,IIf(m1>s1,colorBrightGreen,colorDarkRed),IIf(m1<s1,colorRed,colorDarkGreen));
  76. Plot( 7,"",ColorT, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  77. Plot( 8,"",colorBlack, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  78.  
  79.  
  80. ColorT5=IIf(m_5>0,IIf(m_5>s_5,colorBrightGreen,colorDarkGreen),IIf(m_5<s_5,colorRed,colorDarkRed));
  81. Plot( 11,"",ColorT5, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  82. Plot( 12,"",colorBlack, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  83.  
  84. ColorT10=IIf(m_10>0,IIf(m_10>s_10,colorBrightGreen,colorDarkGreen),IIf(m_10<s_10,colorRed,colorDarkRed));
  85. Plot( 15,"",ColorT10, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  86. Plot( 16,"",colorBlack, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  87.  
  88. ColorT20=IIf(m_20>0,IIf(m_20>s_20,colorBrightGreen,colorDarkGreen),IIf(m_20<s_20,colorRed,colorDarkRed));
  89. Plot( 19,"",ColorT20, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  90. Plot( 20,"",colorBlack, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  91.  
  92. ColorT40=IIf(m_40>0,IIf(m_40>s_40,colorBrightGreen,colorDarkGreen),IIf(m_40<s_40,colorRed,colorDarkRed));
  93. Plot( 23,"",ColorT40, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  94. Plot( 24,"",colorBlack, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  95.  
  96. ColorT80=IIf(m_80>0,IIf(m_80>s_80,colorBrightGreen,colorDarkGreen),IIf(m_80<s_80,colorRed,colorDarkRed));
  97. Plot( 27,"",ColorT80, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  98. Plot( 28,"",colorBlack, /* choose color */styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
  99. _SECTION_END();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement