Cron python trade script / error "Please set HOUSTON_URL environment variable"

Hi Brian, getting a strange error when running the following from cron countdown.
The goal is to schedule the python trading script… but getting huston URL error.

30 13 * * mon-fri quantrocket master isopen ‘XNYS’ --in ‘10min’ && /opt/conda/bin/python /codeload/zipline/vtrade.py

ERROR

quantrocket_countdown_1|From [email protected] Fri Dec 11 22:06:01 2020
quantrocket_countdown_1|Return-path: [email protected]
quantrocket_countdown_1|Envelope-to: [email protected]
quantrocket_countdown_1|Delivery-date: Fri, 11 Dec 2020 22:06:01 -0500
quantrocket_countdown_1|Received: from root by 2fdd66750a7a with local (Exim 4.92)
quantrocket_countdown_1| (envelope-from [email protected])
quantrocket_countdown_1| id 1knvEP-00000Y-Ss
quantrocket_countdown_1| for [email protected]; Fri, 11 Dec 2020 22:06:01 -0500
quantrocket_countdown_1|From: [email protected] (Cron Daemon)
quantrocket_countdown_1|To: [email protected]
quantrocket_countdown_1|Subject: Cron [email protected] /opt/conda/bin/python /codeload/zipline/a13vtrade.py
quantrocket_countdown_1|MIME-Version: 1.0
quantrocket_countdown_1|Content-Type: text/plain; charset=UTF-8
quantrocket_countdown_1|Content-Transfer-Encoding: 8bit
quantrocket_countdown_1|X-Cron-Env: <SHELL=/bin/sh>
quantrocket_countdown_1|X-Cron-Env: <HOME=/root>
quantrocket_countdown_1|X-Cron-Env: <PATH=/usr/bin:/bin>
quantrocket_countdown_1|X-Cron-Env: <LOGNAME=root>
quantrocket_countdown_1|Message-Id: [email protected]
quantrocket_countdown_1|Date: Fri, 11 Dec 2020 22:06:01 -0500
quantrocket_countdown_1|
quantrocket_countdown_1|Traceback (most recent call last):
quantrocket_countdown_1| File “/codeload/zipline/a13vtrade.py”, line 8, in
quantrocket_countdown_1| trade(“a13v_admx”, account=subaccount, bundle=“usstock-1d-bundle”, data_frequency=“daily”)
quantrocket_countdown_1| File “/opt/conda/lib/python3.7/site-packages/quantrocket/zipline.py”, line 614, in trade
quantrocket_countdown_1| response = houston.post("/zipline/trade/{0}".format(strategy), params=params)
quantrocket_countdown_1| File “/opt/conda/lib/python3.7/site-packages/requests/sessions.py”, line 581, in post
quantrocket_countdown_1| return self.request(‘POST’, url, data=data, json=json, **kwargs)
quantrocket_countdown_1| File “/opt/conda/lib/python3.7/site-packages/quantrocket/houston.py”, line 144, in request
quantrocket_countdown_1| url = self.base_url + url
quantrocket_countdown_1| File “/opt/conda/lib/python3.7/site-packages/quantrocket/houston.py”, line 131, in base_url
quantrocket_countdown_1| “”")
quantrocket_countdown_1|quantrocket.exceptions.ImproperlyConfigured: HOUSTON_URL is not set
quantrocket_countdown_1|
quantrocket_countdown_1|--------------------------------------------------------------------------------
quantrocket_countdown_1|Please set HOUSTON_URL environment variable.
quantrocket_countdown_1|
quantrocket_countdown_1|For local deployments: http://localhost:1969
quantrocket_countdown_1|
quantrocket_countdown_1|--------------------
quantrocket_countdown_1|| Windows syntax |
quantrocket_countdown_1|--------------------
quantrocket_countdown_1|
quantrocket_countdown_1|To set the environment variable on Windows, run:
quantrocket_countdown_1|
quantrocket_countdown_1| [Environment]::SetEnvironmentVariable(“HOUSTON_URL”, “http://localhost:1969”, “User”)
quantrocket_countdown_1|
quantrocket_countdown_1|IMPORTANT: you must close and re-open PowerShell for the environment variable to take effect!
quantrocket_countdown_1|
quantrocket_countdown_1|--------------------
quantrocket_countdown_1|| Mac syntax |
quantrocket_countdown_1|--------------------
quantrocket_countdown_1|
quantrocket_countdown_1|To set the environment variable on Mac, run:
quantrocket_countdown_1|
quantrocket_countdown_1| touch ~/.profile
quantrocket_countdown_1| echo ‘export HOUSTON_URL=http://localhost:1969’ >> ~/.profile
quantrocket_countdown_1| source ~/.profile
quantrocket_countdown_1|
quantrocket_countdown_1|--------------------
quantrocket_countdown_1|| Linux syntax |
quantrocket_countdown_1|--------------------
quantrocket_countdown_1|
quantrocket_countdown_1|To set the environment variable on Linux, run:
quantrocket_countdown_1|
quantrocket_countdown_1| touch ~/.bashrc
quantrocket_countdown_1| echo ‘export HOUSTON_URL=http://localhost:1969’ >> ~/.bashrc
quantrocket_countdown_1| source ~/.bashrc
quantrocket_countdown_1|
quantrocket_countdown_1|
quantrocket_countdown_1|

You have to use the satellite service to run custom scripts via cron.

https://www.quantrocket.com/docs/#custom-scripts

thank you, very much appreciated!