Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by madpower2000. 07/22/26 14:01
ZorroGPT
by TipmyPip. 07/21/26 17:54
New Zorro version 3.11
by jcl. 07/21/26 13:42
Lapsa's very own thread
by Lapsa. 07/18/26 13:40
Purchase A8 full licence version
by ukgamer. 07/17/26 05:52
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 9,798 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Development from different folder with Eval Shell #489552
07/21/26 10:57
07/21/26 10:57
Joined: Jan 2022
Posts: 79
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 79
Budapest
Hello,

I use a separate development folder for coding my strategies, mainly because the projects may become more complex later and I want to keep them under standalone version control. After compilation, a post-build script copies the generated .dll file into Zorro’s Strategy folder, here's how.

This workflow normally works as expected.
However, after I included the Eval Shell (<evars.h> and the other stuff to _optimize), built one script successfully and try to run,
I get the following error:

Code
Zorro64 S 3.11.2
(c) oP group Germany 2026
Registered: Zorro S Subscription

3 start
Error 062: Can't open "3.cpp" (rb:2)


As I see Zorro’s built-in compiler needs access to the source .cpp file in order to extract the _optimize variables and compile the individual strategy variants. In my setup, however, the source file is not located in Zorro’s Strategy folder. It also does not have the expected strategy name, since the entry file is called main.cpp.

Is there a supported way to use the Evaluation Shell with externally compiled strategies and a separate source directory?
I would prefer to keep the Zorro Strategy folder clean while preserving my Git-based workflow, especially for potentially large, multi-file codebases.

Last edited by NorbertSz; 07/21/26 11:44.
Re: Development from different folder with Eval Shell [Re: NorbertSz] #489553
07/21/26 13:14
07/21/26 13:14
Joined: Feb 2017
Posts: 1,823
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,823
Chicago
There's a lot of ways to do this.

One way is to place a symbolic link to the header (or header directory) in the Strategy folder. So you can do this in your script:

Code
#include <symlinked_extraheader.h>
or this:
Code
#include <symlinked_folder/extraheader.h>
For this, you will need Microsoft's mklink command, which is documented here:
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

Re: Development from different folder with Eval Shell [Re: AndrewAMD] #489561
Yesterday at 15:48
Yesterday at 15:48
Joined: Jan 2022
Posts: 79
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 79
Budapest
My project already compiles successfully with external headers. The problem is that the Eval Shell appears to open the strategy source file itself, such as 3.cpp, in order to parse the _optimize variables. In my setup, that source file is not located in Zorro’s default Strategy folder.

I also tried selecting [Change folder] from the Action dropdown and then choosing main.cpp from my custom project directory. Zorro finds and compiles the file successfully, but after that the Eval Shell still cannot open the cpp file. See the attached screenshot.

I also configured ZorroFix.ini as follows:

Code
StrategyFolder = "C:\repo\my-super-secret-strategy-folder"


After restarting Zorro:

- Zorro points to the correct folder at start
- I can select "main"
- I click Test
- the script compiles successfully
- however, I still get the same error:

Code
Zorro64 S 3.11.2
(c) oP group Germany 2026
Registered: Zorro S Subscription

main.cpp compiling..
main start
Error 062: Can't open "main.cpp" (rb:2)


AndrewAMD, I understand that your suggestion could also be extended to creating a symbolic link for the entire Strategy folder, pointing it to an external project directory. That could work, but I don't see it as a sustainable development setup, especially when working with multiple strategies. Thanks for the idea, it will be my Plan B.

Is there a more robust way to use the Evaluation Shell with externally managed, multi-file strategy projects?

Attached Files z.png
Re: Development from different folder with Eval Shell [Re: AndrewAMD] #489562
Yesterday at 16:09
Yesterday at 16:09
Joined: Jan 2022
Posts: 79
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 79
Budapest
Plan B is working, screenshot attached.
Code
mklink /J "C:\zorro\Strategy" "C:\repo\my-super-secret-strategy-folder"

Still looking for Plan A.

Attached Files z2.png
Last edited by NorbertSz; Yesterday at 16:17.
Re: Development from different folder with Eval Shell [Re: NorbertSz] #489563
Yesterday at 17:50
Yesterday at 17:50
Joined: Jan 2022
Posts: 79
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 79
Budapest
I checked eval.c and eval2.c. The problem is that the Strategy folder is hardcoded:
Code
#define VARLIST strf("Strategy\\%s.cpp",RootName)


Could you please expose the currently selected Strategy folder through trading.h -> variables.h?
Code
#define StrategyFolder g->sStrategyFolder


Then the VARLIST definitions in eval.c and eval2.c could use:
Code
#define VARLIST strf("%s\\%s.cpp",StrategyFolder,RootName)


This would allow the Eval Shell script to use the folder defined in the ZorroFix.ini or selected through "[Change Folder]", instead of always assuming that the folder is named “Strategy” in Zorro root.

Last edited by NorbertSz; Yesterday at 17:59.
Re: Development from different folder with Eval Shell [Re: NorbertSz] #489564
14 hours ago
14 hours ago
Joined: Jul 2000
Posts: 28,127
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,127
Frankfurt
You can define VARLIST to anything in your script. Make sure to use the current eval version, not an old one or a beta version. I don't think there is an "eval2" script in a release version.

Re: Development from different folder with Eval Shell [Re: jcl] #489565
13 hours ago
13 hours ago
Joined: Jan 2022
Posts: 79
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 79
Budapest
Yes, I can define VARLIST either by modify the evaluation script or add an extra #define VARLIST in my strategy.
But it's not dynamic.

What I was looking for is a variable containing the path to the currently selected strategy folder (which can be configured for startup in ZorroFix.ini or changed after via [Change Folder] in the Action menu). Zorro clearly knows this path, but doesn't expose it through trading.h and variables.h, so I have no way to access it and change the eval script to load VARLIST from the current strategy folder, not a hardcoded one.

As far as I can tell, the most recent release is 3.11.2 (I get this on email). I made a fresh installation in a different folder, and it has eval2.c in the include directory.

Code
PS C:\zorro2\include> dir

    Directory: C:\zorro2\include

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-----       2004. 01. 26.     3:58           1317 com.h
-----       2026. 03. 07.    13:00          21106 contract.c
-----       2017. 02. 05.    11:08         142829 d3d9.h
-----       2026. 01. 03.    11:37           4396 default.c
-----       2012. 04. 06.     9:41              0 empty.h
-----       2026. 06. 27.    13:09          51119 eval.c
-----       2026. 01. 11.    13:36            390 eval.h
-----       2026. 06. 05.    10:03          49845 eval2.c
-----       2026. 06. 21.    17:41           1754 evars.h
-----       2026. 05. 07.    12:40           9686 func_list.h
-----       2026. 05. 07.    12:40          32331 functions.h
-----       2022. 10. 23.    10:44           2132 legacy.h
-----       2026. 05. 10.    10:56           3691 litec.h
-----       2017. 02. 04.    15:52          78372 opengl.h
-----       2026. 04. 25.     8:54          10595 profile.c
-----       2024. 06. 02.    12:07           1505 pynet.cpp
-----       2024. 08. 21.    14:11          12031 r.h
-----       2022. 06. 09.    15:20           9801 stdio.h
-----       2026. 04. 05.    16:22          49660 trading.h
-----       2026. 04. 06.    12:13          20829 variables.h
-----       2022. 01. 10.    13:47         361294 windows.h
-----       2026. 03. 08.    13:23          19733 zorro.h

Last edited by NorbertSz; 13 hours ago.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1