Forex_Strategy_Builder.Backtester.OrdBuyMarket C# (CSharp) Метод

OrdBuyMarket() статический приватный Метод

Sets a new order Buy Market.
static private OrdBuyMarket ( 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
Результат void
        static void OrdBuyMarket(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.Buy;
            order.OrdType   = OrderType.Market;
            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++;
        }