Module: IB::TrailingStopLimit

Extended by:
OrderPrototype
Defined in:
lib/ib/order_prototypes/stop.rb

Overview

module

Class Method Summary collapse

Methods included from OrderPrototype

aliases, alternative_parameters, defaults, optional, order, parameters, requirements

Class Method Details

.aliasesObject



151
152
153
# File 'lib/ib/order_prototypes/stop.rb', line 151

def aliases
	Limit.aliases 
end

.alternative_parametersObject



161
162
163
164
# File 'lib/ib/order_prototypes/stop.rb', line 161

def alternative_parameters
	{ aux_price: 'Trailing distance in absolute terms',
trailing_percent: 'Trailing distance in relative terms'}
end

.defaultsObject



147
148
149
# File 'lib/ib/order_prototypes/stop.rb', line 147

def defaults
	super.merge order_type: :trailing_limit , tif: :day
end

.requirementsObject



155
156
157
158
159
# File 'lib/ib/order_prototypes/stop.rb', line 155

def requirements
	super.merge trail_stop_price: 'Price to trigger the action',
							limit_price_offset: 'a pRICE'

end

.summaryObject



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/ib/order_prototypes/stop.rb', line 166

def summary
	<<-HERE
		 A trailing stop limit order is designed to allow an investor to specify a
		 limit on the maximum possible loss, without setting a limit on the maximum
		 possible gain. A SELL trailing stop limit moves with the market price, and
		 continually recalculates the stop trigger price at a fixed amount below
		 the market price, based on the user-defined "trailing" amount. The limit
		 order price is also continually recalculated based on the limit offset. As
		 the market price rises, both the stop price and the limit price rise by
		 the trail amount and limit offset respectively, but if the stock price
		 falls, the stop price remains unchanged, and when the stop price is hit a
		 limit order is submitted at the last calculated limit price. A "Buy"
		 trailing stop limit order is the mirror image of a sell trailing stop
		 limit, and is generally used in falling markets.

 Products: BOND, CFD, CASH, FUT, FOP, OPT, STK, WAR
	HERE
end