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.

Moderator: admin

Re: Total Power Indicator

Postby Patrick Sweet » Tue Sep 24, 2013 5:00 am

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

Postby Apprentice » Tue Sep 24, 2013 10:58 am

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

Re: Total Power Indicator

Postby Patrick Sweet » Tue Sep 24, 2013 1:13 pm

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

Postby Apprentice » Wed Sep 25, 2013 4:32 am

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

Re: Total Power Indicator

Postby Patrick Sweet » Fri Sep 27, 2013 3:56 am

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

Postby Apprentice » Thu Jun 22, 2017 6:28 am

The indicator was revised and updated.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 20594
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Total Power Indicator

Postby amvt85 » Mon Feb 04, 2019 11:03 am

Apprentice wrote:
Total Power Indicator.png

Total Power Indicator.lua

Adaptable 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,

Is it possible to add two adjustable levels to "Adaptable Total Power Indicator"?

Thanks!
amvt85
 
Posts: 13
Joined: Fri May 02, 2014 2:01 pm


Re: Total Power Indicator

Postby amvt85 » Tue Feb 05, 2019 4:49 pm

Apprentice wrote:Added.


All thanks mate!
amvt85
 
Posts: 13
Joined: Fri May 02, 2014 2:01 pm

Previous

Return to Custom Indicators

Who is online

Users browsing this forum: No registered users and 17 guests