// plotting Equity & Balance curves on your Zorro result charts.
// add this forward declaration on top of your script:
function plot_balance_equity();
// next comes your script:
//---------------------------------------
function run()
//---------------------------------------
{
// set this to automatically produce the result chart at the end of a [Test]
set(PLOTNOW);
// your strategy code goes here, for instance:
while(asset(loop("EUR/USD"/*,"AUD/USD","GBP/USD","GER30","NAS100","SPX500","UK100","UKOil","US30","USD/CAD","USD/CHF","USD/JPY","USDOLLAR","USOil","XAG/USD","XAU/USD"*/)))
{
// ... your trading decisions here ...
//---------------------------------------
// now plot the Balance & Equity curves
plot_balance_equity();
//---------------------------------------
} // asset(loop(...))
// set the size of the resulting chart PNG file
PlotWidth = 2000;
PlotHeight1 = 500;
}
// here is the actual function:
//---------------------------------------
function plot_balance_equity()
//---------------------------------------
{
var *EquityCurve = series(WinTotal - LossTotal + WinValTotal - LossValTotal);
plot("Balance",Balance,NEW,BLUE);
plot("Equity",*EquityCurve,0,GREEN);
}
//end