Futu (futu v2.0.0)
Futu Elixir API Client
Link to this section Summary
Functions
1004 KeepAlive Cast for the heartbeat, no reply This function will execute in Futu.GenServer automatically
1001 InitConnect This function will execute in Futu.GenServer automatically
3103 Qot_RequestHistoryKL
This is the main function of intereacting Futu TCP client. Three steps here
Refer to historical/1, I don't like the function name
Link to this section Types
Link to this type
server()
Specs
server() :: GenServer.server()
Link to this section Functions
Link to this function
_heartbeat()
Specs
_heartbeat() :: binary()
1004 KeepAlive Cast for the heartbeat, no reply This function will execute in Futu.GenServer automatically
Link to this function
_init_connect(pid)
Specs
1001 InitConnect This function will execute in Futu.GenServer automatically
Link to this function
account_funds(pid, opts)
Specs
Link to this function
account_list(pid, opts)
Specs
Link to this function
historical(pid, list)
Specs
3103 Qot_RequestHistoryKL
Paramters
required:
- period, checkout Futu.Quote.Historical.period/1
- market, checkout Futu.Quote.Historical.market/1
- code, e.g. 1
optional:
- rehab, checkout Futu.Quote.Historical.rehab/1
- from, default ~N[1999-01-01 00:00:00]
- to, default now
- max_rows, integer
- next_page_key, if it's included from the last response
- extended_time, boolean, to get the pre-market and after-hours data of US stocks, only supports timeframe of 1-minute
Link to this function
history_order_list(pid, opts)
Specs
Link to this function
order_list(pid, opts)
Specs
Link to this function
request(pid, module, opts)
Specs
This is the main function of intereacting Futu TCP client. Three steps here:
- build request: opts -> module.encode/1 -> Request.build/3
- send tcp message by GenServer
- parse response:
tcp_reply
-> Response.parse/2
success -> module.decode/1
header failuresuccess request failure
Link to this function
request_history_kl(pid, list)
Specs
Refer to historical/1, I don't like the function name
Link to this function