Module: IB::Pegged2Market

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



56
57
58
# File 'lib/ib/order_prototypes/pegged.rb', line 56

def aliases
	Limit.aliases.merge  aux_price: :market_offset
end

.defaultsObject



52
53
54
# File 'lib/ib/order_prototypes/pegged.rb', line 52

def defaults
	  super.merge order_type: 'PEG MKT' , tif: :day
end

.optionalObject



64
65
66
# File 'lib/ib/order_prototypes/pegged.rb', line 64

def optional
	 super
end

.requirementsObject



60
61
62
# File 'lib/ib/order_prototypes/pegged.rb', line 60

def requirements
	super.merge aux_price: :decimal
end

.summaryObject



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/ib/order_prototypes/pegged.rb', line 68

def summary
	<<-HERE
	A pegged-to-market order is designed to maintain a purchase price relative to the
	national best offer (NBO) or a sale price relative to the national best bid (NBB).
	Depending on the width of the quote, this order may be passive or aggressive.
	The trader creates the order by entering a limit price which defines the worst limit
	price that they are willing to accept.
	Next, the trader enters an offset amount which computes the active limit price as follows:
	   Sell order price = Bid price + offset amount
	   Buy order price = Ask price - offset amount
	HERE
end