public void CanCreateTakeProfitAndStopLimitOrder() { var q = new OrderTradeParams(Mother.SBRF, Direction.Sell, 1, 76.48m); var sq = new StopOrderTradeParams(q, 76.48m, Mother.STD_ProfitCondition, ExpiryDate.TODAY, 73.12m); var o = this.tb.NewTakeProfitAndStopLimitOrder(sq); Assert.IsFalse(String.IsNullOrEmpty(o.ToString())); }
public void CanCreateTakeProfitOrder() { var q = new OrderTradeParams(Mother.SBRF, Direction.Sell, 1); var sq = new StopOrderTradeParams(q, 76.48m, Mother.STD_ProfitCondition); var o = this.tb.NewTakeProfitOrder(sq); Console.WriteLine(o); Assert.IsNotEmpty(o.ToString()); }
public void CanSendTakeProfitOrder() { var cw = new ConnectionListener(Mother.CONST_PathToQuik); Assert.IsTrue(cw.Connect()); var tw = new TransactionManager(); var q = new OrderTradeParams(Mother.SBRF, Direction.Sell, 1); var sq = new StopOrderTradeParams(q, 76.48m, Mother.STD_ProfitCondition); var txn = tBuilder.NewTakeProfitOrder(sq); var res = tw.SendSyncTransaction(txn.ToString()); Console.WriteLine("{0}", res); Assert.IsTrue(res.ReturnValue.IsSuccess); }
public void CanSendTakeProfitAndStopLimitMarketOrder() { var cw = new ConnectionListener(Mother.CONST_PathToQuik); Assert.IsTrue(cw.Connect()); var tw = new TransactionManager(); var q = new OrderTradeParams(Mother.SBRF, Direction.Sell, 1); var pq = new ProfitCondition(0.1m, Units.PriceUnits, true, true); var sq = new StopOrderTradeParams(q, 76.48m, pq, ExpiryDate.TODAY, 73.12m); var txn = tBuilder.NewTakeProfitAndStopLimitOrder(sq); var res = tw.SendSyncTransaction(txn.ToString()); Console.WriteLine("{0}", res); Assert.IsTrue(res.ReturnValue.IsSuccess); }
public void Sample03() { var gateway = new Gateway(@"C:\Quik", "LXX+XXXXXXXXX"); gateway.NewTransaction += OnNewTransaction; gateway.Start(); var security = new Security("TQBR", "SBER"); var tradeParams = new OrderTradeParams(security, Direction.Buy, 1); gateway.SendOrder(tradeParams); // Купить по рынку 10 акций Сбербанка // Выставить стоп-лимит: продать 10 акций Сбербанка по 75.10. Активировать при наступлении цены 75.12 var stop = new StopOrderTradeParams(new OrderTradeParams(security, Direction.Sell, 1, 75.10m), 75.12m); gateway.SendStopLimitOrder(stop); Thread.Sleep(10000); }
public StopOrder NewTakeProfitAndStopLimitOrder(StopOrderTradeParams tradeParams) { return(new StopOrder(this.GetNextId(), this.Account, StopOrderKind.TakeProfitAndStopLimit).SetStopOrderTradeParams(tradeParams)); }
public StopOrder NewStopLimitOrder(StopOrderTradeParams tradeParams) { return(new StopOrder(this.GetNextId(), this.Account, StopOrderKind.Simple).SetStopOrderTradeParams(tradeParams)); }