Futu (futu v2.8.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
Futu client gen server
Link to this section Types
server()
Specs
server() :: GenServer.server()
Link to this section Functions
_heartbeat()
Specs
_heartbeat() :: binary()
1004 KeepAlive Cast for the heartbeat, no reply This function will execute in Futu.GenServer automatically
_init_connect(pid)
Specs
1001 InitConnect This function will execute in Futu.GenServer automatically
account_funds(pid, opts)
Specs
account_list(pid, opts)
Specs
get_conn_id(pid)
Specs
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
history_order_list(pid, opts)
Specs
max_trade_quantities(pid, opts)
Specs
order_list(pid, opts)
Specs
place_order(pid, opts)
Specs
position_list(pid, opts)
Specs
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
request_history_kl(pid, list)
Specs
Refer to historical/1, I don't like the function name
security_snapshot(pid, list)
Specs
start(opts \\ %{})
Specs
Futu client gen server