Generic Broker: sellStopLimit()

ICE Data Services -

sellStopLimit()
Previous  Top  Next

sellStopLimit( symbol, quantity, stop, limit [, route] [, expiry] )
Submit a stop/limit order to broker.

Parameters

symbol
the symbol for which to initiate the trade
quantity
the number of shares/contracts
stop
the stop price
limit
the limit price, must be <= stop price
route
optional. the route or exchange for the trade (broker specific)
expiry
optional. expiration for the order:

SB_DAY
SB_GTC
SB_IOC



Usage

sellStopLimit( "IDC"10015.0014.50 ); 
sellStopLimit( getSymbol(), 
20098.7598.00null, SB_GTC );

 

Interactive Broker Examples

var myStop = getMostRecentTrade().toFixed(4);

var myLimit = myStop - 0.25; 

sellStopLimit(getSymbol(), 100, myStop, myLimit);  // Equities

sellStopLimit(getSymbol(), 1, myStop, myLimit, "GLOBEX", "200506");  // Futures