NexusFi: Find Your Edge


Home Menu

 





Trend Thrust Indicator (TTI)


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 8 posts (36 thanks)
    2. looks_two Virtuose1 with 5 posts (1 thanks)
    3. looks_3 wldman with 1 posts (0 thanks)
    4. looks_4 DavidHP with 1 posts (1 thanks)
    1. trending_up 13,859 views
    2. thumb_up 38 thanks given
    3. group 3 followers
    1. forum 14 posts
    2. attach_file 8 attachments




 
Search this Thread

Trend Thrust Indicator (TTI)

  #1 (permalink)
 
Virtuose1's Avatar
 Virtuose1 
Montreal, Qc, Canada
 
Experience: Advanced
Platform: NinjaTrader 7
Broker: Interactive Brokers
Trading: ETF
Posts: 58 since Jun 2011
Thanks Given: 142
Thanks Received: 41

Hello,

I was wondering if anyone has coded the Trend Thrust Indicator (TTI) bu Buff Pelz Dormeier for NinjaTrader. The indicator is described in his book "Investing with Volume Analysis" and in an article in the August 2011 edition of TAS&C. The code has been provided in easyLanguage (attached) which would be very easy to translate in C# by a good programmer (which I'm not...)

Thanks

Attached Files
Elite Membership required to download: TTI easyLanguage code.txt
Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
Battlestations: Show us your trading desks!
26 thanks
The Program
18 thanks
  #2 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,609 since Aug 2009
Thanks Given: 11,327
Thanks Received: 2,743

This indicator is also called the "Buff Spread" or "Buff Spreader"
It was written up in the August issue of S&C.

It is the bottom indicator on the attached image
FWIW

Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Attached Thumbnails
Click image for larger version

Name:	Dormeier_Fig1.gif
Views:	633
Size:	32.8 KB
ID:	122848  
Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



Virtuose1 View Post
Hello,

I was wondering if anyone has coded the Trend Thrust Indicator (TTI) bu Buff Pelz Dormeier for NinjaTrader. The indicator is described in his book "Investing with Volume Analysis" and in an article in the August 2011 edition of TAS&C. The code has been provided in easyLanguage (attached) which would be very easy to translate in C# by a good programmer (which I'm not...)

Thanks

The Easy Language code was indeed provided by Dormeier and can be retrieved from technical.traders.com.

The code for the Trend Thrust Indicator accesses an additional function BD.VWMA, which you did not include with your file. The full code is shown below.


 
Code
inputs: price(close), Fastlen(12), Slowlen(26), W(9), volToday(true);
variables: fastavg(0), slowavg(0), sprd(0), avgsprd(0), sLOW(0), vavg(0), FAST(0),
           Vfactor(0), IVfactor(0), m(0), sprdiff(0), mcad(0), VD(0);
fastavg = bd.vwma(Price, FastLen, volToday);
slowavg = bd.vwma(Price, slowLen, volToday);
m = xaverage(close, fastlen) - xaverage(close, slowlen);

if xaverage(volume,slowlen) <> 0 then 
	Vfactor = (bd.vwma(volume,fastlen,voltoday)/xaverage(volume,slowlen))*10;
if xaverage(volume,fastlen) <> 0 then 
	IVfactor = (bd.vwma(volume,slowlen,voltoday)/xaverage(volume,fastlen))*10;
if ivfactor <> 0 and vfactor <> 0 then 
	FAST = FASTAVG/(VFACTOR/IVFACTOR);
if ivfactor <> 0 and vfactor <> 0 then 
	SLOW = (IVFACTOR/VFACTOR)* SLOWavg;

sprd = (fast - slow);
Vavg = BD.VWMA (vfactor,fastlen,voltoday)/xaverage (ivfactor,slowlen) *W;

avgsprd = round (bd.vwma(sprd,vavg,voltoday),3);

sprdiff = (sprd - avgsprd);
mcad = xaverage((m),(w));

vd = sprdiff-mcad;

plot1 (sprd, "sprd");
plot2 (avgsprd, "avg sprd");
plot3 (vd, "Buff diff");

VWMA function (volume-weighted simple moving average)

[LegacyColorValue = true];

{***************************************************************************************
// fileName: BD.VWMA
// Logic by Buff Dormeier
// Programming code written by:
     Fred G. Schutzman, CMT
     27 Briarwood Drive
     New City, NY 10956
     Tel: (914) 634-2978
     Fax: (914) 634-1890
     Email: [email protected]
     Internet: www.fredschutzman.com
// Function returns a Volume Weighted SMA
// futures volume is always reported 1-day late
// therefore, this function has the ability to calculate a MA with an offset of 1
// Date last changed: January 30, 2000

****************************************************************************************}

Inputs: price(numericSeries),   { data to be averaged; e.g. close }
        length(numericSimple),  { length of moving average }
        volToday(trueFalse);    { true = volume is available for today (e.g. stocks)
                                  false = volume is NOT available for today (e.g.futures) }

Vars: beg(0),		{ days back to begin working with for average }
      sumOfVol(0),	{ sum of volume }
      vwPx(0),		{ volume weighted price }
      vwMa(0),		{ volume weighted moving average }
      counter(0);	{ counter }

{ initialize/reset first 4 variables }
if currentBar = 1 then begin
	if volToday = true then
		beg = 0
	else if volToday = false then
		beg = 1;
end;
sumOfVol = 0;
vwPx = 0;
vwMa = 0;

{ update sumOfVol variable on each bar }
for counter = beg to (length-1+beg) begin
	sumOfVol = sumOfVol + volume[counter];
end;

{ update vwPx and vwMa variables on each bar }
for counter = beg to (length-1+beg) begin
	if sumOfVol > 0 then
		vwPx = price[counter] * volume[counter] / sumOfVol;
	vwMa = vwMa + vwPx;
end;

{ return the VWMA if enough data is present, else return 0 }
if length >= 1 and volume[length-1+beg] > 0 then
	BD.VWMA = vwMa
else
	BD.VWMA = 0;

As this is an authorized version of the TTI, it should be easy to translate it to NinjaTrader.

Reply With Quote
Thanked by:
  #4 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

I am a bit annoyed by the Easy Language code that has been published for the TTI.

There are a few points that I do not yet understand.


(1) The calculation of FAST and SLOW is peculiar.
 
Code
FAST = FAST = FASTAVG/(VFACTOR/IVFACTOR);

SLOW = (IVFACTOR/VFACTOR)* SLOWavg;

Multiplying by IVFACTOR/VFACTOR should be the same as dividing by VFACTOR/IVFACTOR. The way the code is written does not make sense.

(2) Vavg is calculated as the volume weighted moving average of the DataSeries vfactor, which itself is a ratio of the values of two moving averages. vavg is then used as an input variable for the length of a moving average. This would require an integer, however vavg is a ratio of type double.

The code is not really clean, but shows quite a degree of (voluntary?) negligence.

Any comments appreciated.

Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

The Trend Thrust Indicator has been clearly developed for daily data and should not be used with full session intraday data. The reason is its heavy reliance on volume data. Intraday volume data is pretty low during the night session and shows a specific smile during the regular session with higher volume during the the initial and the last hour of trading. The indicator cannot cope with this volume distribution. It might be worth developing a gapless version for use with the regular session.

In such a case it makes sense to replace volume with range. For use with intraday data it is possible to try the following approach:

-> calculate a MACD from a range weighted moving average
-> reinforce dependence on range by using a multiplier
-> compare outcome to traditional MACD

Meanwhile, I have a working version of the original TTI, but it should only be applied to daily data or with some restrictions (holidays need to be eliminated) to regular session data, see charts below.









Reply With Quote
  #6 (permalink)
 
Virtuose1's Avatar
 Virtuose1 
Montreal, Qc, Canada
 
Experience: Advanced
Platform: NinjaTrader 7
Broker: Interactive Brokers
Trading: ETF
Posts: 58 since Jun 2011
Thanks Given: 142
Thanks Received: 41

Thanks a lot Fat Tails. Would you mind sharing your version of the TTI indicator ?

Started this thread Reply With Quote
  #7 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


Virtuose1 View Post
Thanks a lot Fat Tails. Would you mind sharing your version of the TTI indicator ?

Of course I will share it, but first I have to review it again. I am not satisfied with the result, as there are a few problems, such as

-> inconsistencies in the code (see post # 4)
-> inconsistencies in the concept (why is the VWMA not compared to a SMA but to an EMA?)
-> problems with application of the indicator to intraday data

I first want to understand the concept and the problems related to the application of the concept, before I release an indicator to the public.

Nobody else has made a comment on the code so far, so I am currently discussing the matter with myself.

Reply With Quote
  #8 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,507 since Aug 2011
Thanks Given: 2,046
Thanks Received: 9,491

Well then @Fat Tails you are in great company. I miss chatting. Perhaps we schedule a skype some time. Dan

Visit my NexusFi Trade Journal Reply With Quote
  #9 (permalink)
 
Virtuose1's Avatar
 Virtuose1 
Montreal, Qc, Canada
 
Experience: Advanced
Platform: NinjaTrader 7
Broker: Interactive Brokers
Trading: ETF
Posts: 58 since Jun 2011
Thanks Given: 142
Thanks Received: 41


Fat Tails View Post
Of course I will share it, but first I have to review it again. I am not satisfied with the result, as there are a few problems, such as

-> inconsistencies in the code (see post # 4)
-> inconsistencies in the concept (why is the VWMA not compared to a SMA but to an EMA?)
-> problems with application of the indicator to intraday data

I first want to understand the concept and the problems related to the application of the concept, before I release an indicator to the public.

Nobody else has made a comment on the code so far, so I am currently discussing the matter with myself.

Re: "inconsistencies in the code (see post # 4)": I think the formula are mathematically accurate. It is just a bit weird that the author didn't use a consistent way to document them. He should have used:
FAST = FASTAVG/(VFACTOR/IVFACTOR);
SLOW = SLOWAVG/(VFACTOR/IVFACTOR);

Re: "Inconsistencies in the concept": I looked at the code again but sorry, can't find the EMA comparison you're referring to.

Re: "Intraday": I see your point and agree with the potential limitations of using this indicator on intraday data because of the typical patterns (e.g.: low volume over lunch time). I could not find reference in Buff's book about using it for intraday. Having said that, I think that it might still work assuming we use either very long or very short periods as parameters for the Slow/Fast.

Started this thread Reply With Quote
  #10 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



Virtuose1 View Post
Re: "Inconsistencies in the concept": I looked at the code again but sorry, can't find the EMA comparison you're referring to.

If you look at the definition of VFactor and IVFactor

 
Code
Vfactor = (bd.vwma(volume,fastlen,voltoday)/xaverage(volume,slowlen))*10;
IVfactor = (bd.vwma(volume,slowlen,voltoday)/xaverage(volume,fastlen))*10;


you will note that in both formulae the enumerator is a volume-weighted moving average VWMA, while the denominator is an exponential moving average. As the VWMA is based on a simple moving average, a simple moving average should be used for the denominator as well. Compared to the simple moving average, the exponential moving average gives more weight to the more recent data points, which sort of intermingles with the volume weighting of the VWMA.

Reply With Quote
Thanked by:




Last Updated on September 21, 2013


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts