Topic: Custom Account Statistics for FSB Pro

I'm now experimenting with loading custom account statistics.

In that connection I totally rewrite it's code.

The main parameters and stats values are calculated by the Backtester at every test.
After that program calls AccountStatistics class and provides a link to Backteser.

/// <summary>
///     Calculates the account statistics.
/// </summary>
public void CalculateAccountStats(IBackTester backtester)
{
    IStrategy strategy = backtester.Strategy;
    IDataSet dataSet = backtester.DataSet;
    IProfile profile = backtester.Profile;

    int bars = dataSet.Bars;
    int firstBar = strategy.FirstBar;
    isInfoInCurrency = profile.IsInfoInCurrency;
    accountCurrency = profile.AccountCurrency;
    SentOrders = backtester.SentOrders;
    isScanPerformed = backtester.IsScanPerformed;
    testedBars = bars - firstBar;

    NetBalance = backtester.NetBalance;
    NetMoneyBalance = backtester.NetMoneyBalance;

In that way, the custom code has full access to all strategy, data series, profile settings and backtest data.

CalculateAccountStats method of the custom code copies what it needs from backtester and calculates the new parameters.

The stats info is stored in a InfoRecord class record by record:

    public struct InfoRecord
    {
        public string Name { get; set; }
        public string Value { get; set; }
        public InfoRecordFlag Flag { get; set; }
    }
records.Add(new InfoRecord
    {
        Name = "Profit per day",
        Value = isInfoInCurrency
                    ? MoneyProfitPerDay.ToString("F2") + unit
                    : ProfitPerDay + unit,
        Flag = ProfitPerDay < 0
                   ? InfoRecordFlag.Bad
                   : InfoRecordFlag.Normal
    });

records.Add(new InfoRecord
    {
        Name = "Tested bars",
        Value = testedBars.ToString(CultureInfo.InvariantCulture),
        Flag = InfoRecordFlag.Normal
    });

This concept works fine for now, but I want to experiment more.

Can you suggests some stats info you want to see in Account Stats info window.
I'll use it for a demo.

Re: Custom Account Statistics for FSB Pro

I am not sure if I am understanding the purpose of this.... so my reply may be way out to lunch..

Orders per day........ I feel it to be important that there be a certain number of actual trades per day for some advisers.  Also.... profitable and losing entries per day. Because we may have a series of bad orders that needs to be corrected.

My 'secret' goal is to push EA Studio until I can net 3000 pips per day....

Re: Custom Account Statistics for FSB Pro

I'll add also:  Average trade duration, Realized PL per lot, and Max consecutive loses

With this custom file will be very easy to remove a record or rearrange records.

Also we'll be possible to make some "Strategy Performance" function that will combine several stats value and will show: Very Good, Good, Bad...
something like:

if (AmbiguousBars< 1 && MoneyProfitPerDay> 30 && MoneyEquityPercentDrawdown< 10)
{
    records.Add(new InfoRecord
        {
            Name = "Strategy performance",
            Value = "Excelent",
            Flag = InfoRecordFlag.VeryGood
        });
}
else if (AmbiguousBars< 5 && MoneyProfitPerDay> 25 && MoneyEquityPercentDrawdown< 15)
{
    records.Add(new InfoRecord
        {
            Name = "Strategy performance",
            Value = "Good",
            Flag = InfoRecordFlag.Good
        });
}
else if (AmbiguousBars< 10 && MoneyProfitPerDay> 0 && MoneyEquityPercentDrawdown< 15)
{
    records.Add(new InfoRecord
        {
            Name = "Strategy performance",
            Value = "Normal",
            Flag = InfoRecordFlag.Normal
        });
}
else
{
    records.Add(new InfoRecord
        {
            Name = "Strategy performance",
            Value = "Bad",
            Flag = InfoRecordFlag.Bad
        });
}

Where different Flag values correspond to different color of the info line.

Re: Custom Account Statistics for FSB Pro

average trades last week = average trades last two weeks = average trades last month = average trades last quarter = average trades last year plus/minus %


Is it applicable!!!!

5 (edited by ahmedalhoseny 2013-02-18 14:26:19)

Re: Custom Account Statistics for FSB Pro

Minimum number of consecutive weeks/days / bars  strategy allowed to be out of market'' not trading'' it will be a nice addition

Post's attachments

out of market.jpg
out of market.jpg 23.15 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Custom Account Statistics for FSB Pro

Maximum floating Draw down % , In my opinion its something like real trading  we don't need a profitable strategy with floating draw down 25% or so