Static Orders Request
For the convenience of usage, the plotting of the most commonly used trading orders was moved to the separate static methods of the class NewOrderRequest. It can be used when we need to buy or to sell something and we don’t need to set comments, protective orders, slippage and etc. That's part of the code that is responsible for the plotting of the order:
NewOrderRequest BuyLimit = NewOrderRequest.CreateBuyLimit(Instruments.Current, 1, lastQuote.Bid - 40 * tickSize, Accounts.Current); NewOrderRequest BuyMarket = NewOrderRequest.CreateBuyMarket(Instruments.Current, 1, Accounts.Current); NewOrderRequest BuyStop = NewOrderRequest.CreateBuyStop(Instruments.Current, 1, lastQuote.Bid + 40 * tickSize, Accounts.Current); NewOrderRequest SellLimit = NewOrderRequest.CreateSellLimit(Instruments.Current, 1, lastQuote.Ask + 40 * tickSize, Accounts.Current); NewOrderRequest SellMarket = NewOrderRequest.CreateSellMarket(Instruments.Current, 1, Accounts.Current); NewOrderRequest SellStop = NewOrderRequest.CreateSellStop(Instruments.Current, 1, lastQuote.Ask - 40 * tickSize, Accounts.Current);
After plotting the order, it can be sent by methods of the class Orders, for example,
Orders.Send(NewOrderRequest request)
No replies yet
Join PTMC community to post your replies on forum