File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 88from alpaca .data .historical import OptionHistoricalDataClient
99from alpaca .data .requests import OptionLatestQuoteRequest
1010from zoneinfo import ZoneInfo
11+ import sys
1112
1213load_dotenv ()
1314GOOGLE_SCRIPT_URL = os .environ .get ("GOOGLE_SCRIPT_URL" )
@@ -119,7 +120,7 @@ def run_trade_workflow():
119120 clock = client .get_clock ()
120121 if not getattr (clock , 'is_open' , False ):
121122 print (f"Market is closed (next open at { clock .next_open } ). Exiting." )
122- return
123+ return 1
123124 print (f"Market is open (current time: { clock .timestamp } ). Continuing..." )
124125 # 1. Close due trades
125126 open_trades = get_open_trades ()
@@ -325,4 +326,4 @@ def run_trade_workflow():
325326 print (f"Error screening/opening AMC trade for { ticker } : { e } " )
326327
327328if __name__ == "__main__" :
328- run_trade_workflow ()
329+ sys . exit ( run_trade_workflow ())
You can’t perform that action at this time.
0 commit comments