robinhood_rails 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1b9e5870c599e402afcdd773cb765bd988ebc79
4
- data.tar.gz: 56214477bfe12548f367115fa3b9aca6c393eadd
3
+ metadata.gz: 6058301b5f615b03859ec6560c3f75616a8bba3c
4
+ data.tar.gz: df048490be906619de8ce2662404fec10327b8b3
5
5
  SHA512:
6
- metadata.gz: 2f217290bbbce708ce45fb281e88e69b6e8b8e5f087519281b492cc807ab0f56ed8d718b73075e47a1ebcc5a2521e8a84aceb04624572285b2c0f4c4bfc1e5e9
7
- data.tar.gz: 06d0ad67e6be9a406d9f5fa95658e9af294d0cf052a0f8895f68549d36ac666d75b96ccb64493ef12a22a6fa585f41b4c5ebc8bc58c5b982ca0671fc93a3d1e1
6
+ metadata.gz: 70cfe1dc42b20274ef48bddedc6e2fc852165831d55a7dd769891fc27fc429a7102a86e4c899fcef0c05451f9caaf1a111189cb5e0632eff1cff47236b0012c6
7
+ data.tar.gz: 61f9a3ab86711036ab2ecc12092947a07a46c3348d042bb1848c21bbbc0574a587a575cabefb9900d01224a3a1ab652a96dc4a2360c423bb593cc24c704e933d
@@ -141,6 +141,24 @@ class Robinhood
141
141
  )
142
142
  end
143
143
 
144
+ def stop_loss_sell(symbol, instrument_id, price, quantity)
145
+ raw_response = HTTParty.post(
146
+ endpoints[:orders],
147
+ body: {
148
+ 'account' => "https://api.robinhood.com/accounts/#{ENV['ROBINHOOD_ACCOUNT_NUMBER']}/",
149
+ 'instrument' => "https://api.robinhood.com/instruments/#{instrument_id}/",
150
+ 'stop_price' => price,
151
+ 'quantity' => quantity,
152
+ 'side' => "sell",
153
+ 'symbol' => symbol,
154
+ 'time_in_force' => 'gfd',
155
+ 'trigger' => 'stop',
156
+ 'type' => 'market'
157
+ }.as_json,
158
+ headers: headers
159
+ )
160
+ end
161
+
144
162
  def cancel_order(order_id)
145
163
  raw_response = HTTParty.post("https://api.robinhood.com/orders/#{order_id}/cancel/", headers: headers)
146
164
  raw_response.code == 200
@@ -1,3 +1,3 @@
1
1
  module RobinhoodRails
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robinhood_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nemrow