Requests & Ideas - page 114

 

How to "Weight" an indicator value along all time frames...

Hi everybody,

I've not a math PhD so I'm looking for help of somebody that "chew" math like eating popcorn in front of the TV...

I'm trying to develop a sort of "directional trend strength analyzer" that monitor all time frames from M1 to W1 with 3 indicators; I can assign to each indicator a "trend score (TS)" value from -n to +n (related to the reading of the indicator itself); now I'm able to establish the "single time frame trend score (STFTS)", for example simply adding the trend score values of each indicator: STFTS_M1 = TS1_M1 + TS2_M1 + TS3_M1; STFTS_M5 = TS1_M5 + TS2_M5 + TS3_M5 ....... STFTS_W1 = TS1_W1 + TS2_W1 + TS3_W1.

My real problem is to find a correct method (aka formula or algorithm...) to give a proper "weight" to each STFTS, to calculate the "total trend score (TTS)", related to the time frame of the chart where the indicator will be applied.

In detail: I could (in example) just sum all the STFTS, then divide by the number of time frames and I'll get a "simple average" (TTS = (STFTS_M1 + STFTS_M5 +........ STFTS_W1)/8) of the TTS.

Well, this data is not really helpful 'cause, in this way, each time frame contribute to the overall, with the same "power" or "weight" so to speak... therefore if you apply this kind of calculation you'll have the same value for the TTS no matter which time frame of the chart the indicator is applied to; my goal is to find a way to give a "weighted" power for each STFTS related to the time frame of the chart where the analyzer is applyed to.

So if I do apply the analyzer to a M15 chart for example, I want to calculate the TTS giving more weight to the neighbor time frames and less to the far away; something like: TTS_M15 = (STFTS_M1(80%) + STFTS_M5(90%) STFTS_M15(100%) + STFTS_M30(80%) + STFTS_H1(60%) + STFTS_H4(40%) + STFTS_D1(20%) + STFTS_W1(10%))/8 ; or if I apply the analyzer to a 4H chart something like: TTS_H4 = (STFTS_M1(5%) + STFTS_M5(10%) STFTS_M15(15%) + STFTS_M30(20%) + STFTS_H1(40%) + STFTS_H4(100%) + STFTS_D1(70%) + STFTS_W1(30%))/8; trying to get a better "responsiveness" of the indicator itself; sort of adaptivity of the analyzer (as paragon like an exponential moving average that give more "importance" to the recent values respect to the oldest, but the exponential calculation cannot be applied in this case...).

Somebody out there might be so kind to help me to find out how to properly calculate the percentage that has to be applied to the "single time frame trend score"????

Thanks to anybody that did spent 2 precious minutes of his own life reading this delirant post

Best Regards

brax

 

Brownian motion

brax64:
Hi everybody,

I've not a math PhD so I'm looking for help of somebody that "chew" math like eating popcorn in front of the TV...

I'm trying to develop a sort of "directional trend strength analyzer" that monitor all time frames from M1 to W1 with 3 indicators; I can assign to each indicator a "trend score (TS)" value from -n to +n (related to the reading of the indicator itself); now I'm able to establish the "single time frame trend score (STFTS)", for example simply adding the trend score values of each indicator: STFTS_M1 = TS1_M1 + TS2_M1 + TS3_M1; STFTS_M5 = TS1_M5 + TS2_M5 + TS3_M5 ....... STFTS_W1 = TS1_W1 + TS2_W1 + TS3_W1.

My real problem is to find a correct method (aka formula or algorithm...) to give a proper "weight" to each STFTS, to calculate the "total trend score (TTS)", related to the time frame of the chart where the indicator will be applied.

In detail: I could (in example) just sum all the STFTS, then divide by the number of time frames and I'll get a "simple average" (TTS = (STFTS_M1 + STFTS_M5 +........ STFTS_W1)/8) of the TTS.

Well, this data is not really helpful 'cause, in this way, each time frame contribute to the overall, with the same "power" or "weight" so to speak... therefore if you apply this kind of calculation you'll have the same value for the TTS no matter which time frame of the chart the indicator is applied to; my goal is to find a way to give a "weighted" power for each STFTS related to the time frame of the chart where the analyzer is applyed to.

So if I do apply the analyzer to a M15 chart for example, I want to calculate the TTS giving more weight to the neighbor time frames and less to the far away; something like: TTS_M15 = (STFTS_M1(80%) + STFTS_M5(90%) STFTS_M15(100%) + STFTS_M30(80%) + STFTS_H1(60%) + STFTS_H4(40%) + STFTS_D1(20%) + STFTS_W1(10%))/8 ; or if I apply the analyzer to a 4H chart something like: TTS_H4 = (STFTS_M1(5%) + STFTS_M5(10%) STFTS_M15(15%) + STFTS_M30(20%) + STFTS_H1(40%) + STFTS_H4(100%) + STFTS_D1(70%) + STFTS_W1(30%))/8; trying to get a better "responsiveness" of the indicator itself; sort of adaptivity of the analyzer (as paragon like an exponential moving average that give more "importance" to the recent values respect to the oldest, but the exponential calculation cannot be applied in this case...).

Somebody out there might be so kind to help me to find out how to properly calculate the percentage that has to be applied to the "single time frame trend score"????

Thanks to anybody that did spent 2 precious minutes of his own life reading this delirant post

Best Regards

brax

Brax,

No need to chew math like eating popcorn in front of a tv ...Yours is not a math problem but a conceptual problem.

Basically you are asking...What equalizes timeframes? Answer:Brownian motion.

In practical terms,you can use the ATR relative ratios.

Just to help you visualize the process,Let´s say you want to add just M15 and H1

During the last trading hour,ATR(1) for H1,let´s say is 50 pips...you can be sure that ATR(4) for M15 has been 50/square root of 4=25 ....So during THAT hour you shoud have weighted H1 input with double value than M15 input,and,you know?Thanks to brownian motion,no matter what atr you have the next hour,the ratio between H1 and m15 will always be 2(+- rounding) .

The ratios would go like this(you can adjust for the exact number of hours,minutes,etc,depending on Sunday trading or not,etc)

W1=X

D1=X/SQRT5= X/2.236...0.4472X

H4=X/SQRT30=X/5.477...0.1826X

H1=X/SQRT180=X/13.416....0.0745X

M30=X/SQRT360=X/18.974...0.0527X

M15=X/SQRT720=X/26.833....0.0373X

M5=X/SQRT2160=X/46.476....0.0215X

M1=X/SQRT10800=X/103.923...0.0096X

Where X=ATR(1) of W1,but you don´t need it,you already have the relative timeframe weights.

Suggestion:I would use 2 composites,one for trend(W1+D1+H4) and the other for timing(H1 to M1) in trend´s direction,2 reasons for this:1-the small relative weight of H1 and below on the total...2-Trader´s behaviour seems to be scinded between those that use H4 and higher(or D1 and Higher) , those that just look to H1 and below and thos ethat us ethe higher tfs for trend and the lower tfs for timing,which is what I suggest

Regards

S

 

TVI histo

Hello I've seen an TVI volume indy in elite section with a line in the window this one here I found is a non repainting histo version perhaps I've missed something in my search here but if there isn't one that already exists can someone direct me to a mtf,interpolate,adaptive lookback,divergence version,basically is there a bells and whistles version for tvi histo ,if not please address this,thanks pipsqueaks!

Files:
tvi_v2.mq4  9 kb
 

Hi Simba,

really thank for your time, your explanation make lots of sense; I'll try to apply the concept and if I'll come up with something interesting I'll post it...

Curiosity; as far as you know there is already out there some indicators that's using a similar approach?

Thank again and

Best Regards

brax

SIMBA:
Brax,

No need to chew math like eating popcorn in front of a tv ...Yours is not a math problem but a conceptual problem.

Basically you are asking...What equalizes timeframes? Answer:Brownian motion.

......

......

S

 

Blau tick volume indicator ...

Here is a multi time frame version for now It is not the one you posted, but I think it will do (values are the same as the one you posted, since the parameters are set to be the same) One observation though. It is not a tick volume indicator but a signal line of an Ergodic tvi indicator (tvi itself lacks the final 5 period smoothing) Also, original Blau ergodic tvi is calculated as 32,5,5 periods, but I kept the default parameters from the one you posted

Maxwell10:
Hello I've seen an TVI volume indy in elite section with a line in the window this one here I found is a non repainting histo version perhaps I've missed something in my search here but if there isn't one that already exists can someone direct me to a mtf,interpolate,adaptive lookback,divergence version,basically is there a bells and whistles version for tvi histo ,if not please address this,thanks pipsqueaks!
Files:
 

You Da Man!

thanks this will do, Much love and respect mladen!

 
brax64:
Hi Simba,

really thank for your time, your explanation make lots of sense; I'll try to apply the concept and if I'll come up with something interesting I'll post it...

Curiosity; as far as you know there is already out there some indicators that's using a similar approach?

Thank again and

Best Regards

brax

Brax,

Not that I know.

Please notice that while the weight is biased,as it should, towards the higher tfs,the concept may allow enough responsiveness provided by the lower tfs.

For example,to follow with the simple example for aggregation of H1 and M15 during 1 hour the H1 will be weighted double than the m15,but there will be 4 counts for the m15 value.

Presume a downtrend and your n=10 so both m15 and h1 are at -10 and your composite signals -30...then a reversal starts,at 00:15,H1 will still signal -10,while M15 signals +5(for example),so your composite signals -15,then at 00:30 m15 signals +10,so,now you can do 2 things:either design your composite to signal -10(10+2*-10) or to "accumulate" the m15 signals so that the total for M15-during that hour is now+15,and in this case the composite should signal 15+2*-10=-5.....

I don´t know which of the 2 alternative would be better,but it will be very interesting to test both of them.Of course,if you use all timeframes between h1 and m15 there is no need to accumulate,in the example above at 00:30 you would have gotten-for example- an m30 +5 so that you have H1=2*-10=-20...M15=+10...M30=1.4142*5=7(rounded)...and the composite would be at -3...I presume that using all the tfs between A and B implies there is no need to accumulate.

S

 

Hi Simba

thaks a lot for your precious input; I didn't apply your method yet because I was still testing the first idea that I had to weight the time frames as follow:

if(Period() == PERIOD_M1){

TST = (TS0 + TS1*1/5 + TS2*1/15 + TS3*1/30 + TS4*1/60 + TS5*1/240 + TS6*1/1440 + TS7*1/10080);

coeff = ( 6 + 6*1/5 + 6*1/15 + 6*1/30 + 6*1/60 + 6*1/240 + 6*1/1440 + 6*1/10080);}

if(Period() == PERIOD_M5){

TST = (TS0*1/5 + TS1 + TS2*1/3 + TS3*1/6 + TS4*1/12 + TS5*1/48 + TS6*1/288 + TS7*1/2016);

coeff = ( 6*1/5 + 6 + 6*1/3 + 6*1/6 + 6*1/12 + 6*1/48 + 6*1/288 + 6*1/2016);}

if(Period() == PERIOD_M15){

TST = (TS0*1/15 + TS1*1/3 + TS2 + TS3*1/2 + TS4*1/4 + TS5*1/16 + TS6*1/64 + TS7*1/672);

coeff = ( 6*1/15 + 6*1/3 + 6 + 6*1/2 + 6*1/4 + 6*1/16 + 6*1/64 + 6*1/672);}

if(Period() == PERIOD_M30){

TST = (TS0*1/30 + TS1*1/6 + TS2*1/2 + TS3 + TS4*1/2 + TS5*1/8 + TS6*1/32 + TS7*1/336);

coeff = ( 6*1/30 + 6*1/6 + 6*1/2 + 6 + 6*1/2 + 6*1/8 + 6*1/32 + 6*1/336);}

if(Period() == PERIOD_H1){

TST = (TS0*1/60 + TS1*1/12 + TS2*1/4 + TS3*1/2 + TS4 + TS5*1/4 + TS6*1/24 + TS7*1/168);

coeff = ( 6*1/60 + 6*1/12 + 6*1/4 + 6*1/2 + 6 + 6*1/4 + 6*1/24 + 6*1/168);}

if(Period() == PERIOD_H4){

TST = (TS0*1/240 + TS1*1/48 + TS2*1/16 + TS3*1/8 + TS4*1/4 + TS5 + TS6*1/6 + TS7*1/42);

coeff = ( 6*1/240 + 6*1/48 + 6*1/16 + 6*1/8 + 6*1/4 + 6 + 6*1/6 + 6*1/42);}

if(Period() == PERIOD_D1){

TST = (TS0*1/1440 + TS1*1/288 + TS2*1/96 + TS3*1/48 + TS4*1/24 + TS5*1/6 + TS6 + TS7*1/7);

coeff = ( 6*1/1440 + 6*1/288 + 6*1/96 + 6*1/48 + 6*1/24 + 6*1/6 + 6 + 6*1/7);}

if(Period() == PERIOD_W1){

TST = (TS0*1/10080 + TS1*1/2016 + TS2*1/672 + TS3*1/336 + TS4*1/168 + TS5*1/42 + TS6*1/7 + TS7);

coeff = ( 6*1/10080 + 6*1/2016 + 6*1/672 + 6*1/336 + 6*1/168 + 6*1/42 + 6*1/7 + 6);}

percent = MathRound(TST / coeff * 100);

where "TST" is the total trend score and the "coeff" is the maximum value that the TST can reach, needed to determinate the percentage; my "n" is +6/-6. Basically I'm assuming 100% the trend score of the active time frame and assign the value for the others multiplied by 1/bars.

Honestly I don't know if this approach is baked by a "mathematical mean", but seems to work not really bad; visually I can see that the indicator is quite responsive in the lowest time frames and smooth in the highest.

During the weekend I'll try to apply your concept with the 2 options you proposed and I'll let you know how it works.

Best Regards

brax

SIMBA:
Brax,

Not that I know.

Please notice that while the weight is biased,as it should, towards the higher tfs,the concept may allow enough responsiveness provided by the lower tfs.

.....

....

...

S
 

Moving Averages 3.0 aka NMA...

Hi Mladen,

after reading the last IFTA journal (thanks for the link !), the article about this new type of average stimulate my curiosity; without rush could you please have a look at that and create the indicator? Also seem interesting the applications based on this new type of averages (the digitized Aroon oscillator and the Stochastic-RSI applied to a NWMA).

Thank a zillion for your help

Have a nice weekend!

brax

Files:
ma3.0.pdf  1343 kb
 

Can any please refer to to an indicator that uses "angle", or pass onto me a routine for "angle" of an indicator.

I would really appreciate it.

Regards

gorick

Reason: