Minimum trades for a system to be reliable?

Posted By: ibra

Minimum trades for a system to be reliable? - 01/20/14 09:34

Hey,

The thought occured to me while I was coding a simple crossover strategy. As the timeframe is 1440(daily) the strategy enters only 89 trades during the period (2002-2013). I'm worried that it's not enough for me to "trust" the result.

What's your opinion about this?
Posted By: jcl

Re: Minimum trades for a system to be reliable? - 01/20/14 15:08

It depends on the degrees of freedom - the number of free parameters - of your system. As a rule of thumb, you should have more than 30, preferably about 100 trades per degree of freedom for a result of significance.
Posted By: ibra

Re: Minimum trades for a system to be reliable? - 01/21/14 10:34

Hi!

Originally Posted By: jcl
It depends on the degrees of freedom - the number of free parameters - of your system. As a rule of thumb, you should have more than 30, preferably about 100 trades per degree of freedom for a result of significance.


Would be deeply grateful if you could explain that with an example. I looked it up in Trading Systems by Tomasini and Jaekle. But I'm not sure if I got it right.

And since the WFO-window is a couple of years shorter, there will be a lot less trade. I guess this is "normal, but how does the minimum requirment looks for WFO?

Also, do you think it's wise to keep number of trades above a ceratin level per year. Let's say 10? A moving average crossover-system doesn't give too many signals per year, what I can tell.



Thanks
Posted By: jcl

Re: Minimum trades for a system to be reliable? - 01/21/14 13:12

For example, when you open and close positions when two moving averages cross, you have a system with 2 degrees of freedom - the time periods of the two moving averages.

Not having enough trades is indeed a common problem when developing systems. You can increase the number of trades with methods such as oversampling, but it helps only to a certain degree. A system with only 10 trades per year has a large margin of error.
Posted By: dusktrader

Re: Minimum trades for a system to be reliable? - 01/21/14 13:37

Thanks for this info about "degrees of freedom" jcl. I never looked at it that way before but it makes sense and gives a good rule-of-thumb I think.

Another way to increase # of trades is to reduce the BarPeriod/TimeFrame. That is one reason I've chosen to focus on smaller timeframes, even though I know they may be overall less profitable. I think it is also a balance of risk, because while higher timeframes may equate to better profit and accuracy, it may also increase risk by holding positions open longer. I would prefer to take profit off the table in smaller increments, repeatedly.

@ibra here is a code snippet that I use that warns you when your script produces less than the desired # of trades, and will stop training your script in that case:
Code:
function checkTradesPerCycle()
{
	//require minimum 30 trades per WFO cycle or stop training
	static int LastWFOCycle = 0, LastNumTrades = 0;
	if(Train && (WFOCycle != LastWFOCycle) )
	{
		if(LastNumTrades > 0 and LastNumTrades < 30)
		{
			char tradecount[100];
			sprintf(tradecount,"Not enough trades per cycle: %d",LastNumTrades);
			quit(tradecount);
		}
		LastWFOCycle = WFOCycle;
	}
	LastNumTrades = NumWinTotal+NumLossTotal;
}

Posted By: ibra

Re: Minimum trades for a system to be reliable? - 01/21/14 14:22

Thanks both of you!

Yes, I've thought about that too, to change timeframe, but it doesn't really produce a satisfying result then. Well well, I'll continue my progress and we'll see what happens.

Ibra

EDIT: Jcl, what does margin of error means? I tried to look it up in the performance report section in the manual(which looks kinda bugged for the record) but I didn't find anything.

Thanks again
© 2024 lite-C Forums