ish_models 0.0.33.124 → 0.0.33.127

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
  SHA256:
3
- metadata.gz: 35459299824c6a97ec3ce04cec7f6520c22f2436abe31c05c79da1fbf3a06531
4
- data.tar.gz: 78ff2ffd1c1cd0af68ed1c0ff5834ced257d9e0bf4577fa87effadde7aec432b
3
+ metadata.gz: d025168334524e77a95ebd65c77aca9f238357650a60e1ac34d96a98fab70393
4
+ data.tar.gz: 880e8151b3f6c11dc6dd43e1b39a1b856ddf18a0f69b8029830a6b224007dd5f
5
5
  SHA512:
6
- metadata.gz: 277faf04cfeadeb5013f2878c5ba8864d130a36e5cab27e1965809b9777a4575089f6afe3f0e1b1367b231d3e63a54e8443491d67d5cc615ef833132f6bb237a
7
- data.tar.gz: 9139f650b1fef7c692f3b897eae909029720aa3f4ee9793ee8784157819157ac47220cde0230d840db754a1d7622c0fabca928a67122d21805f4a7d1be8fdc57
6
+ metadata.gz: 9b5c590ad879d8841b94f9f6c293a24b6ded2a00f085b10704bc55c855954ef89ef324c010e117feaefcfa9da8d9691b0ecafe1220d665406bb748c82cda4ccc
7
+ data.tar.gz: fe93fcd905f544f3d584055b6e07ea826e42d451be19e446433ff8db05ff504340a3348087c72a0a2412f60f80c2da662f3efd0a771ad97bcc9f06689bc09142
@@ -0,0 +1,43 @@
1
+
2
+ #
3
+ # * make calls every once in a while
4
+ # * If the option price dips below a threshold, close the position (create the order to buy back the option)
5
+ #
6
+
7
+ # cron job or service? Well, I've historically done service. Cron is easier tho. The wiring should be for both.
8
+
9
+ module Ish::Ameritrade; end
10
+
11
+ class Ish::Ameritrade::Api
12
+ include HTTParty
13
+ base_uri 'api.tdameritrade.com'
14
+
15
+ def self.get_option_chain opts
16
+
17
+ # validate input
18
+ %i| apiKey symbol contrtactType strike fromDate toDate |.each do |s|
19
+ if !opts[s]
20
+ raise "invalid input, missing #{s}"
21
+ end
22
+ end
23
+
24
+ path = '/v1/marketdata/chains'
25
+ out = self.class.get path, opts
26
+ out
27
+ end
28
+
29
+ def self.main_fvrr_1
30
+ query_hash = {
31
+ apiKey: '',
32
+ symbol: 'FVRR',
33
+ contractType: 'PUT',
34
+ stike: 200,
35
+ fromDate: '2021-08-20',
36
+ toDate: '2021-08-20',
37
+ }
38
+ response = Ameritrade::Api.get_option_chain(query_hash)
39
+
40
+ puts! response, 'ze repsonse'
41
+ end
42
+
43
+ end
data/lib/ish_models.rb CHANGED
@@ -33,6 +33,7 @@ require 'gameui/map.rb'
33
33
  require 'gameui/marker.rb'
34
34
  require 'gameui/premium_purchase.rb'
35
35
 
36
+ require 'ish/ameritrade'
36
37
  require 'ish/covered_call'
37
38
  require 'ish/crawler.rb'
38
39
  require 'ish/gallery_name.rb'
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33.124
4
+ version: 0.0.33.127
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2017-05-10 00:00:00.000000000 Z
@@ -114,12 +114,12 @@ files:
114
114
  - lib/event.rb
115
115
  - lib/feature.rb
116
116
  - lib/gallery.rb
117
- - lib/gallery2.rb-trash
118
117
  - lib/gameui.rb
119
118
  - lib/gameui/map.rb
120
119
  - lib/gameui/marker.rb
121
120
  - lib/gameui/premium_purchase.rb
122
121
  - lib/ish/alphavantage_stockwatcher.rb
122
+ - lib/ish/ameritrade.rb
123
123
  - lib/ish/campaign.rb
124
124
  - lib/ish/covered_call.rb
125
125
  - lib/ish/covered_call_watcher.rb
@@ -154,7 +154,7 @@ homepage: http://wasya.co
154
154
  licenses:
155
155
  - MIT
156
156
  metadata: {}
157
- post_install_message:
157
+ post_install_message:
158
158
  rdoc_options: []
159
159
  require_paths:
160
160
  - lib
@@ -169,8 +169,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0'
171
171
  requirements: []
172
- rubygems_version: 3.0.6
173
- signing_key:
172
+ rubygems_version: 3.2.25
173
+ signing_key:
174
174
  specification_version: 4
175
175
  summary: models of ish
176
176
  test_files: []
@@ -1,101 +0,0 @@
1
-
2
- class Gallery2
3
- include ::Mongoid::Document
4
- include ::Mongoid::Timestamps
5
- store_in :collection => 'galleries'
6
-
7
- field :is_feature, :type => Boolean, :default => false
8
- field :is_public, :type => Boolean, :default => false
9
- field :is_done, :type => Boolean, :default => false
10
- field :is_trash, :type => Boolean, :default => false
11
-
12
- default_scope ->{ where({ :is_public => true, :is_trash => false }).order_by({ :created_at => :desc }) }
13
- index({ :is_public => 1, :is_trash => -1, :order_by => 1 })
14
-
15
- field :x, :type => Float
16
- field :y, :type => Float
17
-
18
- def self.list conditions = { :is_trash => false }
19
- out = self.where( conditions ).order_by( :created_at => :desc )
20
- [['', nil]] + out.map { |item| [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ] }
21
- end
22
-
23
- belongs_to :site
24
- validates :site, :presence => true
25
-
26
- belongs_to :user_profile, :optional => true, :class_name => 'IshModels::UserProfile'
27
- field :username, :type => String
28
-
29
- field :name, :type => String
30
- validates :name, :uniqueness => true # , :allow_nil => false
31
-
32
- field :galleryname, :type => String
33
- index({ :galleryname => -1 }, { :unique => true })
34
- embeds_many :gallery_names, :class_name => 'Ish::GalleryName'
35
-
36
- field :subhead, :type => String
37
- field :descr, :type => String, :as => :description
38
- field :lang, :type => String, :default => 'en'
39
-
40
- has_many :photos
41
-
42
- belongs_to :tag, :optional => true
43
- belongs_to :city, :optional => true
44
- belongs_to :venue, :optional => true
45
-
46
- has_many :newsitems
47
-
48
- set_callback(:create, :before) do |doc|
49
- if doc.user_profile && doc.user_profile.username
50
- doc.username = doc.user_profile.username
51
- end
52
- doc.galleryname ||= doc.id.to_s
53
-
54
- #
55
- # newsitems
56
- #
57
- if doc.is_public
58
- # for the sites
59
- if doc.site
60
- sites = Site.where( :domain => doc.site.domain )
61
- sites.each do |site|
62
- n = Newsitem.new {}
63
- n.gallery = doc
64
- n.username = doc.username
65
- site.newsitems << n
66
- flag = site.save
67
- if !flag
68
- puts! site.errors
69
- end
70
- end
71
- end
72
- # for the city
73
- if doc.city
74
- n = Newsitem.new {}
75
- n.gallery = doc
76
- n.city = doc.city
77
- n.username = doc.username
78
- n.save
79
- end
80
- end
81
-
82
- #
83
- # cache
84
- #
85
- if doc.site
86
- doc.site.touch
87
- end
88
- if doc.city
89
- doc.city.touch
90
- end
91
-
92
- end
93
-
94
- # @deprecated, use Gallery::ACTIONS
95
- def self.actions
96
- [ 'show_mini', 'show_long', 'show' ]
97
- end
98
- ACTIONS = [ 'show_mini', 'show_long', 'show' ]
99
-
100
- end
101
-