public ArbitrageSettings() : this(SerialIntegerFactory.Make(), new List <StrategyHeader>(), new List <StrategyHeader>(), new SpreadSettings()) { }
public Order(Signal signal, int timeToLiveSeconds) : this(SerialIntegerFactory.Make(), BrokerDateTime.Make(DateTime.Now), signal.Strategy.Portfolio, signal.Strategy.Symbol, signal.TradeAction, signal.OrderType, signal.Amount, signal.Limit, signal.Stop) { this.Signal = signal; this.SignalId = signal.Id; this.ExpirationDate = BrokerDateTime.Make(DateTime.Now).AddSeconds(timeToLiveSeconds); }
public OrderCancellationRequest(Order order, string description) { this.Id = SerialIntegerFactory.Make(); this.OrderId = order.Id; this.Order = order; this.Description = description; this.DateTime = BrokerDateTime.Make(DateTime.Now); }
public OrderCancellationConfirmation(Order order, DateTime cancelDate, string description) { this.Id = SerialIntegerFactory.Make(); this.OrderId = order.Id; this.Order = order; this.Description = description; this.DateTime = cancelDate; }
public SMASettings(StrategyHeader strategyHeader, int periodFast, int periodSlow) { this.Id = SerialIntegerFactory.Make(); this.Strategy = strategyHeader; this.StrategyId = strategyHeader.Id; this.PeriodFast = periodFast; this.PeriodSlow = periodSlow; }
public OrderRejection(Order order, DateTime rejectionDate, string description) { this.Id = SerialIntegerFactory.Make(); this.DateTime = rejectionDate; this.OrderId = order.Id; this.Order = order; this.Description = description; }
public OrderCancellationFailedNotification(Order order, DateTime failedDate, string description) { this.Id = SerialIntegerFactory.Make(); this.DateTime = failedDate; this.Description = description; this.Order = order; this.OrderId = order.Id; }
public void SerialInteger_Values_Are_Not_Equals() { int first = SerialIntegerFactory.Make(); int second = SerialIntegerFactory.Make(); Assert.AreNotEqual(first, second); Assert.IsTrue(first + 1 == second); }
/// <summary> /// NoTest /// </summary> /// <param name="strategyHeader">strategyHeader</param> /// <param name="symbol">symbol</param> /// <param name="interval">Длительность бара</param> /// <param name="period">Количество баров</param> /// <param name="barType">Тип бара</param> public BarSettings(StrategyHeader strategyHeader, string symbol, int interval, int period, DataModelType barType) { this.Id = SerialIntegerFactory.Make(); this.Symbol = symbol; this.Interval = interval; this.Period = period; this.StrategyId = strategyHeader.Id; this.Strategy = strategyHeader; this.BarType = barType; }
public MoveOrder(Order order, double price, DateTime date, string description) { this.Id = SerialIntegerFactory.Make(); this.DateTime = date; this.Order = order; this.OrderId = order.Id; this.Price = price; this.DeliveryDate = DateTime.MinValue; this.MoveDate = DateTime.MinValue; this.Description = description; }
public OrderMoveRequest(Order order, double limitPrice, double stopPrice, string description) { this.Id = SerialIntegerFactory.Make(); this.Order = order; this.OrderId = order.Id; this.DateTime = BrokerDateTime.Make(DateTime.Now); this.LimitPrice = limitPrice; this.StopPrice = stopPrice; this.Description = description; this.DeliveryDate = DateTime.MinValue; this.ExpirationDate = this.DateTime.AddSeconds(60); this.FaultDate = DateTime.MinValue; this.FaultDescription = string.Empty; }
private BidAsk MakeBidAsk(UpdateBidAsk src) { return(new BidAsk { Symbol = src.Symbol, Row = src.Row, NRows = src.NRows, Bid = src.Bid, BidSize = src.BidSize, Ask = src.Ask, AskSize = src.AskSize, DateTime = BrokerDateTime.Make(DateTime.Now), Id = SerialIntegerFactory.Make() }); }
//public Signal(StrategyHeader strategyHeader, DateTime date, TradeAction action, OrderType type, double price, double stop, double limit, long? barId = null, Bar bar = null) public Signal(StrategyHeader strategyHeader, DateTime date, TradeAction action, OrderType type, double price, double stop, double limit, long barDateId, Bar bar) { this.Id = SerialIntegerFactory.Make(); this.StrategyId = strategyHeader.Id; this.Strategy = strategyHeader; this.DateTime = date; this.TradeAction = action; this.OrderType = type; this.Amount = strategyHeader.Amount; this.Price = price; this.Stop = stop; this.Limit = limit; this.BarDateId = barDateId; this.Bar = bar; }
public Trade(Order order, string portfolio, string symbol, double price, double amount, DateTime date) { this.Id = SerialIntegerFactory.Make(); this.Portfolio = portfolio; this.Symbol = symbol; this.Price = price; this.Amount = amount; this.DateTime = date; this.Order = order; if (order != null) { this.OrderId = order.Id; } }
public void Order_IsClosePosition() { RawOrder order = new RawOrder { Portfolio = "PRTF", Symbol = "SBER", Action = SmartCOM3Lib.StOrder_Action.StOrder_Action_Sell, Type = SmartCOM3Lib.StOrder_Type.StOrder_Type_Market, Validity = SmartCOM3Lib.StOrder_Validity.StOrder_Validity_Day, Price = 0, Amount = 1, Stop = 0, Cookie = SerialIntegerFactory.Make() }; Assert.IsFalse(order.RequestsOpenPosition()); Assert.IsTrue(order.RequestsClosePosition()); }
public void UpdateQuotesOnBidAsk_handle_add_records_for_registered_symbol() { BidAsk bidAskOne = new BidAsk { Id = SerialIntegerFactory.Make(), Symbol = "RTS-9.13_FT", DateTime = BrokerDateTime.Make(DateTime.Now), Row = 0, NRows = 10, Ask = 150010, AskSize = 300, Bid = 150000, BidSize = 100 }; this.tradingData.Get <ObservableCollection <BidAsk> >().Add(bidAskOne); double resultBidPrice = storage.GetBidPrice(bidAskOne.Symbol, 0); double resultBidVolume = storage.GetBidVolume(bidAskOne.Symbol, 0); double resultOfferPrice = storage.GetOfferPrice(bidAskOne.Symbol, 0); double resultOfferVolume = storage.GetOfferVolume(bidAskOne.Symbol, 0); Assert.AreEqual(bidAskOne.Bid, resultBidPrice); Assert.AreEqual(bidAskOne.BidSize, resultBidVolume); Assert.AreEqual(bidAskOne.Ask, resultOfferPrice); Assert.AreEqual(bidAskOne.AskSize, resultOfferVolume); }
public void SerialIntegerFactory_Makes_Value_Greater_Than_Zero() { int cookie = SerialIntegerFactory.Make(); Assert.IsTrue(cookie > 0); }
public Position(string portfolio, string symbol, double amount) : this(SerialIntegerFactory.Make(), portfolio, symbol, amount) { }
public Order(Signal signal) : this(SerialIntegerFactory.Make(), BrokerDateTime.Make(DateTime.Now), signal.Strategy.Portfolio, signal.Strategy.Symbol, signal.TradeAction, signal.OrderType, signal.Amount, signal.Limit, signal.Stop) { this.Signal = signal; this.SignalId = signal.Id; }
public Order() { this.Id = SerialIntegerFactory.Make(); this.ExpirationDate = new FortsTradingSchedule().SessionEnd; }