Elder-Rays (Bulls & Bears Power)

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Elder-Rays (Bulls & Bears Power)

Postby Apprentice » Sat Jun 19, 2010 11:09 am

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 1916 times

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

Normalization.lua.png
Normalization

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

Bears With Normalization.lua
(3.11 KiB) Downloaded 335 times
Last edited by Apprentice on Sun Jun 20, 2010 3:48 am, edited 1 time in total.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 18974
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Elder-Rays (Bulls & Bears Power)

Postby Blackcat2 » Sat Jun 19, 2010 10:40 pm

System that uses this indicator can be found at
http://www.forexfactory.com/showthread.php?t=239951
Blackcat2
FXCodeBase: Initiate
 
Posts: 118
Joined: Wed May 19, 2010 12:42 am

Re: Elder-Rays (Bulls & Bears Power)

Postby cruiser » Fri Feb 03, 2012 9:52 pm

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
cruiser
 
Posts: 8
Joined: Fri Jul 29, 2011 2:20 am

Re: Elder-Rays (Bulls & Bears Power)

Postby Apprentice » Sat Feb 04, 2012 2:46 am

Your request is added to the development list.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 18974
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Elder-Rays (Bulls & Bears Power)

Postby Apprentice » Sun Feb 05, 2012 11:29 am

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.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 18974
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Elder-Rays (Bulls & Bears Power)

Postby Apprentice » Tue Jul 15, 2014 3:17 am

Bump Up.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 18974
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Elder-Rays (Bulls & Bears Power)

Postby zmender » Thu Jul 17, 2014 8:08 pm

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?
zmender
 
Posts: 43
Joined: Thu Nov 10, 2011 11:00 pm

Re: Elder-Rays (Bulls & Bears Power)

Postby zmender » Fri Jul 18, 2014 11:11 am

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.
zmender
 
Posts: 43
Joined: Thu Nov 10, 2011 11:00 pm

Re: Elder-Rays (Bulls & Bears Power)

Postby Apprentice » Sat Jul 19, 2014 4:48 am

Sum / Transformation will be calculated for each component separately?
or as a whole...
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 18974
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Elder-Rays (Bulls & Bears Power)

Postby zmender » Sat Jul 19, 2014 12:45 pm

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.
zmender
 
Posts: 43
Joined: Thu Nov 10, 2011 11:00 pm

Next

Return to Custom Indicators

Who is online

Users browsing this forum: Bing [Bot] and 14 guests