finexclub 0.5.3 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/finexclub.gemspec +2 -2
- data/lib/finexclub/app.rb +1 -1
- data/lib/finexclub/chart.rb +15 -13
- data/lib/finexclub/manager.rb +16 -13
- data/spec/finexclub/chart_spec.rb +78 -45
- data/spec/finexclub/manager_spec.rb +66 -45
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.5
|
data/finexclub.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{finexclub}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alex Levin"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-07}
|
13
13
|
s.default_executable = %q{finexclub_updater}
|
14
14
|
s.description = %q{Finexclub gem stores and retrieves Forex signals and screenshots. It is the heart of the http://trendsonforex.com and http://finexclub.net}
|
15
15
|
s.email = %q{clubfinex@gmail.com}
|
data/lib/finexclub/app.rb
CHANGED
@@ -26,7 +26,7 @@ module Finexclub
|
|
26
26
|
indicator_data = params[indicator].is_a?(Array) ? params[indicator] : [ params[indicator] ]
|
27
27
|
indicator_data.each do |s|
|
28
28
|
ap s.merge(:updated => Time.now.utc)
|
29
|
-
Finexclub.signals.
|
29
|
+
Finexclub.signals.store(indicator, s, Time.now.utc)
|
30
30
|
end
|
31
31
|
|
32
32
|
status 200
|
data/lib/finexclub/chart.rb
CHANGED
@@ -24,19 +24,30 @@ module Finexclub
|
|
24
24
|
self.class.handler_for(indicator)
|
25
25
|
end
|
26
26
|
|
27
|
-
def self.
|
27
|
+
def self.timeframe_range(tf, time)
|
28
28
|
time = time.is_a?(Time) ? time : Time.at(time).utc
|
29
29
|
|
30
|
-
delta =
|
30
|
+
delta = case tf
|
31
|
+
when 'h1', :h1 then 1
|
32
|
+
when 'h4', :h4 then 4
|
33
|
+
when 'd1', :d1 then 24
|
34
|
+
else 1
|
35
|
+
end
|
31
36
|
starts = Time.utc(time.year, time.month, time.day, (time.hour/delta)*delta, 0)
|
32
37
|
expires = starts + delta*60*60
|
38
|
+
|
39
|
+
{ :starts => starts.to_i, :expires => expires.to_i }
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.build_new(core, symbol, tf, time)
|
43
|
+
tf_hash = self.timeframe_range(tf, time)
|
33
44
|
|
34
45
|
c = Chart.new(core)
|
35
46
|
c.updated= time.to_i
|
36
47
|
c.symbol= symbol
|
37
48
|
c.timeframe = tf
|
38
|
-
c.starts = starts
|
39
|
-
c.expires = expires
|
49
|
+
c.starts = tf_hash[:starts]
|
50
|
+
c.expires = tf_hash[:expires]
|
40
51
|
c
|
41
52
|
end
|
42
53
|
|
@@ -70,14 +81,5 @@ module Finexclub
|
|
70
81
|
indicator_handler :zeta, Finexclub::Signals::Zeta
|
71
82
|
indicator_handler :octopus, Finexclub::Signals::Octopus
|
72
83
|
indicator_handler :prognosis, Finexclub::Signals::Prognosis
|
73
|
-
|
74
|
-
def self.timeframe_delta(tf)
|
75
|
-
case tf
|
76
|
-
when 'h1', :h1 then 1
|
77
|
-
when 'h4', :h4 then 4
|
78
|
-
when 'd1', :d1 then 24
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
84
|
end
|
83
85
|
end
|
data/lib/finexclub/manager.rb
CHANGED
@@ -9,6 +9,7 @@ module Finexclub
|
|
9
9
|
|
10
10
|
def initialize(core)
|
11
11
|
@core = core
|
12
|
+
@db = nil
|
12
13
|
end
|
13
14
|
|
14
15
|
def collection
|
@@ -23,24 +24,32 @@ module Finexclub
|
|
23
24
|
def find_one(symbol, tf, time = nil)
|
24
25
|
time ||= Time.now.utc
|
25
26
|
time = time.respond_to?(:to_i) ? time.to_i : time
|
26
|
-
find({:symbol => symbol, :timeframe => tf, :starts => {:$lte => time}, :expires => {:$gt => time}}, :limit => 1, :sort => [[:expires,
|
27
|
+
find({:symbol => symbol, :timeframe => tf, :starts => {:$lte => time}, :expires => {:$gt => time}}, :limit => 1, :sort => [[:expires, :desc]]).first
|
27
28
|
end
|
28
29
|
|
29
30
|
def find_many(symbol_or_array, tf, time = nil)
|
30
31
|
time ||= Time.now.utc
|
31
32
|
time = time.respond_to?(:to_i) ? time.to_i : time
|
32
|
-
find({:symbol => {:$in => symbol_or_array}, :timeframe => tf, :starts => {:$lte => time}, :expires => {:$gt => time}}, :limit => 1, :sort => [[:expires,
|
33
|
+
find({:symbol => {:$in => symbol_or_array}, :timeframe => tf, :starts => {:$lte => time}, :expires => {:$gt => time}}, :limit => 1, :sort => [[:expires, :desc]])
|
33
34
|
end
|
34
35
|
|
35
36
|
def find_latest(symbol, tf)
|
36
37
|
find({:symbol => symbol, :timeframe => tf}, :sort => [[:expires, :desc]], :limit => 1).first
|
37
38
|
end
|
38
39
|
|
39
|
-
def
|
40
|
+
def find_one_or_duplicate(symbol, tf, time)
|
40
41
|
chart = find_one(symbol, tf, time)
|
41
42
|
return chart if chart
|
42
43
|
|
43
|
-
|
44
|
+
latest = find_latest(symbol, tf)
|
45
|
+
if latest
|
46
|
+
chart = latest
|
47
|
+
chart.build(Chart.timeframe_range(tf, time))
|
48
|
+
else
|
49
|
+
chart = Chart.build_new(core, symbol, tf, time)
|
50
|
+
end
|
51
|
+
|
52
|
+
id = collection.insert( chart.to_doc )
|
44
53
|
find({"_id" => id}).first
|
45
54
|
end
|
46
55
|
|
@@ -54,19 +63,13 @@ module Finexclub
|
|
54
63
|
ts.nil? ? nil : Time.at(ts).utc
|
55
64
|
end
|
56
65
|
|
57
|
-
def
|
66
|
+
def store(indicator, params, time)
|
58
67
|
time = time.respond_to?(:to_i) ? time.to_i : time
|
59
68
|
|
60
69
|
signal = Signal.build(core, indicator, params.merge(:updated => time))
|
61
|
-
chart =
|
62
|
-
|
63
|
-
c = if chart._id
|
64
|
-
{"_id" => chart._id}
|
65
|
-
else
|
66
|
-
chart.to_doc
|
67
|
-
end
|
70
|
+
chart = find_one_or_duplicate(signal.symbol, signal.timeframe, time)
|
68
71
|
|
69
|
-
collection.update(
|
72
|
+
collection.update({"_id" => chart._id}, {"$set" => {:updated => signal.updated, "indicators.#{indicator}" => signal.to_doc}}, :upsert => true)
|
70
73
|
end
|
71
74
|
|
72
75
|
class Cursor
|
@@ -33,7 +33,7 @@ describe 'Finexclub::Chart' do
|
|
33
33
|
describe '#omega signal accessor' do
|
34
34
|
before do
|
35
35
|
@omega_doc = {:symbol => 'usdjpy', :timeframe => 'h1', :foo => "Ololo!"}
|
36
|
-
Finexclub.signals.
|
36
|
+
Finexclub.signals.store(:omega, @omega_doc, Time.utc(2010, 12, 27, 11, 5))
|
37
37
|
@chart = Finexclub.signals.find_one('usdjpy', 'h1', Time.utc(2010, 12, 27, 11, 10))
|
38
38
|
end
|
39
39
|
|
@@ -60,10 +60,10 @@ describe 'Finexclub::Chart' do
|
|
60
60
|
|
61
61
|
describe 'complex chart with default indicators' do
|
62
62
|
before do
|
63
|
-
Finexclub.signals.
|
64
|
-
Finexclub.signals.
|
65
|
-
Finexclub.signals.
|
66
|
-
Finexclub.signals.
|
63
|
+
Finexclub.signals.store(:alpha, {:symbol => 'eurusd', :timeframe => 'h1'}, Time.now.utc)
|
64
|
+
Finexclub.signals.store(:zeta, {:symbol => 'eurusd', :timeframe => 'h1'}, Time.now.utc)
|
65
|
+
Finexclub.signals.store(:octopus, {:symbol => 'eurusd', :timeframe => 'h1'}, Time.now.utc)
|
66
|
+
Finexclub.signals.store(:prognosis, {:symbol => 'eurusd', :timeframe => 'h1'}, Time.now.utc)
|
67
67
|
end
|
68
68
|
|
69
69
|
{
|
@@ -87,24 +87,7 @@ describe 'Finexclub::Chart' do
|
|
87
87
|
describe 'Chart.build_signal(indicator, params)' do
|
88
88
|
end
|
89
89
|
|
90
|
-
describe 'Chart.
|
91
|
-
describe 'h1 timeframe' do
|
92
|
-
it 'should return valid new (unsaved) chart instance' do
|
93
|
-
chart = Finexclub::Chart.build_new(@core, 'eurusd', 'h1', Time.utc(2010, 12, 27, 11, 30).to_i)
|
94
|
-
chart._id.should == nil
|
95
|
-
chart.symbol.should == 'eurusd'
|
96
|
-
chart.timeframe.should == 'h1'
|
97
|
-
chart.starts.should == Time.utc(2010, 12, 27, 11, 0).to_i
|
98
|
-
chart.expires.should == Time.utc(2010, 12, 27, 12, 0).to_i
|
99
|
-
chart.updated.should == Time.utc(2010, 12, 27, 11, 30).to_i
|
100
|
-
chart.indicators.should == {}
|
101
|
-
end
|
102
|
-
|
103
|
-
it 'should build valid chart given time as Time object' do
|
104
|
-
Finexclub::Chart.build_new(@core, 'eurusd', 'h1', Time.utc(2010, 12, 27, 11, 30)).starts.should == Time.utc(2010, 12, 27, 11, 0).to_i
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
90
|
+
describe 'Chart.tf_boundaries(tf, time)' do
|
108
91
|
{
|
109
92
|
:h1 => {
|
110
93
|
[2010, 12, 27, 00, 00] => [[2010, 12, 27, 00, 00], [2010, 12, 27, 01, 00]],
|
@@ -124,33 +107,45 @@ describe 'Finexclub::Chart' do
|
|
124
107
|
[2010, 12, 27, 16, 37] => [[2010, 12, 27, 00, 00], [2010, 12, 28, 00, 00]],
|
125
108
|
[2010, 12, 27, 23, 59] => [[2010, 12, 27, 00, 00], [2010, 12, 28, 00, 00]]
|
126
109
|
}
|
127
|
-
}.each do |tf,
|
110
|
+
}.each do |tf, examples|
|
128
111
|
describe "#{tf} timeframe" do
|
129
|
-
|
112
|
+
examples.each do |initial_time, tf_range|
|
130
113
|
time = Time.utc(*initial_time)
|
131
|
-
starts = Time.utc(*
|
132
|
-
expires = Time.utc(*
|
114
|
+
starts = Time.utc(*tf_range.first)
|
115
|
+
expires = Time.utc(*tf_range.last)
|
133
116
|
|
134
|
-
describe "
|
117
|
+
describe "range for #{time}" do
|
135
118
|
it "should start at #{starts}, expire at #{expires}" do
|
136
|
-
|
137
|
-
|
138
|
-
|
119
|
+
tf_hash = Finexclub::Chart.timeframe_range(tf, time)
|
120
|
+
tf_hash[:starts].should == starts.to_i
|
121
|
+
tf_hash[:expires].should == expires.to_i
|
139
122
|
end
|
140
123
|
end
|
141
124
|
end
|
142
|
-
|
143
125
|
end
|
144
126
|
end
|
127
|
+
end
|
145
128
|
|
129
|
+
describe 'Chart.build_new(symbol, tf, time)' do
|
130
|
+
it 'should return valid new (unsaved) chart instance' do
|
131
|
+
chart = Finexclub::Chart.build_new(@core, 'eurusd', 'h1', Time.utc(2010, 12, 27, 11, 30).to_i)
|
132
|
+
chart._id.should == nil
|
133
|
+
chart.symbol.should == 'eurusd'
|
134
|
+
chart.timeframe.should == 'h1'
|
135
|
+
chart.starts.should == Time.utc(2010, 12, 27, 11, 0).to_i
|
136
|
+
chart.expires.should == Time.utc(2010, 12, 27, 12, 0).to_i
|
137
|
+
chart.updated.should == Time.utc(2010, 12, 27, 11, 30).to_i
|
138
|
+
chart.indicators.should == {}
|
139
|
+
end
|
140
|
+
|
141
|
+
it 'should build valid chart given time as Time object' do
|
142
|
+
chart = Finexclub::Chart.build_new(@core, 'eurusd', 'h1', Time.utc(2010, 12, 27, 11, 30))
|
143
|
+
chart.starts.should == Time.utc(2010, 12, 27, 11, 0).to_i
|
144
|
+
end
|
146
145
|
end
|
147
|
-
|
148
146
|
|
149
|
-
describe 'instance' do
|
147
|
+
describe 'Chart instance' do
|
150
148
|
before do
|
151
|
-
@a1, @a2 = mock('a1'), mock('a2')
|
152
|
-
@z1 = mock('z1')
|
153
|
-
|
154
149
|
@chart_doc = {
|
155
150
|
:symbol => 'eurusd',
|
156
151
|
:timeframe => 'h1',
|
@@ -158,24 +153,62 @@ describe 'Finexclub::Chart' do
|
|
158
153
|
:expires => Time.utc(2010, 12, 27, 12, 0).to_i,
|
159
154
|
:updated => Time.utc(2010, 12, 27, 11, 5).to_i,
|
160
155
|
:indicators => {
|
161
|
-
:
|
162
|
-
:
|
156
|
+
:omega => {:foo => 'bar'},
|
157
|
+
:gamma => {:ololo => 'piu'},
|
163
158
|
}
|
164
159
|
}
|
165
160
|
|
166
161
|
@chart.build(@chart_doc)
|
167
162
|
end
|
168
163
|
|
169
|
-
|
170
|
-
|
171
|
-
|
164
|
+
describe 'common attributes' do
|
165
|
+
it 'should provide common accessors' do
|
166
|
+
@chart.symbol.should == 'eurusd'
|
167
|
+
@chart.timeframe.should == 'h1'
|
168
|
+
@chart.updated.should == @chart_doc[:updated]
|
169
|
+
@chart.starts.should == @chart_doc[:starts]
|
170
|
+
@chart.expires.should == @chart_doc[:expires]
|
171
|
+
@chart.indicators.should == @chart_doc[:indicators]
|
172
|
+
end
|
172
173
|
end
|
173
174
|
|
174
|
-
|
175
|
-
|
176
|
-
|
175
|
+
describe 'Chart.indicators' do
|
176
|
+
it 'should access raw indications' do
|
177
|
+
@chart.indicators[:omega].should == {:foo => 'bar'}
|
178
|
+
@chart.indicators[:gamma].should == {:ololo => 'piu'}
|
179
|
+
end
|
180
|
+
|
181
|
+
it 'should update indication' do
|
182
|
+
@chart.indicators[:gamma] = {:ololo => 'yarr!'}
|
183
|
+
@chart.indicators[:gamma].should == {:ololo => 'yarr!'}
|
184
|
+
end
|
177
185
|
end
|
178
186
|
|
187
|
+
describe 'Chart.to_doc' do
|
188
|
+
it 'should export valid document' do
|
189
|
+
@chart.to_doc.should == @chart_doc
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
describe 'Chart.build(doc_hash)' do
|
195
|
+
before do
|
196
|
+
@chart_doc = {
|
197
|
+
:symbol => 'eurusd',
|
198
|
+
:timeframe => 'h1',
|
199
|
+
:starts => Time.utc(2010, 12, 27, 11, 0).to_i,
|
200
|
+
:expires => Time.utc(2010, 12, 27, 12, 0).to_i,
|
201
|
+
:updated => Time.utc(2010, 12, 27, 11, 5).to_i,
|
202
|
+
:indicators => {
|
203
|
+
:omega => {:foo => 'bar'},
|
204
|
+
:gamma => {:ololo => 'piu'},
|
205
|
+
}
|
206
|
+
}
|
207
|
+
|
208
|
+
@chart.build(@chart_doc)
|
209
|
+
end
|
210
|
+
|
211
|
+
|
179
212
|
it 'should provide common accessors' do
|
180
213
|
@chart.symbol.should == 'eurusd'
|
181
214
|
@chart.timeframe.should == 'h1'
|
@@ -2,19 +2,12 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
2
|
|
3
3
|
describe 'Finexclub::Manager' do
|
4
4
|
before do
|
5
|
-
@core =
|
6
|
-
@manager = Finexclub::Manager.new(@core)
|
5
|
+
@core = test_core
|
7
6
|
|
8
|
-
@
|
9
|
-
@manager.db =
|
7
|
+
@manager = Finexclub::Manager.new(@core)
|
8
|
+
@manager.db = test_mongo
|
10
9
|
|
11
|
-
@
|
12
|
-
end
|
13
|
-
|
14
|
-
describe '.db' do
|
15
|
-
it 'should return mongo instance' do
|
16
|
-
@manager.db.should == @mongo
|
17
|
-
end
|
10
|
+
@manager.collection.drop
|
18
11
|
end
|
19
12
|
|
20
13
|
describe '.collection' do
|
@@ -31,7 +24,7 @@ describe 'Finexclub::Manager' do
|
|
31
24
|
|
32
25
|
describe 'finding charts' do
|
33
26
|
before do
|
34
|
-
charts = @
|
27
|
+
charts = @manager.collection
|
35
28
|
charts.drop
|
36
29
|
@c1 = {:symbol => 'eurusd', :timeframe => 'h1', :starts => Time.utc(2010, 12, 27, 11, 0).to_i, :expires => Time.utc(2010, 12, 27, 12, 0).to_i, :updated => Time.utc(2010, 12, 27, 11, 3).to_i}
|
37
30
|
@c2 = {:symbol => 'eurusd', :timeframe => 'h1', :starts => Time.utc(2010, 12, 27, 12, 0).to_i, :expires => Time.utc(2010, 12, 27, 13, 0).to_i, :updated => Time.utc(2010, 12, 27, 12, 5).to_i}
|
@@ -89,20 +82,22 @@ describe 'Finexclub::Manager' do
|
|
89
82
|
end
|
90
83
|
end
|
91
84
|
|
92
|
-
describe '.
|
85
|
+
describe '.find_one_or_duplicate(symbol, tf, time)' do
|
93
86
|
it 'should return existing chart for given symbol, timeframe and time' do
|
94
|
-
c = @manager.
|
87
|
+
c = @manager.find_one_or_duplicate('eurusd', 'h1', Time.utc(2010, 12, 27, 11, 30))
|
95
88
|
c._id.should == @id1
|
96
89
|
end
|
97
90
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
91
|
+
it 'should create duplicate latest chart if no chart exists' do
|
92
|
+
indicators = {
|
93
|
+
"omega" => {"foo" => 'ololo!'}
|
94
|
+
}
|
95
|
+
@manager.collection.update({:_id => @id2}, {:$set => {:indicators => indicators}})
|
102
96
|
|
103
|
-
|
104
|
-
c = @manager.
|
97
|
+
# this should insert after @c2 copying indications from there
|
98
|
+
c = @manager.find_one_or_duplicate('eurusd', 'h1', Time.utc(2010, 12, 27, 13, 5))
|
105
99
|
c._id.should.not.be.nil?
|
100
|
+
c.indicators.should == indicators
|
106
101
|
end
|
107
102
|
end
|
108
103
|
|
@@ -158,7 +153,7 @@ describe 'Finexclub::Manager' do
|
|
158
153
|
|
159
154
|
end
|
160
155
|
|
161
|
-
describe '
|
156
|
+
describe 'storing signals' do
|
162
157
|
before do
|
163
158
|
class Omega < Finexclub::Signal
|
164
159
|
field :symbol, :symbol
|
@@ -170,7 +165,17 @@ describe 'Finexclub::Manager' do
|
|
170
165
|
end
|
171
166
|
Finexclub::Chart.indicator_handler(:omega, Omega)
|
172
167
|
|
173
|
-
|
168
|
+
class Gamma < Finexclub::Signal
|
169
|
+
field :symbol, :symbol
|
170
|
+
field :timeframe, :string
|
171
|
+
field :updated, :timestamp
|
172
|
+
field :ololo, :string
|
173
|
+
|
174
|
+
doc_fields :ololo, :updated
|
175
|
+
end
|
176
|
+
Finexclub::Chart.indicator_handler(:gamma, Gamma)
|
177
|
+
|
178
|
+
charts = @manager.collection
|
174
179
|
charts.drop
|
175
180
|
@c1 = {
|
176
181
|
:symbol => 'eurusd',
|
@@ -194,9 +199,13 @@ describe 'Finexclub::Manager' do
|
|
194
199
|
@id2 = charts.insert(@c2)
|
195
200
|
end
|
196
201
|
|
197
|
-
describe '.
|
202
|
+
describe '.store(indicator, raw_params, time)' do
|
198
203
|
it 'should add signal to existing chart' do
|
199
|
-
@manager.
|
204
|
+
@manager.store(
|
205
|
+
:omega,
|
206
|
+
{"symbol" => "EURUSD", "timeframe" => "h1", "foo" => "bar"},
|
207
|
+
Time.utc(2010, 12, 27, 11, 5)
|
208
|
+
)
|
200
209
|
|
201
210
|
c = @manager.collection.find_one({"_id" => @id1})
|
202
211
|
c["symbol"].should == 'eurusd'
|
@@ -211,7 +220,11 @@ describe 'Finexclub::Manager' do
|
|
211
220
|
end
|
212
221
|
|
213
222
|
it 'should update existing signal on existing chart' do
|
214
|
-
@manager.
|
223
|
+
@manager.store(
|
224
|
+
:omega,
|
225
|
+
{"symbol" => "USDCAD", "timeframe" => "h1", "foo" => "ololo!"},
|
226
|
+
Time.utc(2010, 12, 27, 11, 30)
|
227
|
+
)
|
215
228
|
|
216
229
|
c = @manager.collection.find_one({"_id" => @id2})
|
217
230
|
c["symbol"].should == 'usdcad'
|
@@ -225,28 +238,36 @@ describe 'Finexclub::Manager' do
|
|
225
238
|
}
|
226
239
|
end
|
227
240
|
|
228
|
-
|
229
|
-
|
241
|
+
describe 'no chart mathes for given time' do
|
242
|
+
before do
|
243
|
+
# store signal after @c2 and transfer @c2.omega indications
|
244
|
+
@manager.store(
|
245
|
+
:gamma,
|
246
|
+
{"symbol" => "USDCAD", "timeframe" => "h1", "ololo" => "yarr!"},
|
247
|
+
Time.utc(2010, 12, 27, 12, 5)
|
248
|
+
)
|
249
|
+
@c = @manager.collection.find({:symbol => 'usdcad', :timeframe => 'h1'}).sort([[:expires, :desc]]).first
|
250
|
+
end
|
230
251
|
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
end
|
243
|
-
end
|
252
|
+
it 'should add signals to new valid chart' do
|
253
|
+
@c["symbol"].should == 'usdcad'
|
254
|
+
@c["timeframe"].should == 'h1'
|
255
|
+
@c["starts"].should == Time.utc(2010, 12, 27, 12, 0).to_i
|
256
|
+
@c["expires"].should == Time.utc(2010, 12, 27, 13, 0).to_i
|
257
|
+
@c["updated"].should == Time.utc(2010, 12, 27, 12, 5).to_i
|
258
|
+
@c["indicators"]["gamma"].should == {
|
259
|
+
"ololo" => "yarr!",
|
260
|
+
"updated" => Time.utc(2010, 12, 27, 12, 5).to_i
|
261
|
+
}
|
262
|
+
end
|
244
263
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
264
|
+
it 'should transfer indications from latest chart' do
|
265
|
+
@c["indicators"]["omega"].should == {
|
266
|
+
"foo" => "bar",
|
267
|
+
"updated" => Time.utc(2010, 12, 27, 11, 3).to_i
|
268
|
+
}
|
269
|
+
end
|
270
|
+
end
|
250
271
|
end
|
251
272
|
end
|
252
273
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 5
|
9
|
+
version: 0.5.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alex Levin
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-02-
|
17
|
+
date: 2011-02-07 00:00:00 +07:00
|
18
18
|
default_executable: finexclub_updater
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|