static void OrdSellStopLimit(int bar, int orderIf, int toPos, double lots, double price1, double price2, OrderSender sender, OrderOrigin origin, string note)
{
int sessionOrder = session[bar].Orders;
Order order = session[bar].Order[sessionOrder] = new Order();
order.OrdNumb = totalOrders;
order.OrdDir = OrderDirection.Sell;
order.OrdType = OrderType.StopLimit;
order.OrdCond = orderIf > 0 ? OrderCondition.If : OrderCondition.Norm;
order.OrdStatus = OrderStatus.Confirmed;
order.OrdIF = orderIf;
order.OrdPos = toPos;
order.OrdLots = lots;
order.OrdPrice = Math.Round(price1, InstrProperties.Digits);
order.OrdPrice2 = Math.Round(price2, InstrProperties.Digits);
order.OrdSender = sender;
order.OrdOrigin = origin;
order.OrdNote = note;
ordCoord[totalOrders].Bar = bar;
ordCoord[totalOrders].Ord = sessionOrder;
session[bar].Orders++;
totalOrders++;
}