-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (52 loc) · 1.56 KB
/
Makefile
File metadata and controls
63 lines (52 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
TF ?= M1,M5,M15,M30,H1,H4,D1,W1,MN1
SHELL := /usr/bin/env TF=$(TF) $(SHELL) -x
SCR_D := $(PWD)/FX-BT-Scripts
xargs := $(shell which gxargs xargs | head -n1)
pair := $(shell find ?????? -maxdepth 0 -print -quit)
year := $(shell (cd ??????; find ???? -maxdepth 0 -type d))
size := $(shell du -sb $(pair) | cut -f1)
# HST files.
m1_hst=$(pair)1.hst
m5_hst=$(pair)5.hst
m15_hst=$(pair)15.hst
m30_hst=$(pair)30.hst
h1_hst=$(pair)60.hst
h4_hst=$(pair)240.hst
d1_hst=$(pair)1440.hst
w1_hst=$(pair)10080.hst
mn_hst=$(pair)43200.hst
# FXT files.
m1_fxt=$(pair)1_0.fxt
m5_fxt=$(pair)5_0.fxt
m15_fxt=$(pair)15_0.fxt
m30_fxt=$(pair)30_0.fxt
h1_fxt=$(pair)60_0.fxt
h4_fxt=$(pair)240_0.fxt
d1_fxt=$(pair)1440_0.fxt
w1_fxt=$(pair)10080_0.fxt
mn_fxt=$(pair)43200_0.fxt
csvfile=all.csv
spread=20
all: hst fxt
git tag
@echo Done.
hst: FX-BT-Scripts $(csvfile) $(m1_hst).gz
@echo Done.
fxt: FX-BT-Scripts $(csvfile) $(m1_fxt).gz
@echo Done.
clean:
git clean -fd
rm -fr FX-BT-Scripts
FX-BT-Scripts:
git clone --depth 1 https://github.com/FX31337/FX-BT-Scripts.git
$(csvfile):
find . -name '*.csv' -print0 | sort -z | $(xargs) -r0 cat | tee $(csvfile) > /dev/null
# find . -name '*.csv' -print0 | sort -z | $(xargs) -r0 cat | tee $(csvfile) | pv -ps $(size) > /dev/null
# Generate HST files.
$(m1_hst).gz:
$(SCR_D)/fx-data-convert-from-csv.py -v -i $(csvfile) -p $(pair) -s $(spread) -S default -t $(TF) -f hst
gzip -v *.hst
# Generate FXT files.
$(m1_fxt).gz:
$(SCR_D)/fx-data-convert-from-csv.py -v -i $(csvfile) -p $(pair) -s $(spread) -S default -t $(TF) -f fxt -m 0,1,2
gzip -v *.fxt