Just found the solution: the profile.c has all the code:



Code:
void plotMAEGraph(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 in pips
			vMaxMAE = max(vMaxMAE,TradeMAE/PIP);
		//printf("\nMaxMAE: %.0f",vMaxMAE);
	
		var vStep;
		if(bars < 0) // bucket size in pips
			vStep = -bars;
		else
			vStep = 10*(int)max(1.,vMaxMAE/bars/10);
		printf("  Step: %.0f",vStep);
		
		for(all_trades) 
		{
			var vResult = toPIP(TradeResult);
			var vMAE = TradeMAE/PIP/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);
		}
	}
}



Which leads to the next question: does someone have written more graph functions and is willing to share them?

Last edited by dr_panther; 10/30/16 19:24.