Clear Zorro data from memory

Posted By: tomna1993

Clear Zorro data from memory - 05/28/21 13:55

Hi,

Is there a way to clear RAM at the end of the test? I have 32GB RAM and the second time I run the test it shows the memory fragmented or unavailable error message. 70% of my ram is free and Zorro still gives that message. Hope there is a workaround because it's a little bit uncomfortable to close and open Zorro after each tests.
Posted By: AndrewAMD

Re: Clear Zorro data from memory - 05/28/21 14:20

If you need to run many known tests, you can batch script them.
Posted By: tomna1993

Re: Clear Zorro data from memory - 05/28/21 14:38

Can I change asset and timeframe with batch script?
Posted By: AndrewAMD

Re: Clear Zorro data from memory - 05/28/21 15:13

Absolutely. You can even change BarPeriod, since each Zorro instance it is its own process and has its own memory allocations.
Posted By: tomna1993

Re: Clear Zorro data from memory - 05/28/21 15:51

Looks like I have to learn batch scripting. cool
Is there any howto or documentation for controlling Zorro with batch script?
Posted By: AndrewAMD

Re: Clear Zorro data from memory - 05/28/21 18:38

There are many approaches.

Windows batch files (generic):
https://www.tutorialspoint.com/batch_script/index.htm

You can even write your batch file in Python, or even a Zorro script.

You'll definitely need to know how the Zorro command line works:
https://zorro-project.com/manual/en/command.htm

But the best example I've ever seen of batch scripting can be seen in the Trend Experiment on the Financial Hacker blog (download from "Scripts 2015" in the sidebar):
https://financial-hacker.com/trend-and-exploiting-it/
https://financial-hacker.com/scripts2015.zip
Posted By: tomna1993

Re: Clear Zorro data from memory - 05/28/21 20:16

Thank you Andrew! It works flawlessly! Have a nice day!
© 2024 lite-C Forums