qc 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +0 -4
- data/lib/qc/backtest.rb +4 -0
- data/lib/qc/command_runner.rb +22 -3
- data/lib/qc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff30871c8e3cbbc76ca56e8486a54f1ecc6641b1
|
4
|
+
data.tar.gz: 6d537c573492c6d28283fdfdf781ef2e85b099e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7520488335e8ed3ebb1dd726c2721d4f5426b103c419d9e18ff15bb87711a3445dc2bc69de3f67ba09ec0739b70618c68aa935996eb9f9777cd34533e0821d0f
|
7
|
+
data.tar.gz: 62cd3d02352a350b0258fcd335caa094cf21da8a92295c2b7cacdfcc33511b0eb50e080caeed35587270c4c336efd1de8877e5ecfd451017e59c33aed0dcb1c7
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -47,10 +47,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
47
47
|
|
48
48
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
49
49
|
|
50
|
-
## Contributing
|
51
|
-
|
52
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/qc.
|
53
|
-
|
54
50
|
## License
|
55
51
|
|
56
52
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/qc/backtest.rb
CHANGED
data/lib/qc/command_runner.rb
CHANGED
@@ -4,7 +4,7 @@ module Qc
|
|
4
4
|
|
5
5
|
SUPPORTED_COMMANDS =%i(login logout init push compile backtest)
|
6
6
|
COMPILE_POLLING_DELAY_IN_SECONDS = 2
|
7
|
-
BACKTEST_DELAY_IN_SECONDS =
|
7
|
+
BACKTEST_DELAY_IN_SECONDS = 3
|
8
8
|
|
9
9
|
attr_reader :quant_connect_proxy
|
10
10
|
attr_accessor :project_settings
|
@@ -102,6 +102,8 @@ module Qc
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def run_push
|
105
|
+
show_title('Push files')
|
106
|
+
|
105
107
|
return false unless validate_initialized_project!
|
106
108
|
|
107
109
|
sync_changed_files
|
@@ -110,6 +112,7 @@ module Qc
|
|
110
112
|
end
|
111
113
|
|
112
114
|
def run_compile
|
115
|
+
show_title('Compile')
|
113
116
|
return false unless validate_initialized_project!
|
114
117
|
|
115
118
|
compile = quant_connect_proxy.create_compile project_settings.project_id
|
@@ -131,6 +134,7 @@ module Qc
|
|
131
134
|
end
|
132
135
|
|
133
136
|
def run_backtest
|
137
|
+
show_title('Run backtest')
|
134
138
|
return false unless validate_initialized_project!
|
135
139
|
|
136
140
|
unless project_settings.last_compile_id
|
@@ -151,12 +155,23 @@ module Qc
|
|
151
155
|
!failed
|
152
156
|
end
|
153
157
|
|
158
|
+
def show_title(title)
|
159
|
+
separator = '-' * title.length
|
160
|
+
puts "\n#{separator}"
|
161
|
+
puts title
|
162
|
+
puts "#{separator}\n"
|
163
|
+
end
|
164
|
+
|
154
165
|
def do_run_backtest
|
155
166
|
backtest = quant_connect_proxy.create_backtest project_settings.project_id, project_settings.last_compile_id, "backtest-#{project_settings.last_compile_id}"
|
156
167
|
puts "Backtest for compile #{project_settings.last_compile_id} sent to the queue with id #{backtest.id}"
|
157
168
|
|
158
169
|
begin
|
159
|
-
|
170
|
+
if backtest.started?
|
171
|
+
puts "Waiting for backtest to finish (#{backtest.progress_in_percentage}\% completed)..."
|
172
|
+
else
|
173
|
+
puts "Waiting for backtest to start..."
|
174
|
+
end
|
160
175
|
backtest = quant_connect_proxy.read_backtest project_settings.project_id, backtest.id
|
161
176
|
sleep BACKTEST_DELAY_IN_SECONDS if backtest.completed?
|
162
177
|
end while !backtest.completed?
|
@@ -213,8 +228,12 @@ module Qc
|
|
213
228
|
|
214
229
|
|
215
230
|
def sync_changed_files
|
231
|
+
if changed_files.empty?
|
232
|
+
puts "No changes detected"
|
233
|
+
end
|
234
|
+
|
216
235
|
changed_files.each do |file|
|
217
|
-
puts "
|
236
|
+
puts "Uploading #{file}..."
|
218
237
|
content = ::File.read file
|
219
238
|
quant_connect_proxy.put_file project_settings.project_id, file, content
|
220
239
|
end
|
data/lib/qc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jorge Manrubia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|