Module: IB::Pegged2Stock

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

Class Method Summary collapse

Methods included from OrderPrototype

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

Class Method Details

.aliasesObject



91
92
93
# File 'lib/ib/order_prototypes/pegged.rb', line 91

def aliases
	Limit.aliases.merge  limit_price: :stock_reference_price
end

.defaultsObject



87
88
89
# File 'lib/ib/order_prototypes/pegged.rb', line 87

def defaults
	  super.merge order_type: 'PEG STK' 
end

.optionalObject



101
102
103
104
105
106
# File 'lib/ib/order_prototypes/pegged.rb', line 101

def optional
	 super.merge limit_price: 'Stock Reference Price',
	   stock_ref_price: '',
	   stock_range_lower: 'Lowest acceptable Stock Price',
	   stock_range_upper: 'Highest accepable Stock Price'
end

.requirementsObject



95
96
97
98
99
# File 'lib/ib/order_prototypes/pegged.rb', line 95

def requirements
	super.merge total_quantity: :decimal, 
delta: 'required Delta of the Option', 
starting_price: 'initial Limit-Price for the Option' 
end

.summaryObject



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/ib/order_prototypes/pegged.rb', line 108

def summary
	<<-HERE
	Options ONLY
	------------
	A Pegged to Stock order continually adjusts the option order price by the product of a signed user-
	defined delta and the change of the option's underlying stock price. 
	The delta is entered as an absolute and assumed to be positive for calls and negative for puts.
	A buy or sell call order price is determined by adding the delta times a change in an underlying stock
	price to a specified starting price for the call.
	To determine the change in price, the stock reference price is subtracted from the current NBBO 
	midpoint. The Stock Reference Price can be defined by the user, or defaults to the 
	the NBBO midpoint at the time of the order if no reference price is entered.
	You may also enter a high/low stock price range which cancels the order when reached. The 
	delta times the change in stock price will be rounded to the nearest penny in favor of the order.
	------------
	Supported Exchanges: (as of Jan 2018):  BOX, NASDAQOM, PHLX
	HERE
end