I am able to run the algorithms in the Algorithm.Python folder of the Lean repo using Docker and making the necessary modifications in Launcher/config.json file. This is the command I used:
docker run --rm \
-v /tmp:/Results \
-v $(pwd)/Data:/Data \
-v $(pwd)/Launcher/config.json:/Lean/config.json \
-v $(pwd)/Algorithm.Python/:/Algorithm.Python \
quantconnect/lean:latest --data-folder /Data --results-destination-folder /Results --config /Lean/config.json
I would like to be able to develop algorithms in Python with the help of a Python REPL. I thought I can get one by running:
docker run --rm \
-v /tmp:/Results \
-v $(pwd)/Data:/Data \
-v $(pwd)/Launcher/config.json:/Lean/config.json \
-v $(pwd)/Algorithm.Python/:/Algorithm.Python \
-it \
--entrypoint python \
quantconnect/lean:latest
This launches a Python REPL but running commands like:
from clr import AddReference
gives:
so I don't think I am using the right Python interpreter inside the container.
How do I call the right Python interpreter inside the Docker container? I know Python but am totally new to the .NET and Mono environment.
Moeh12
I found the solution:
docker run --rm \ -v /tmp:/Results \ -v $(pwd)/Data:/Data \ -v $(pwd)/Launcher/config.json:/Lean/config.json \ -v $(pwd)/Algorithm.Python/:/Algorithm.Python \ -it \ --entrypoint mono \ quantconnect/lean:latest nPython.exe
Jared Broad
=) Epic, 100 points!
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.
Moeh12
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!