forex_date 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -5
- data/lib/forex_date/version.rb +1 -1
- data/lib/forex_date.rb +2 -2
- metadata +4 -4
data/README.md
CHANGED
@@ -6,11 +6,13 @@ A forex week begins when the Wellington/Sydney forex markets open (Sun 5pm EST)
|
|
6
6
|
|
7
7
|
In order to calculate daily OHCL bars, the around the clock forex week can be split in 5 days:
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
| day | from | to |
|
10
|
+
|:-----------|:-------------|:-------------|
|
11
|
+
| monday | Sun 5pm EST | Mon 5pm EST |
|
12
|
+
| tuesday | Mon 5pm EST | Tue 5pm EST |
|
13
|
+
| wednesday | Tue 5pm EST | Wed 5pm EST |
|
14
|
+
| thursday | Wed 5pm EST | Thu 5pm EST |
|
15
|
+
| friday | Thu 5pm EST | Fri 5pm EST |
|
14
16
|
|
15
17
|
For example, if current time is Thu May 24 06:38:34 UTC 2012:
|
16
18
|
|
data/lib/forex_date/version.rb
CHANGED
data/lib/forex_date.rb
CHANGED
@@ -4,10 +4,10 @@ module ForexDate
|
|
4
4
|
|
5
5
|
require 'tzinfo'
|
6
6
|
|
7
|
-
def ForexDate.
|
7
|
+
def ForexDate.today
|
8
8
|
t = Time.now.in_time_zone("Eastern Time (US & Canada)")
|
9
9
|
date = t.to_date
|
10
|
-
date += 1.day if t.hour
|
10
|
+
date += 1.day if t.hour >= 17
|
11
11
|
return ( date.wday == 6 || date.wday == 7 ) ? nil : date
|
12
12
|
end
|
13
13
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forex_date
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Javier Vidal
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-05-
|
18
|
+
date: 2012-05-30 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: tzinfo
|