Ray client installation#

This section describes installation and configuration of Ray client, which is necessary to run onetick.py code remotely on a Ray instance. You don’t need it, if you use onetick.py locally with fully installed OneTick, as mentioned above.

Ask your OneMarketData rep for a username and password and run the commands below

pip install -U --index-url https://USERNAME:PASSWORD@pip.distribution.sol.onetick.com/simple/ onetick-query-stubs
export OTP_SKIP_OTQ_VALIDATION=1

To simplify Ray initialization in the future, add a new environment variable with Ray instance URL (ask your OneMarktData rep):

export RAY_ADDRESS="ray://<URL>:10001"

Now you can start coding in your IDE and you could do import onetick.py as well. But you can’t run your code locally, because you don’t have OneTick installed.

To run your code remotely on Ray, proceed to Remote OTP with Ray for details.

Connection to Ray#

In order to connect from an external network, it is necessary to whitelist your IP address and use your connection certificates (ask your OneMarketData rep to provide certificate files and whitelist your IP). Download these certificate files to one common folder (<path-to-folder>):

  • client-cert.pem

  • client-key.pem

  • ca-cert.pem

Add paths to certificate files into environment variables:

export RAY_TLS_SERVER_CERT=<path-to-folder>/client-cert.pem
export RAY_TLS_SERVER_KEY=<path-to-folder>/client-key.pem
export RAY_TLS_CA_CERT=<path-to-folder>/ca-cert.pem
export RAY_USE_TLS=1

or in the similar way for Windows.

Now you can connect to a Ray instance from an external network.