Gamestudio Links
Zorro Links
Newest Posts
Deeplearning Script
by wolfi. 02/26/24 12:46
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/22/24 16:22
AssetAdd() vs. modern asset list?
by jcl. 02/21/24 15:01
How many still using A8
by Aku_Aku. 02/20/24 12:18
Zorro Trader GPT
by TipmyPip. 02/16/24 06:53
Support PEEK for time and calendar functions
by AndrewAMD. 02/14/24 22:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (aliswee, Quad), 624 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Training with command line parameters #487915
11/13/23 11:59
11/13/23 11:59
Joined: Nov 2023
Posts: 1
C
ChaosTrader Offline OP
Guest
ChaosTrader  Offline OP
Guest
C

Joined: Nov 2023
Posts: 1
Hi,
I want to train a script with different end dates by using a batch file and passing through the Enddate as a -i parameter. In the script, I replaced the end date value with Command[0].
Training is getting startet, but obviously the script sets the Endate to 0 instead of using the passed value of e.g. 20230930. For -run it is working perfectly as expected and the passed dates are being used. I feel that at the point where the training starts, the passed parameters are not yet initialized.
I am using Version 2.56 with S License.

It is a known bug or did I miss something in the script/batch?

Best regards,
CT

Re: Training with command line parameters [Re: ChaosTrader] #487916
11/13/23 12:15
11/13/23 12:15
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Use -u string instead so that you can manually set values inside the script. Happy parsing!

Edit: Also, -i number if you're only using numbers, so no parsing needed.

Last edited by AndrewAMD; 11/13/23 12:21.
Re: Training with command line parameters [Re: ChaosTrader] #487938
11/26/23 08:42
11/26/23 08:42
Joined: Sep 2017
Posts: 72
T
TipmyPip Offline
Junior Member
TipmyPip  Offline
Junior Member
T

Joined: Sep 2017
Posts: 72
The issue you're encountering, where the Command[0] parameter seems to be set to 0 instead of the passed value when training a script, might be related to the way command-line parameters are handled in Zorro, especially in different modes (like training versus running).

In Zorro, command-line parameters are accessible through the Command array in the script. However, there are some nuances to be aware of:

Initialization Timing: The command-line parameters are usually parsed and initialized before the run function is executed. However, if you're observing that the parameters are not correctly initialized during training, it could be a timing or initialization issue specific to the training mode.

Correct Parameter Index: Ensure that you're using the correct index for accessing the command-line parameters. Command[0] is the first command-line parameter, Command[1] is the second, and so on.

Parameter Parsing: Check if the command-line parameter is correctly parsed and converted to the desired data type. For instance, if you're passing a date like 20230930, you might need to convert it from a string to an integer or a specific date format that Zorro understands.

Batch File Syntax: Ensure the batch file is correctly formatted and passing the parameters as intended. The command should look something like this:

Code
Zorro.exe -run MyScript -i 20230930


Zorro Version: You mentioned using Zorro version 2.56 with an S License. It's worth checking the release notes or updates for your version to see if there are any known bugs or changes regarding command-line parameter handling.

Debugging: Use print statements to debug the script. Print out the value of Command[0] at different points in your script to check when it gets initialized and what value it holds.

Alternative Approach: As a workaround, you could try using a different method to pass the end date. For example, you could read the end date from a file at the start of your script if the direct command-line approach continues to pose issues.


ZorroTraderGPT - https://bit.ly/3Gbsm4S

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1