Log in to see Cloud of Tags

Wealth-Lab Wiki

TTF - Trend Trigger Factor

RSS

Syntax

public TTF(Bars ds, int period, string description) public static TTF Series(Bars ds, int period) public static double Value(int bar, Bars ds, int period)

Parameter Description

Bars The symbol's Bars object
period Indicator period

Description

Trend Trigger Factor from the December 2004 issue of Stocks & Commodities magazine.

TTF provides an indication of trend direction by measuring the differences between the highest high and lowest low of the current and previous Periods; arriving at an oscillatory-type indicator whose value exceeds 100 when an uptrend is confirmed and -100 for a downtrend. Using TTF alone for entries and exits will subject a trading system to frequent whipsaws for non-trending markets.

Example

Here's the basic system from the magazine article.

using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using TASCIndicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { const int period = 15; DataSeries ttf = TTF.Series(Bars, period); ChartPane cp = CreatePane( 40, true, true ); DrawHorzLine(cp, 100, Color.Gray, LineStyle.Dotted, 1); DrawHorzLine(cp, -100, Color.Gray, LineStyle.Dotted, 1); PlotSeries(cp, ttf, Color.Blue, LineStyle.Solid, 2); HideVolume(); for (int bar = period; bar < Bars.Count; bar++) { switch ((int)MarketPosition) { case 1: if( CrossUnder(bar, ttf, -100) ) { SellAtMarket(bar + 1, LastPosition); ShortAtMarket(bar + 1); } break; case -1: if( CrossOver(bar, ttf, 100) ) { CoverAtMarket(bar + 1, LastPosition); BuyAtMarket(bar + 1); } break; default: if( CrossOver(bar, ttf, 100) ) BuyAtMarket(bar + 1); else if( CrossUnder(bar, ttf, -100) ) ShortAtMarket(bar + 1); break; } } } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.