Hey folks,
Is there anyway to get the folder name my backtest is going to use from with in my script?
I am running my backtests locally and I would like to output a file to review within my backtest folder /strategy_name/backtests/2022-07-23_23-55-32
I understand that You can use the --output option to change the output directory, but I am happy with the current structure of using the current timestamp, but as this is created at the time of the backtest It would be great if I could access this variable so I can output a csv to this dir.
Louis Szeto
Hi John
Sorry, but there is no easy solutions for this one. It requires tempering things in the Docker level, so we don’t recommend members to do so. A workaround would be ”cd” to the last folder in the root project backtest result dir.
Best
Louis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
John M
Thanks Louis for getting back to me:
Can you tell me more about this? Say if my project structure was like so:
Lean Init Dir: /Users/username/Documents/dev/quant/strategies/
Project Dir:
`/Users/username/Documents/dev/quant/strategies/project_name/`
If it is too hard to access the backtest dir location from within the algo, Is there a way I can output a file somewhere where I can access it after? I want to output this data so I can chart it on my own charting library.
When I run the above I cannot find the file anywhere, is it being stored somewhere in the container?
Would I need to add a volume to the container so I can access this location, or is there a built in way to do this already
John M
I believe I worked this out, the backtest folder on the local os is mounted to a /Results folder within the quantconnect/lean container so if you output what ever you want into /Results/ it will appear in your backtest folder. So:
John M
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!