|
Re: New Zorro version 2.50
[Re: hast29]
#486358
08/05/22 14:01
08/05/22 14:01
|
Joined: Feb 2017
Posts: 1,731 Chicago
AndrewAMD
Serious User
|
Serious User
Joined: Feb 2017
Posts: 1,731
Chicago
|
Also, is there any benefit from 64bit architecture ? I am just training and testing own scripts, writen directly in Zorro "simple C". Using C++ as script language has many advantages. Additional development tools, such as the Visual Studio debugger and profiler, are available. External libraries, such as Boost, can be integrated without a wrapper. The 64-bit mode can access more memory for backtests. All lite-C functions and all system variables can still be used, but additionally you have C++ classes and templates at your disposal. Error handling is more strict and you'll get warnings about bad code style. The VC++ compiler is a bit slower than the lite-C on-the-fly compiler, but is only invoked when the script was changed. The resulting code runs equally fast or - in 64 bit mode - even faster. The only disadvantage is that you have to download and install Microsoft Visual Studio™ 2017 or above. https://zorro-project.com/manual/en/dlls.htm
|
|
|
Re: New Zorro version 2.50
[Re: jcl]
#486362
08/07/22 10:00
08/07/22 10:00
|
Joined: Jul 2022
Posts: 3
mun
Guest
|
Guest
Joined: Jul 2022
Posts: 3
|
Hi guys. I migrated my lite-C script to C++ to test the new feature "C++ scripts now start directly, like .c scripts (Zorro S and Visual Studio required). "
I found it only works when the script name is different. For example if you have script names:
Test1.c Test1.cpp
and you click Test on Zorro64 for Test1 it will print "Test1" but it won't compile it; it just does nothing. The documentation states:
"If you have a mix of lite-C and C++ scripts, you can add a '+' to a .cpp script name for marking it in the scrollbox"
I tried this to name it Test1+.cpp and it compiled and ran as expected. Would it be possible to tighten the documentation wording a bit to say it must have different names if using a mix of lite-C and C++ files, or give some error message to indicate needing a different script name when trying to run it in Zorro64?
EDIT: I then tried creating the DLL directly from Visual Studio. When building it as Test1+.dll I get the same issue - Zorro64 prints "Test1+" then does nothing. However when I change the output dll name to Test1+64.dll then Zorro64 uses it correctly. But suffixing the 64 on the dll name is not mentioned in the help pages, I just figured it out from the way Zorro was building the included MyStrategy+.cpp
Last edited by mun; 08/07/22 13:05.
|
|
|
Re: New Zorro version 2.50
[Re: jcl]
#486818
10/15/22 16:53
10/15/22 16:53
|
Joined: Feb 2021
Posts: 2 Ireland
Sc1entia
Guest
|
Guest
Joined: Feb 2021
Posts: 2
Ireland
|
Hi folks,
Just following up on the post from “mun” above, and have noticed the Zorro64 dll name dependency (for Zorro 2.50).
I have reduced the script to very basic functionality – it prints out “main” from main() and “INITRUN” from run().
When I manually compile the script in Visual Studio as a x32, it (Test.dll) loads and “tests” fine from Zorro(32). Testing from Zorro64 just prints two empty lines followed by the name of the script on the third line (in the Zorro64 status box) – no error message.
When I compile the script in Visual Studio as a x64, in Zorro(32) it tries to load (when Test is clicked) and then produces an Error 061: invalid DLL (….). This is expected behaviour.
When I load/Test the same x64 dll strategy file in Zorro64, it just does the same as previous - prints the two empty lines followed by the name of the script - nothing else. It does the same when it loads other x32 strategy files (two empty lines and the name of the file).
When I rename the x64 dll strategy file to Test64.dll, the Script retains the same name in Zorro64 but it now executes properly. Zorro64 is truncating the 64 from the name of the dll file (i.e. If I rename the x64 dll to Test6464.dll, Zorro64 shows the name as Test64).
Lastly, if I rename a x32 dll strategy file to include 64 at the end of the name, Zorro64 then tells me that it’s an invalid DLL. I can’t think why I would do this in reality – just including for completeness.
So Zorro64 is using the ending part of the compiled strategy dll to figure out if should be executed as a x64. If it’s not present, then Zorro64 won’t even try to execute it as a x64. While “64” has no meaning in a script source name, it does indeed have a meaning in the compiled dll name (as far as Zorro64 is concerned).
It took me a few hours of mucking about today to see what I was doing wrong. I couldn’t find anything in the documentation indicating that I need to rename the x64 Visual Studio compiled .dll to get it working in Zorro64 - perhaps this could be included in future versions of the documentation.
Regards,
Kieran
Last edited by Sc1entia; 10/15/22 16:55.
|
|
|
|