//@Name:Elder-Ray Bear Power //@Description:From Alexander Elder's book: Trading for a Living // Buy if trend is up i.e. the 13 day EMA is increasing // + Bear Power (lower line) is negative but rising // + (desirable) Latest peak in Bull Power is higher than previous peak // + (desirable) Bear power is rising from a bullish divergence // Sell signal is the reverse // See 'Trading for a Living' for more details // Care has been taken in preparing this code but it is provided without guarantee. // You are welcome to modify and extend it. Please add your name as a modifier if you distribute it. // Modified by Kenny Halley to set chart to histogram and show Bull power and Bear power in separate graphs as per the book- this is Bear Power function init() { setTitle("Elder-Ray Bear Power"); setSeriesColour(0, Colour.Red); setSeriesLineStyle(0, Pen.Solid, 1); setRange(Range.CentreZero); setHorizontalLine(0); //Added by Kenny Halley to set chart to histogram setSeriesChartType( 0, ChartType.Histogram); } function getGraph(share, data) { var period=13; var BearPower = new Array(); var ma1 = new MA(period, MA.Exponential); for (var i=0; i