-
Notifications
You must be signed in to change notification settings - Fork 3
/
.lein-repl-history
50 lines (50 loc) · 1.82 KB
/
.lein-repl-history
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
(ns ib-re-actor-976-plus.gateway)
twsversion
exit
(ns wrapper.clj)
(camel-to-kebab "helloSexy")
(require '[ib-re-actor-976-plus.wrapper :as wrapper])
(wrapper/tws-version )
wrapper/tws-version
(require '[ib-re-actor-976-plus.wrapper :as wrapper])
wrapper/tws-version
(:require [ib-re-actor-976-plus.gateway :as gateway]
[ib-re-actor-976-plus.mapping :refer [map->]]
[ib-re-actor-976-plus.client-socket :as cs]))
(ns ib-re-actor-976-plus.demoapps.basic-app
(:require [ib-re-actor-976-plus.gateway :as gateway]
[ib-re-actor-976-plus.mapping :refer [map->]]
[ib-re-actor-976-plus.client-socket :as cs]))
(def account "U1217609")
def requests (atom 0)) ; this is the counter for IB requests
(def default-port 7496)
(def requests (atom 0))
(def connection (gateway/connect 2 "localhost" default-paper-port println)) ;you may need to change the port
(def connection (gateway/connect 2 "localhost" default-port println)) ;you may need to change the port
(def ESU0-map {:symbol "ES" :sec-type "FUT" :exchange "GLOBEX" :currency "USD" :last-trade-date-or-contract-month "20211217"})
(defn example-historical-request []
(cs/request-historical-data
(:ecs connection)
(swap! requests inc)
ESU0-map
"20200420 0:00:00" ;the format is important. It defaults to TWS timezone if not specified
10 :days
1 :day
:trades
true
1
false))
(example-historical-request )
(defn example-historical-request []
(cs/request-historical-data
(:ecs connection)
(swap! requests inc)
ESU0-map
"20210920 0:00:00" ;the format is important. It defaults to TWS timezone if not specified
10 :days
1 :day
:trades
true
1
false))
(example-historical-request )