I want to know how I can automatically run the entire script of historical data fetching process after it gives exit code -1 due to no internet connection. in Tick data fetching process it retry itself to connect to websocket since I am not using def on_close fn in that code
We don't have a retry mechanism in historical data requests out of the box. You will have to handle the above exception at your end and retry with some sleep time in between consecutive requests.