Page 1 of 3

Elder-Rays (Bulls & Bears Power)

PostPosted: Sat Jun 19, 2010 11:09 am
by Apprentice
Bulls And Bears.png
Bulls and Bears


Developed by Dr. Alexander Elder and described in his book “Trading for a Living”.

Consists of three components Bear Power, Bull Power, and a 13-periods exponential moving average.

13-day exponential moving average (EMA) indicate the market consensus of value.
Bull Power measures the ability of buyers to drive prices above the consensus of value.
Bear Power reflects the ability of sellers to drive prices below the average consensus of value.

Use exponential moving average’s slope to determine the market trend direction.

Bull Power = High[period] - EMA [period]
Bear power = Low[period] - EMA [period]

Long
In Uptrend, Bear Power is negative, but rising

Short
In Downtrend, Bull Power is positive, but declining

Bulls.lua
Bulls Power
(1.72 KiB) Downloaded 2658 times

Bears.lua
Bears Power
(1.72 KiB) Downloaded 2547 times

Normalization.lua.png
Normalization

Bulls With Normalization.lua
(3.09 KiB) Downloaded 1033 times

Bears With Normalization.lua
(3.11 KiB) Downloaded 975 times

Re: Elder-Rays (Bulls & Bears Power)

PostPosted: Sat Jun 19, 2010 10:40 pm
by Blackcat2
System that uses this indicator can be found at
http://www.forexfactory.com/showthread.php?t=239951

Re: Elder-Rays (Bulls & Bears Power)

PostPosted: Fri Feb 03, 2012 9:52 pm
by cruiser
please,can we have a strategy for this indicator.These are the conditions:

1.when bear bars are negative and bull bars are positive,no trade executed.
2.when bear bar goes positive and then back to negative(close of another candle),open short trade.
3.when bull bar goes negative and then back to positive(close of another candle),open long trade.

Exit rules for short trade;
1.In condition '2' above when you are short,exit when bear bar goes positive(close of candle) or
2.Exit when condition' 3' is met.

Exit rules for long trade;
1.In condition '3' above when you are long,exit when bull bar goes negative(close of candle) or
2. exit when condition '2' is met.

Many thanks

Re: Elder-Rays (Bulls & Bears Power)

PostPosted: Sat Feb 04, 2012 2:46 am
by Apprentice
Your request is added to the development list.

Re: Elder-Rays (Bulls & Bears Power)

PostPosted: Sun Feb 05, 2012 11:29 am
by Apprentice
Here you can find the first draft.
viewtopic.php?f=28&t=12854
I'm not satisfied.
Can you test this version, check my algorithm.
Or change your definition.

Re: Elder-Rays (Bulls & Bears Power)

PostPosted: Tue Jul 15, 2014 3:17 am
by Apprentice
Bump Up.

Re: Elder-Rays (Bulls & Bears Power)

PostPosted: Thu Jul 17, 2014 8:08 pm
by zmender
Hello Apprentice, long time no see! Glad you are still around.

I'm trying to hard code an EMA/SMA line that calculates the running average of Bulls / Bears but I'm having trouble with the code. Could you help?

I tried to add another stream:

Code: Select all
   BullEMA = core.indicators:create("EMA", Bulls, Frame);

then I tried to add it as a line:

Code: Select all
BullEMA = instance:addStream("BullEMA", core.Line, name, "Averages", instance.parameters.Avg_color, first);


Finally I tried to take the average:

Code: Select all
   BEMA:update(mode);
      BEMA[period] = EMA.Bulls[period];


Obviously this is not working out.

Would you mind spending just a few minutes to add the feature to the oscillator?

Re: Elder-Rays (Bulls & Bears Power)

PostPosted: Fri Jul 18, 2014 11:11 am
by zmender
Apprentice, I thought about it and I'm wondering if you can do me another favor.

Write an indicator that calculates a running sum of the Bull and Bear for a period of n. Then, to confine the sum between -1 and 1, take the fisher transformation of the sum (transformation = 1/2 * ln[(1+sum)/(1-sum)]).

The point of this is that in a trending environment, the sum will be large positive / negative and indicator will approach 1 or -1. Trend following strategies will prevail here.

However in a ranging environment where prices hover about the MA, the upticks will more or less cancel the downticks, resulting in sum close to 0 and the fisher transformation close to 0. Ranging strategies will prevail here.

Re: Elder-Rays (Bulls & Bears Power)

PostPosted: Sat Jul 19, 2014 4:48 am
by Apprentice
Sum / Transformation will be calculated for each component separately?
or as a whole...

Re: Elder-Rays (Bulls & Bears Power)

PostPosted: Sat Jul 19, 2014 12:45 pm
by zmender
First, calculate the sum of bears and bulls for n periods. The integer n is an indicator parameter.
Second, the sum is transformed to bound it between -1and 1.