## Total Power Indicator

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.

### Re: Total Power Indicator

Great work! And I appologise for the long post.

Question: what is the EMA used in the LUA for these calcs for? It makes the Bull/Bear/Power dependent on each other rather than independent of each other.

I would like to adjust Power Period line without causing subsequent changes in values for the Bull/Bear Power lines.

Apparently the EMA impacts a) when Bull/Bear Power lines actually cross based on some averaging (which may be ok) and b) it is influenced by changing the Power Period. This causes the following issue.

When I change Power Period, both the TIME at which, and the VALUE at which the Bull/Bear crosses, is impacted which means all BULL/BEAR Power values are impacted when I change the Power Period?

I understood these calcs/values to be independent.
That is, the Power Period setting would have no impact on the values of BULL/BEAR Power lines.

Shouldn't the Bull/Bear/Power calcs be independent of each other?

Check my example (please) and see if I am mistaken. Try this: Note where a BULL/BEAR cross occurs (both the time and the indicator value and price) using standard TPI settings.

Then make a significant change to the Power Period (double it) and change nothing else.

In my version, both the time and the indicator value (and this the actual instrument price) of the Bull/Bear power cross changes simply when I change the Power Period.

I appologise in advance, if this is expected. But the formulas for the respective lines given above are independent of each other.

Lookback is lookback. 100 is 100. Bear/Bull Counts are Bear/Bull counts. Power Period is Power Period.

I would like to adjust Power Period line without causing subsequent changes in values for the Bull/Bear Power lines. I think this makes more sense. Or am I mistaken?

Humbly,

Patrick
Patrick Sweet

Posts: 72
Joined: Fri Apr 26, 2013 4:23 am

### Re: Total Power Indicator

Bulls/Bears are initial data for the calculation of Power.
and this can not be avoided.
Changes in the two components are passed to Power.
Unrelated, I can make a version that use various moving averages.
With different periods for bulls and bears.

Apprentice
FXCodeBase: Confirmed User

Posts: 22093
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Total Power Indicator

Ok. Thanks.

I understand how Power is built on Bulls/Bears.

Power = Abs (BearCount - BullCount)*100 / Lookback Period;

How does a change in Power period impact Bulls/Bears counts (in this formula)?

BearPower = BearCount*100/ Lookback Period;
BullPower = BullCount*100/Lookback Period ;

The Lua code draws on an EA in a way that I do not understand (which does not make it 'wrong', I just do not understand it and I have no alternative, and no complaints).

I just do not see how changing the Power Period would change Bulls/Bears counts or values, which is why I raise the question...as it would be good to be able to modify the Power Period in an isolated fashion...I believe.

Thanks for listening and your guidance!
Patrick
Patrick Sweet

Posts: 72
Joined: Fri Apr 26, 2013 4:23 am

### Re: Total Power Indicator

1. Power Period or EMA Period is used in the calculation od EMA
and indirectly Bulls and Bears
Code: Select all
`Bulls[period] = source.high[period] - EMA.DATA[period];Bears[period] = source.low[period] - EMA.DATA[period];`

2. Change in EMA, will change the Bulls / Bear Levels,
and indirectly BullCount and BearsCount
Code: Select all
`     if Bulls[i] > 0 then            BullCount=BullCount+1;            end                        if Bears[i] < 0 then            BearCount=BearCount+1;            end`

Apprentice
FXCodeBase: Confirmed User

Posts: 22093
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Total Power Indicator

Thanks. I understand. I naively thought that Bear/Bull power was the result of simple counting and not comparison to an average and that Power peroid was a separate varialb simply comparing bull/bear. That you take the time to clarify some 'dumb' questions is GREATLY appreciated.
Patrick
Patrick Sweet

Posts: 72
Joined: Fri Apr 26, 2013 4:23 am

### Re: Total Power Indicator

Anytime.

Apprentice
FXCodeBase: Confirmed User

Posts: 22093
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Total Power Indicator

The indicator was revised and updated.

Apprentice
FXCodeBase: Confirmed User

Posts: 22093
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Total Power Indicator

Apprentice wrote:
Total Power Indicator.png

Total Power Indicator.lua

Total Power Indicator or Improving Elder Ray Indicator

Power = Abs (BearCount - BullCount)*100 / Lookback Period;
BearPower = BearCount*100/ Lookback Period;
BullPower = BullCount*100/Lookback Period ;

The components of this indicator we get, if we count the Elder Ray Indicator components Within the Lookback Period.

But only if Elder Ray Bull is greater than 0,
and Elder Ray Bear is less than 0

The indicator was revised and updated

Hello,

Thanks!
amvt85

Posts: 18
Joined: Fri May 02, 2014 2:01 pm

### Re: Total Power Indicator

Apprentice
FXCodeBase: Confirmed User

Posts: 22093
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Total Power Indicator

All thanks mate!
amvt85

Posts: 18
Joined: Fri May 02, 2014 2:01 pm

Previous