コード例 #1
0
        //TODO: END -> ADD TO MODULE INTERFACE

        /// <summary>
        /// Gets the currently active order tickets.
        /// </summary>
        /// <param name="security">The security.</param>
        /// <returns></returns>
        public OrderTicket[] GetOrderTickets(Security security) => OrderTickets.Where(x => x.Security.Ticker == security.Ticker).ToArray();
コード例 #2
0
 /// <summary>
 /// Search the currently active order tickets.
 /// </summary>
 /// <param name="search">The search.</param>
 /// <returns></returns>
 public OrderTicket[] GetOrderTickets(Func <OrderTicket, bool> search) =>
 OrderTickets.Where(search).ToArray();
コード例 #3
0
ファイル: MaxOneActiveTicket.cs プロジェクト: w1r2p1/Core-2
 /// <summary>
 /// Check if we are allowed to perform trades
 /// </summary>
 /// <param name="security"></param>
 /// <returns></returns>
 public override bool IsTradingAllowed(Security security) =>
 OrderTickets.Count(x => x.Security == security && x.State != OrderTicketState.Processed) == 0;