Hello,
i am just trying out Zorro and writing a few simple scripts to get familiar with it. I wrote a script that trades only on a single day, that goes long at 12:00PM and exits the trade at 16:00. I have tested this with EUR/USD data from the Zorro-website.
function run()
{
set(LOGFILE);
vars Price = series(price());
if(NumOpenLong == 0 && hour(0) >= 12 && lhour(0) < 16)
enterLong();
if(NumOpenLong != 0 && hour(0) >= 16)
exitLong();
StartDate = 20120921;
EndDate = 20120921;
PlotWidth = 1024;
PlotHeight1 = 768;
}
Now Zorro produces a performance report, a trade log and a CSV-file with the trades. The log says i entered at 1.2978 and exited at 1.2992 for a PnL of $1 (+14 pips).
The CSV says i entered at 1.29781 and exited at 1.29896 for a PnL of $0.84 (+11.5 pips).
The performance report says i made +10.4 pips or $0.84.
Why are there such differences, and how do you calculate the $0.84 ? A gain of 10 pips (the minimum of the three) should be $1 straight.
I also did the same on USD/JPY. Again the exit-prices from the csv and the log are differing by ~3 pips. And the PnL calculation is off: according to the csv-file i lost 3.1 pips or $0.32. This cannot be correct with usd/jpy exchange-rate at 78.xx.
Maybe i have to adjust some flags or something?
One last question: can Zorro correctly calculate the PnL in USD of, for example, a EUR/CHF trade?
Regards,
Purri