Universal Trend Trading

Quote from jcl:

Why are you trading a strategy with 6 years drawdown? If this would be really a profitable strategy, you had to trade it about 20 years for a relatively safe profit.

Drawdowns seem to be inevitable on trend following strategies, but they are normally less than a year. The first half of 2011 was indeed no good for trend following, but since Spring 2011 TF makes good profit again:

z2perf.png


This is a compound curve from several different trend following strategies. For some reason, TF is usually less profitable in the first half of a year.

Yeah, this entire thread is pure incompetent bunk.
 
Quote from jcl:


Drawdowns seem to be inevitable on trend following strategies, but they are normally less than a year

Show me a strategy profitable on dozens different markets, over 40 years of data, with drawdown shorter than a year.
 
Quote from luckyputanski:

Show me a strategy profitable on dozens different markets, over 40 years of data, with drawdown shorter than a year.
The strategy with the equity curve posted above trades profitable on 14 different markets. Within the 10 years that I tested it, all drawdowns were shorter than a year. I can show you the algorithm if you want, it's rather simple.

I didn't test it with 40 years data because that would make no sense: trend trading today requires very different strategies than 40 years ago. Even within the 10 years, the parameters must be recalculated every 4 months. The markets change permanently and backtests from 20 or 40 years ago are meaningless.
 
Quote from jcl:

The strategy with the equity curve posted above trades profitable on 14 different markets. Within the 10 years that I tested it, all drawdowns were shorter than a year. I can show you the algorithm if you want, it's rather simple.

I didn't test it with 40 years data because that would make no sense: trend trading today requires very different strategies than 40 years ago. Even within the 10 years, the parameters must be recalculated every 4 months. The markets change permanently and backtests from 20 or 40 years ago are meaningless.

If it's not a secret, post the strategy here. Also, I don't take results from 40 years ago too seriously, but it's good to know that my edge existed back then.
 
Quote from luckyputanski:

If it's not a secret, post the strategy here. Also, I don't take results from 40 years ago too seriously, but it's good to know that my edge existed back then.
It's no secret, I have the code also on my website. It's a general trend trading strategy compound with a long-term and a short-term trend algorithm, and variants with modifications and different time frames. The two basic entry functions are (in lite-C):

Code:
function trend_slow()
{
	var *Price = series(price());
	var *Trend = series(LowPass(Price,optimize(250,100,1000)));
	
	if(valley(Trend)) 
		enterLong();
	else if(peak(Trend)) 
		enterShort();
}

function trend_fast()
{
	var *Price = series(price());
	var TimeFactor	= optimize(1.2,0.25,4);
	var Threshold	= optimize(1.0,0.1,2,0.1);

	int TimePeriod = TimeFactor*DominantPeriod(Price,100);
	var *HP = series(HighPass(Price,TimePeriod));
	var *Signal = series(Fisher(HP,500));
	
	if(valley(Signal) && *Signal < -Threshold) 
		enterLong();
	else if(peak(Signal) && *Signal > Threshold) 
		enterShort();
}

HighPass() and LowPass() are standard 2-pole highpass and lowpass filters, DominantPeriod() is the main cycle of the price curve, Fisher() is the Fisher transform, and peak() and valley() detect peaks and valleys in the series.

The exit functions are a little more lengthy, but the strategy also stays profitable when using a simple stop loss instead.
 
Quote from jcl:

It's no secret, I have the code also on my website. It's a general trend trading strategy compound with a long-term and a short-term trend algorithm, and variants with modifications and different time frames. The two basic entry functions are (in lite-C):

Code:
function trend_slow()
{
	var *Price = series(price());
	var *Trend = series(LowPass(Price,optimize(250,100,1000)));
	
	if(valley(Trend)) 
		enterLong();
	else if(peak(Trend)) 
		enterShort();
}

function trend_fast()
{
	var *Price = series(price());
	var TimeFactor	= optimize(1.2,0.25,4);
	var Threshold	= optimize(1.0,0.1,2,0.1);

	int TimePeriod = TimeFactor*DominantPeriod(Price,100);
	var *HP = series(HighPass(Price,TimePeriod));
	var *Signal = series(Fisher(HP,500));
	
	if(valley(Signal) && *Signal < -Threshold) 
		enterLong();
	else if(peak(Signal) && *Signal > Threshold) 
		enterShort();
}

HighPass() and LowPass() are standard 2-pole highpass and lowpass filters, DominantPeriod() is the main cycle of the price curve, Fisher() is the Fisher transform, and peak() and valley() detect peaks and valleys in the series.

The exit functions are a little more lengthy, but the strategy also stays profitable when using a simple stop loss instead.

Can you post full code in C so I can backtest it?
 
Quote from luckyputanski:

Can you post full code in C so I can backtest it?
This is the C code for a lowpass filter:
Code:
inline var smoothF(int period) { return 2./(period+1); }

var LowPass(var *Data,int Period)
{
	var* LP = series(*Data,3);
	var a = smoothF(Period);
	var a2 = a*a;
	return LP[0] = (a-a2/4)*Data[0]
		+ 0.5*a2*Data[1]
		- (a-0.75*a2)*Data[2]
		+ 2*(1.-a)*LP[1]
		- (1.-a)*(1.-a)*LP[2];
}
The code of the other functions is more lengthy and integrated in the Zorro software, so I can't as easily post it here. But you can get the complete software, it's public domain and available for download on request. It has a backtester. I'm not allowed to post a link here, but you can just PM me.
 
Back
Top