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