https://bugs.winehq.org/show_bug.cgi?id=47221
Bug ID: 47221 Summary: COleDateTime class is not 100% compatible Product: Wine Version: 4.8 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: jcl@conitec.net Distribution: ---
A backtest software produces a different result under Wine than under Windows. The reason is a slightly different handling of date/time functions. I suspect an incompatibility of the COleDateTime class member.
For reproducing the problem, install the software "Zorro" from http://opserver.de/down/Zorro_setup.exe in its default directory. When the Software opens, select "Workshop4" on the "Script" scrollbox, then click "Test". Zorro will report a significantly different result under Wine than under Windows.
https://bugs.winehq.org/show_bug.cgi?id=47221
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com --- Could you attach a screenshot of relevant UI parts? And correct screenshot from Windows too.
https://bugs.winehq.org/show_bug.cgi?id=47221
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://opserver.de/down/Zor | |ro_setup.exe
https://bugs.winehq.org/show_bug.cgi?id=47221
--- Comment #2 from jcl jcl@conitec.net --- Created attachment 64492 --> https://bugs.winehq.org/attachment.cgi?id=64492 Zorro screenshot
https://bugs.winehq.org/show_bug.cgi?id=47221
--- Comment #3 from jcl jcl@conitec.net --- Sure, here's a screenshot of the Windows version after the test run. The Wine screen looks similar, but shows "Annual +7.2%" instead of "Annual 25.9%".
From comparing both logs, I suspect a difference of COleDateTime.GetDayOfWeek()
or GetHour() when the date is close to a day or hour boundary.
https://bugs.winehq.org/show_bug.cgi?id=47221
pattietreutel katyaberezyaka@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |katyaberezyaka@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=47221
jibanes@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jibanes@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=47221
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Summary|COleDateTime class is not |Zorro 2.x (time series |100% compatible |analysis and trading | |strategies software) using | |OLE Date/Time API via MFC | |'COleDateTime' class shows | |incorrect data Status|UNCONFIRMED |NEW CC| |focht@gmx.net Component|-unknown |oleaut32
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello folks,
confirming.
Stable download link to Zorro v2.09 (matching screenshot from comment #2) via Internet Archive:
https://web.archive.org/web/20190518095628/http://opserver.de/down/Zorro_set...
I've rephrased the title of the bug report as it was misleading. Wine doesn't implement MFC at all which provides the 'COleDateTime' class (it could have been interpreted as such).
Trace log shows the following OLE date/time APIs being used by the app (or rather the MFC COleDateTime code the app is linked with):
* oleaut32.SystemTimeToVariantTime * oleaut32.VariantTimeToSystemTime * oleaut32.VarUdateFromDate
--- snip --- $ pwd /home/focht/.wine/drive_c/users/focht/Zorro
$ WINEDEBUG=+seh,+relay,+ole,+variant wine ./Zorro.exe >>log.txt 2>&1 ... --- snip ---
@jcl (comment #3)
--- quote ---
From comparing both logs, I suspect a difference of COleDateTime.GetDayOfWeek()
or GetHour() when the date is close to a day or hour boundary. --- quote ---
I presume you are one of the developers of this app?
https://zorro-project.com/development.php
It would definitely help to have a small test app that shows this behaviour or alternatively reduce the simulation to the absolute minimum.
I've played a bit with the simulation parameters to reduce the amount of data/smaller time series but I was only partially successful.
'/home/focht/.wine/drive_c/users/focht/Zorro/Strategy/Workshop4.c'
--- snip --- // Trend Trading /////////////////// #include <profile.c>
function run() { EndDate = 2017; // fixed simulation period Verbose = 2; set(LOGFILE|PLOTNOW); // log all trades
vars Prices = series(priceClose()); vars Trends = series(LowPass(Prices,300));
Stop = 30*ATR(100);
vars MMI_Raw = series(MMI(Prices,300)); vars MMI_Smooth = series(LowPass(MMI_Raw,300));
if(falling(MMI_Smooth)) { if(valley(Trends)) enterLong(); else if(peak(Trends)) enterShort(); }
PlotWidth = 800; PlotHeight1 = 300; //setf(PlotMode,PL_FILE); //setf(PlotMode,PL_FILE); //plot("MMI_Raw",MMI_Raw,NEW,GREY); //plot("MMI_Smooth",MMI_Smooth,0,BLACK); //plotTradeProfile(-50); } --- snip ---
You have way more insight how adjust the parameters to reduce the amount of output, specifically Lookback and Depth.
$ sha1sum Zorro_setup.exe 9c9f0f65bf3d045df0d92084a48916869b060577 Zorro_setup.exe
$ du -sh Zorro_setup.exe 95M Zorro_setup.exe
$ wine --version wine-5.0-rc5
Regards
https://bugs.winehq.org/show_bug.cgi?id=47221
--- Comment #5 from jcl jcl@conitec.net --- Thank you for looking into this. I partially fixed the problem by replacing
Time.GetHour()
with
double Days; double Hour = modf(Time.m_dt,&Days)*24.; if(Hour >= 24.) Hour = 0.; return (int)Hour;
This partially helped, but something is still different. The simplest way to see the problem is using this code:
--- snip --- function run() { Verbose = 2; set(LOGFILE); } --- snip ---
This will print a list of dates to the .log file. When you compare the log files from Windows and from Wine with a comparison tool, like BeyondCompare, you can see the differences in the dates.
https://bugs.winehq.org/show_bug.cgi?id=47221
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com
--- Comment #6 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- (In reply to jcl from comment #5)
This will print a list of dates to the .log file. When you compare the log files from Windows and from Wine with a comparison tool, like BeyondCompare, you can see the differences in the dates.
Could you please attach the files?
https://bugs.winehq.org/show_bug.cgi?id=47221
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO
--- Comment #7 from Nikolay Sivov bunglehead@gmail.com --- It would be helpful to have that reduce test case, mentioned earlier.
https://bugs.winehq.org/show_bug.cgi?id=47221
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://opserver.de/down/Zor |https://web.archive.org/web |ro_setup.exe |/20190518095628/http://opse | |rver.de/down/Zorro_setup.ex | |e
--- Comment #8 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable download links to old versions via Internet Archive.
https://web.archive.org/web/*/http://opserver.de/down/Zorro_setup.exe
====
Zorro 2.0.8.1:
https://web.archive.org/web/20190518095628/http://opserver.de/down/Zorro_set...
$ sha1sum Zorro_setup.exe 9c9f0f65bf3d045df0d92084a48916869b060577 Zorro_setup.exe
$ du -sh Zorro_setup.exe 95M Zorro_setup.exe
====
Zorro 2.2.5.7:
https://web.archive.org/web/20200519172431/http://opserver.de/down/Zorro_set...
$ sha1sum Zorro_setup.exe 79f48ea3dfae7acf8302a9e2444d62f53336802d Zorro_setup.exe
$ du -sh Zorro_setup.exe 103M Zorro_setup.exe
$ wine --version wine-6.1-122-g2201ca08fb0
Regards