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 9b8e67f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ 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"]);
var usePaperTrading = false;
// might not be there if only used as a data source
if (job.BrokerageData.TryGetValue("alpaca-paper-trading", out var usePaper))
{
usePaperTrading = Convert.ToBoolean(usePaper);
}

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

0 comments on commit 9b8e67f

Please sign in to comment.