1717using QuantConnect . Orders ;
1818using QuantConnect . Securities ;
1919using QuantConnect . Orders . Fees ;
20+ using System . Collections . Generic ;
2021
2122namespace QuantConnect . Brokerages
2223{
@@ -25,6 +26,18 @@ namespace QuantConnect.Brokerages
2526 /// </summary>
2627 public class WolverineBrokerageModel : DefaultBrokerageModel
2728 {
29+ /// <summary>
30+ /// Supported order types
31+ /// </summary>
32+ private HashSet < OrderType > SupportedOrderTypes { get ; } =
33+ [
34+ OrderType . Market ,
35+ OrderType . MarketOnClose ,
36+ OrderType . Limit ,
37+ OrderType . StopMarket ,
38+ OrderType . StopLimit
39+ ] ;
40+
2841 /// <summary>
2942 /// Constructor for Wolverine brokerage model
3043 /// </summary>
@@ -51,23 +64,18 @@ public override bool CanSubmitOrder(Security security, Order order, out Brokerag
5164 return false ;
5265 }
5366
54- message = null ;
55- if ( security . Type != SecurityType . Equity )
67+ if ( security . Type != SecurityType . Equity && security . Type != SecurityType . Option )
5668 {
5769 message = new BrokerageMessageEvent ( BrokerageMessageType . Warning , "NotSupported" ,
5870 Messages . DefaultBrokerageModel . UnsupportedSecurityType ( this , security ) ) ;
59-
6071 return false ;
6172 }
62-
63- if ( order . Type != OrderType . Market )
73+ if ( ! SupportedOrderTypes . Contains ( order . Type ) )
6474 {
6575 message = new BrokerageMessageEvent ( BrokerageMessageType . Warning , "NotSupported" ,
66- Messages . WolverineBrokerageModel . UnsupportedOrderType ( order ) ) ;
67-
76+ Messages . DefaultBrokerageModel . UnsupportedOrderType ( this , order , SupportedOrderTypes ) ) ;
6877 return false ;
6978 }
70-
7179 return base . CanSubmitOrder ( security , order , out message ) ;
7280 }
7381
0 commit comments