Class: DeGiro::CreateOrder
- Inherits:
-
Object
- Object
- DeGiro::CreateOrder
- Defined in:
- lib/degiro_client/create_order.rb
Constant Summary collapse
- BUY_SELL =
{ buy: "BUY", sell: "SELL" }.freeze
- ORDER_TYPES =
{ limited: 0, stop_limited: 1, market_order: 2, stop_loss: 3 }.freeze
- TIME_TYPES =
{ day: 1, permanent: 3 }.freeze
Instance Method Summary collapse
- #create_buy_order(product_id:, size:, price:) ⇒ Object
- #create_sell_order(product_id:, size:, price:) ⇒ Object
-
#initialize(connection) ⇒ CreateOrder
constructor
A new instance of CreateOrder.
Constructor Details
#initialize(connection) ⇒ CreateOrder
Returns a new instance of CreateOrder.
9 10 11 |
# File 'lib/degiro_client/create_order.rb', line 9 def initialize(connection) @connection = connection end |
Instance Method Details
#create_buy_order(product_id:, size:, price:) ⇒ Object
13 14 15 |
# File 'lib/degiro_client/create_order.rb', line 13 def create_buy_order(product_id:, size:, price:) create_order_with_confirmation(BUY_SELL[:buy], product_id, size, price) end |
#create_sell_order(product_id:, size:, price:) ⇒ Object
17 18 19 |
# File 'lib/degiro_client/create_order.rb', line 17 def create_sell_order(product_id:, size:, price:) create_order_with_confirmation(BUY_SELL[:sell], product_id, size, price) end |