Advertisement
saisri

demark ob os ind

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