TinkoffInvest (tinkoff_invest v0.1.4) View Source

Convenient functions for frequent use-cases

Link to this section Summary

Functions

Change broker account id. Useful when wanna switch between accounts dynamically.

Change token dynamically without restarting app. Useful when using multiple broker accounts on different clients

Returns API endpoint for current mode

Returns boolean indicating whether logs are enabled or not

Returns current mode

Takes payload from response and returns it, useful for piping

Change mode dynamically.

Enables or disables logging API response via Logger.debug/1

Link to this section Types

Specs

mode() :: :sandbox | :production

Link to this section Functions

See TinkoffInvest.User.accounts/0.

See TinkoffInvest.Orders.active_orders/0.

See TinkoffInvest.Orders.cancel_order/1.

Specs

change_account_id(String.t()) :: :ok

Change broker account id. Useful when wanna switch between accounts dynamically.

Specs

change_token(String.t()) :: :ok

Change token dynamically without restarting app. Useful when using multiple broker accounts on different clients

Link to this function

create_limit_order(figi, lots, operation, price)

View Source

See TinkoffInvest.Orders.create_limit_order/4.

Link to this function

create_market_order(figi, lots, operation)

View Source

See TinkoffInvest.Orders.create_market_order/3.

Specs

endpoint() :: String.t()

Returns API endpoint for current mode

Specs

logs_enabled?() :: boolean()

Returns boolean indicating whether logs are enabled or not

Specs

mode() :: mode()

Returns current mode

Specs

Takes payload from response and returns it, useful for piping

See TinkoffInvest.Portfolio.full/0.

Specs

set_mode(mode()) :: mode()

Change mode dynamically.

Specs

toggle_logs(boolean()) :: :ok

Enables or disables logging API response via Logger.debug/1

false by default