Skip to content

Commit

Permalink
Catch missing brokerage data config if used as IDQH only
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Molinero committed Sep 13, 2024
1 parent f691001 commit 9d24d2d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public void SetJob(LiveNodePacket job)
// required for trading
job.BrokerageData.TryGetValue("alpaca-access-token", out var accessToken);

var usePaperTrading = Convert.ToBoolean(job.BrokerageData["alpaca-paper-trading"]);
// might not be there if only used as a data source
var usePaperTrading = job.BrokerageData.TryGetValue("alpaca-paper-trading", out var usePaper) && Convert.ToBoolean(usePaper);

Initialize(apiKey, secretKey, accessToken, usePaperTrading, null, null);
if (!IsConnected)
Expand Down

0 comments on commit 9d24d2d

Please sign in to comment.