Forex_Strategy_Builder.Backtester.OrdSellLimit C# (CSharp) Method

OrdSellLimit() static private method

Sets a new order Sell Limit.
static private OrdSellLimit ( int bar, int orderIf, int toPos, double lots, double price, OrderSender sender, OrderOrigin origin, string note ) : void
bar int
orderIf int
toPos int
lots double
price double
sender OrderSender
origin OrderOrigin
note string
return void
        static void OrdSellLimit(int bar, int orderIf, int toPos, double lots, double price, 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.Limit;
            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(price, InstrProperties.Digits);
            order.OrdPrice2 = 0;
            order.OrdSender = sender;
            order.OrdOrigin = origin;
            order.OrdNote   = note;

            ordCoord[totalOrders].Bar = bar;
            ordCoord[totalOrders].Ord = sessionOrder;
            session[bar].Orders++;
            totalOrders++;
        }