[Unit] Description=ibkr-quant daily rebalance: today's bars, then MOC orders After=ibgateway.service # make gateway restarts a Gateway that has lost IBKR. Retries cover today's bar # arriving late (delayed data) and Gateway restarts; make submit refuses to # double-submit while orders are open. StartLimitIntervalSec=7200 StartLimitBurst=6 [Service] Type=oneshot WorkingDirectory=%h/projects/ibkr-quant Environment=PATH=%h/.local/bin:/usr/local/bin:/usr/bin:/bin ExecStartPre=/usr/bin/make gateway ExecStart=/usr/bin/make bars submit Restart=on-failure RestartSec=300