Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def bar_handler(self, _, bar):
if self.time != bar.end_time:
raise RegressionTestException(f"Unexpected consolidation time {bar.Time} != {Time}!")

self.debug(f"{self.Time} - Consolidation")
self.debug(f"{self.time} - Consolidation")
expected = self._expectedConsolidationTime.pop()
if bar.time.time() != expected:
raise RegressionTestException(f"Unexpected consolidation time {bar.time.time()} != {expected}!")
Expand Down
9 changes: 7 additions & 2 deletions Common/Brokerages/BrokerageMessageType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public enum BrokerageMessageType
/// <summary>
/// Brokerage disconnected from remote server (4)
/// </summary>
Disconnect
Disconnect,

/// <summary>
/// Action required by the user (5)
/// </summary>
ActionRequired,
}
}
}
5 changes: 5 additions & 0 deletions Common/Brokerages/DefaultBrokerageMessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ where exchange.IsOpenDuringBar(
_cancellationTokenSource.Cancel();
}
break;

case BrokerageMessageType.ActionRequired:
// not supported atm
_algorithm.SetRuntimeError(new Exception("Brokerage requires user action"), Messages.DefaultBrokerageMessageHandler.BrokerageDisconnectedShutDownContext);
break;
}
}

Expand Down
1 change: 1 addition & 0 deletions Engine/Setup/BrokerageSetupHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public IBrokerage CreateBrokerage(AlgorithmNodePacket algorithmNodePacket, IAlgo

// initialize the correct brokerage using the resolved factory
var brokerage = _factory.CreateBrokerage(liveJob, uninitializedAlgorithm);
Composer.Instance.AddPart(brokerage);

return brokerage;
}
Expand Down
Loading