I had a cron file that worked beautifully for a long time
TWS_LIVE_PORT=7496
SHELL=/bin/bash
20 9 * * 1-5 export DISPLAY=:1 && /bin/bash /opt/ibc/tws_live_start.sh
22 9 * * 1-5 cd ~/execution/samples/Cpp/data_logger/; ./data_logger_static 127.0.0.1 $TWS_LIVE_PORT &> SPY-STK.csv?
This would write a bunch of data to SPY-STK.csv After not changing the program at all and not recompiling it, I figured this would work after making the switch to ibgateway
GATEWAY_LIVE_PORT=4001
SHELL=/bin/bash
20 9 * * 1-5 export DISPLAY=:1 && /bin/bash /opt/ibc/gateway_live_start.sh
22 9 * * 1-5 cd ~/execution/samples/Cpp/data_logger/; ./data_logger_static 127.0.0.1 $GATEWAY_LIVE_PORT &> SPY-STK.csv?
I believe this is some IBC setting issue. I had to edit the new startup scripts, but I'm keeping the same config files that were used with TWS. Either that or there is some different type of behavior for how IBC treats ibgateway versus TWS.
I can confirm that Ibgateway is on, the client app is connected, no data feed is reported broken by ibgateway, and that tech support at IBKR confirms they receive my data requests at exactly 9:22 eastern.? It's difficult to reproduce this behavior, too. I can manually type in that command, and it spits out data just fine to the console, without redirecting its output. Sometimes I can run it again from within cron, at a later time, and it writes just fine to SPY-STK.csv