开云体育For a sell order, you only use stop or stoplimit when the market is above the trigger price (ie the AuxPrice). When the price drops to the trigger price, either a market or a limit order is then entered into the exchange. So you can use this to exit from a long position (this is typically a stop-loss, but it can alternatively be a profit taker if the position is currently in profit). ? You can use a buy stop or stoplimit to enter a new position, in which case market price must be below the trigger price. ? Be careful not to confuse a stop or stoplimit ?order with a ‘stop-loss’ order: stop and stoplimit orders are specific types of order, whereas a stop-loss order is really a mode of operating that protects a position against excessive loss, and can be of several different types. ? Note also that a market- or limit--if-touched order can also be used either to enter or exit a position, but you wouldn’t use it as a stop-loss. I’ll leave you to think about why that is. You need to make sure you have a clear understanding of these different order types. ? But here’s an example: suppose the market is trading in a range, and you want to catch a breakout from that range in either direction: you could use a sell stop with trigger 1-tick below the bottom of the range, and a buy stop with trigger 1-tick above the high of the range. And you would put both orders in an OCA group so if one order fills, the other is cancelled. ? ? ? ? From: [email protected] <[email protected]> On Behalf Of Danny via groups.io
Sent: 22 November 2024 18:01 To: [email protected] Subject: Re: [TWS API] API call: Error validating request.-'bF' : cause - Please enter a stop price ? ? ? thanks ? Can I use a 'stop limit' for my 2 SELL calls? (one for a stop above the current market and another for below the current market, whichever reaches first) Here it says that a 'stop limit' can only be used for a stop at a price below?the current market, and to use 'Limit if Touched' for a SELL for a price above the current market ? ? Limit if TouchedA??is an order to buy (or sell) a contract at a specified price or better, below (or above) the market. This order is held in the system until the trigger price is touched. An LIT order is similar to a stop limit order, except that an LIT sell order is placed above the current market price, and a stop limit sell order is placed below.
·?????????????????????? Order order = new Order(); order.Action = action; order.OrderType = "LIT"; order.TotalQuantity = quantity; order.LmtPrice = limitPrice; order.AuxPrice = triggerPrice; ? ? |