public string GetTransactionReport() { string report = ""; for (int i = 0; i < _traderAgent.Agents.Count; i++) { AbstractStrategy abstracttrader = (AbstractStrategy)_traderAgent.Agents[i]; //report += "Instrument:\t\t\t\t\t" + abstracttrader._instrument.Name + "\r\n"; report += "Date range:\t\t\t" + GetStartDate().ToShortDateString() + " - " + GetEndDate().ToShortDateString() + "\r\n"; report += "Initial Balance:\t\t\t" + abstracttrader.Account.InitialBalance.ToString() + "\r\n"; report += "Total bars:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getDays().ToString() + "\r\n"; report += "Total transactions:\t\t" + TotalTransactions.ToString() + "\r\n"; report += "Total bars held:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).TotalHeldBars.ToString() + "\r\n"; report += "Total bars won:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getUpPosDays().ToString() + "\r\n"; report += "Total bars even:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getEvenPosDays().ToString() + "\r\n"; report += "Total bars lost:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getDownPosDays().ToString() + "\r\n"; report += "Maximum consecutive wins:\t\t" + ((Statistics)_traderstats[abstracttrader]).MaximumConsectutiveWinBars.ToString() + "\r\n"; report += "Average consecutive wins:\t\t" + ((Statistics)_traderstats[abstracttrader]).AverageConsectutiveWinBars.ToString() + "\r\n"; report += "Maximum consecutive even:\t\t" + ((Statistics)_traderstats[abstracttrader]).MaximumConsectutiveEvenBars.ToString() + "\r\n"; report += "Average consecutive even:\t\t" + ((Statistics)_traderstats[abstracttrader]).AverageConsectutiveEvenBars.ToString() + "\r\n"; report += "Maximum consecutive losses:\t\t" + ((Statistics)_traderstats[abstracttrader]).MaximumConsectutiveLoseBars.ToString() + "\r\n"; report += "Average consecutive losses:\t\t" + ((Statistics)_traderstats[abstracttrader]).AverageConsectutiveLoseBars.ToString() + "\r\n"; report += "Maximum bar profit:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getMaximumPosWin().ToString() + "\r\n"; report += "Maximum bar loss:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getMaximumPosLoss().ToString() + "\r\n"; report += "Total Profit/Loss:\t\t\t" + TotalPnL.ToString() + "\r\n"; report += "Risk:\t\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getMeanRisk().ToString() + "\r\n"; //report += "Score:\t\t\t\t" + TotalScore.ToString() + "\r\n"; report += "Transactions:\t\t\t" + ((Transaction)abstracttrader.Account.Transactions[0]).Date.ToShortDateString() + ", " + ((Transaction)abstracttrader.Account.Transactions[0]).Quantity.ToString() + ", " + ((Transaction)abstracttrader.Account.Transactions[0]).Amount.ToString() + ", " + (double)(Math.Abs(((Transaction)abstracttrader.Account.Transactions[0]).Amount) / Math.Abs(((Transaction)abstracttrader.Account.Transactions[0]).Quantity)) + "\r\n"; for (int x = 1; x < abstracttrader.Account.Transactions.Count; x++) { report += "\t\t\t\t" + ((Transaction)abstracttrader.Account.Transactions[x]).Date.ToShortDateString() + ", " + ((Transaction)abstracttrader.Account.Transactions[x]).Quantity.ToString() + ", " + ((Transaction)abstracttrader.Account.Transactions[x]).Amount.ToString() + ", " + (double)(Math.Abs(((Transaction)abstracttrader.Account.Transactions[x]).Amount) / Math.Abs(((Transaction)abstracttrader.Account.Transactions[x]).Quantity)) + "\r\n"; } } return(report); }
public string GetReport() { string report = ""; for (int i = 0; i < _traderAgent.Agents.Count; i++) { AbstractStrategy abstracttrader = (AbstractStrategy)_traderAgent.Agents[i]; //report += "Instrument:\t\t\t\t\t" + abstracttrader._instrument.Name + "\r\n"; report += "Date range:\t\t\t" + GetStartDate().ToShortDateString() + " - " + GetEndDate().ToShortDateString() + "\r\n"; report += "Total bars:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getDays().ToString() + "\r\n"; report += "Total transactions:\t\t\t" + TotalTransactions.ToString() + "\r\n"; report += "Total bars held:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).TotalHeldBars.ToString() + "\r\n"; report += "Total bars won:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getUpPosDays().ToString() + "\r\n"; report += "Total bars even:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getEvenPosDays().ToString() + "\r\n"; report += "Total bars lost:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getDownPosDays().ToString() + "\r\n"; report += "Maximum consecutive wins:\t\t" + ((Statistics)_traderstats[abstracttrader]).MaximumConsectutiveWinBars.ToString() + "\r\n"; report += "Average consecutive wins:\t\t" + ((Statistics)_traderstats[abstracttrader]).AverageConsectutiveWinBars.ToString() + "\r\n"; report += "Maximum consecutive even:\t\t" + ((Statistics)_traderstats[abstracttrader]).MaximumConsectutiveEvenBars.ToString() + "\r\n"; report += "Average consecutive even:\t\t" + ((Statistics)_traderstats[abstracttrader]).AverageConsectutiveEvenBars.ToString() + "\r\n"; report += "Maximum consecutive losses:\t\t" + ((Statistics)_traderstats[abstracttrader]).MaximumConsectutiveLoseBars.ToString() + "\r\n"; report += "Average consecutive losses:\t\t" + ((Statistics)_traderstats[abstracttrader]).AverageConsectutiveLoseBars.ToString() + "\r\n"; report += "Maximum bar profit:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getMaximumPosWin().ToString() + "\r\n"; report += "Maximum bar loss:\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getMaximumPosLoss().ToString() + "\r\n"; report += "Total Profit/Loss:\t\t\t" + TotalPnL.ToString() + "\r\n"; report += "Risk:\t\t\t\t" + ((Statistics)_traderstats[abstracttrader]).getMeanRisk().ToString() + "\r\n"; //report += "Score:\t\t\t\t" + TotalScore.ToString(); } return(report); }