Originally Posted By: MatPed
In case of use of oversampling the graph will plot the distribution of all trades or only of one sample?
All trades. The code is in your profile.c header, so you can tweak it for your own purposes if necessary.
Code:
void plotMAEPercentGraph(int bars)
{
	if(!is(TESTMODE)) return; 
	g->dwStatus |= PLOTSTATS;
	if(is(EXITRUN))
	{
		if(!bars) bars = 50;
	
		var vMaxMAE = 0;
		for(all_trades) // calculate maximum MAE relative to open
			vMaxMAE = max(vMaxMAE,(100.*TradeMAE/(TradePriceOpen)));
		//printf("nMaxMAE: %.0f",vMaxMAE);
	
		var vStep;
		if(bars < 0) // bucket size in thousandths of percentage points (i.e. 0.001%)
			vStep = (bars * (-1.) / (1000.));
		else
			vStep = max(0.05, roundto((vMaxMAE/bars),0.001));
		printf("  Step: %.3f",vStep);
		
		for(all_trades) 
		{
			var vResult = (100*TradeProfit/(TradeUnits*TradePriceOpen));
			var vMAE = (100.*TradeMAE/(TradePriceOpen))/vStep;
			int n = floor(vMAE);
			plotBar("Profit",n,n*vStep,0,AVG|BARS|LBL2,COLOR_DEV);
			if(vResult > 0)
				plotGraph("Win",vMAE,vResult,DOT,GREEN);
			else
				plotGraph("Loss",vMAE,vResult,DOT,RED);
		}
	}
}