[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: OT: Statistics



PureBytes Links

Trading Reference Links

I've read The Trading Game three times and will probably do so again. Focuses on Fixed Ratio MM but 
discussed Fixed Fractional lots too.
Regards the stats:
- "expectation" is ambiguous. His derivation is provided but it's not the Tharp expectation...
- average drawdown is not calculated correctly. If anyone can help with it please chip in!
- code should append output to trade report stats
Because AB doesn't seem to base profits correctly for forex currently I am restricted to pretty 
simple (point-based) stats. Hopefully Tomasz will help me with this soon and I can become a stats 
nut too.. Grant

<code>
// custom backtester metrics
bo = GetBacktesterObject();		// retrieve the interface to portfolio backtester
bo.Backtest();				// run default backtest procedure
st = bo.GetPerformanceStats(0);	// get stats for all trades
// expectancy calculation (Ryan Jones version)
payoff = st.GetValue("WinnersAvgProfit") / abs( st.GetValue("LosersAvgLoss") );
expect = ( ( 1 + payoff ) * ( st.GetValue("WinnersPercent") / 100 ) ) - 1;
// Ryan Jones statistics
bo.AddCustomMetric( "Ryan Jones statistics :" );
bo.AddCustomMetric( "1.    net$profit", st.GetValue("NetProfit") );
bo.AddCustomMetric( "2.    max$drawdown", abs( st.GetValue("MaxSystemDrawdown") ) );
bo.AddCustomMetric( "3.    expectation (+/-)", expect );
bo.AddCustomMetric( "4.    avg$trade", st.GetValue("AllAvgProfitLoss") );
bo.AddCustomMetric( "5a.  avg$win : avg$loss", payoff );
bo.AddCustomMetric( "5b.  %profitable", st.GetValue("WinnersPercent") );
bo.AddCustomMetric( "6.    avg$drawdown * not correct *", abs( st.GetValue("MaxTradeDrawdown") ) / 
st.GetValue("AllQty") ); // not correct !
bo.AddCustomMetric( "7.    max$win : avg$win", st.GetValue("WinnersLargestWin") / 
st.GetValue("WinnersAvgProfit") );
bo.AddCustomMetric( "8.    total$profit : total$loss", st.GetValue("WinnersTotalProfit") / abs( 
st.GetValue("LosersTotalLoss") ) );
</code>

brian.z123 wrote:
> Grant,
> 
> I haven't made it to the CBT as yet but I would love a copy of your 
> work.
> I can park it for a while and check it out later.
> Would you be able to email it to me or post it somewhere?
> 
> I think I put that book on my wish list last week.
> I'll check.
> 
> Right now I am dieing of statistical thirst so I will quaff down 
> anything palatable.
> 
> I am sure it is simple which is why I am stunned that the more popular 
> authors barely touch on it.
> 
> Thanks so much for your help.
> 
> BrianB2.
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, Grant Noble <gruntus@xxx> wrote:
>> People have mentioned the *Tharp* book as being a good starting 
> point 
>> for exploring trading statistics. I'd like to add that *"The Trading 
>> Game" by Ryan Jones* has lots of interesting stuff to say about 
> money 
>> management and system development. He has a chapter on statistics 
> and 
>> even provides a basket of eight stats with an explanation of each. 
> Good 
>> simple stuff but I've found it useful. Have written CBT code for the 
>> stats if anyone's interested. G
>>

Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006