Advertisement
saisri

DEMARK OB OS IND WITH CMP

Jul 16th, 2012
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. _SECTION_BEGIN("CMP");
  2. GfxSelectFont("arial", 13, 700 ); GfxSetBkMode( colorBlue );
  3. GfxSetTextColor( ParamColor("Color",colorBlue) );
  4. Hor=Param("Horizontal Position",120,10,1200,1);
  5. Ver=Param("Vertical Position",185,100,50,50);
  6. GfxTextOut(""+C,Hor , Ver );
  7.  
  8.  
  9. _SECTION_END();
  10.  
  11. _SECTION_BEGIN("demark from ami library");
  12.  
  13.  
  14. // The DeMarker indicator is an attempt to overcome the shortcomings of classical overbought / oversold indicators.
  15. //The DeMarker Indicator identifies potential price bottoms and tops.
  16. //It accomplishes this by making price comparisons from one bar to the next and measuring the level of price demand.
  17. //For more information please check AmiBroker Tips newsletter <a href="http://www.amibroker.com/newsletter/02-2000.html">Issue 2/2000</a>
  18.  
  19.  
  20. /*
  21. ** Tom Demark's DeMarker Indicator
  22. ** AFL Implementation by Tomasz Janeczko
  23. */
  24.  
  25.  
  26. MaxGraph=3;
  27.  
  28. highm = IIf( H > Ref( H, -1 ), H - Ref( H, - 1), 0 );
  29. lowm = IIf( L < Ref( L, -1 ), Ref( L, - 1 ) - L, 0 );
  30.  
  31. DeMarker = 100 * Sum( highm, 13 )/( Sum( lowm, 13 ) + Sum( highm, 13 ) );
  32.  
  33. Graph0 = DeMarker;
  34.  
  35. Plot(80,"",colorRed,styleLine+styleDots,maskAll);
  36. Plot(20,"",colorGreen,styleLine+styleDots,maskAll);
  37.  
  38.  
  39. Buy = DeMarker<20; Sell = DeMarker>80;
  40.  
  41. buyshape = Buy * shapeUpArrow; SellShape = Sell * shapeDownArrow;
  42. PlotShapes(BuyShape, colorGreen, 0); PlotShapes(SellShape, colorRed, 0);
  43.  
  44.  
  45. Filter=Buy OR Sell;
  46. AddColumn( Buy, "Buy", 1);
  47. AddColumn(Sell, "Sell", 1);
  48. AddColumn(Close,"Close",1.2);
  49. AddColumn(Volume,"Volume",1.0);
  50.  
  51. Title=EncodeColor( colorDarkTeal ) + " - {{INTERVAL}} {{DATE}}: "+">>>>"+Name() +">>>>"+ " DeMark from thomasz =="+ EncodeColor( colorGreen )+WriteVal(( Graph0 ));
  52.  
  53. ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
  54. SetChartBkColor(ParamColor("Outer panel color ",colorWhite)); // color of outer border
  55. SetChartBkGradientFill( ParamColor("Inner panel color upper half",colorPink),ParamColor("Inner panel color lower half",colorCustom1)); // color of inner panel
  56.  
  57. // The DeMarker indicator is an attempt to overcome the shortcomings of classical overbought / oversold indicators.
  58. // The DeMarker Indicator identifies potential price bottoms and tops.
  59. //It accomplishes this by making price comparisons from one bar to the next and measuring the level of price demand.
  60. //DeMarker should be interpreted as other overbought / oversold indicators such as RSI with the levels of 30 and 70.
  61. //Compared to RSI it is smoother but still able to detect tops and bottoms a little bit better.
  62. _SECTION_END();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement