Tai.Advisor behaviour (tai v0.0.75)

A behavior for implementing a server that receives events such as market quotes.

It can be used to receive one or more quote streams to record data and create, update or cancel orders.

Link to this section Summary

Link to this section Types

Link to this type

advisor_id()

Specs

Link to this type

advisor_name()

Specs

advisor_name() :: atom()

Specs

fleet_id() :: Tai.Fleets.FleetConfig.id()
Link to this type

market_quote()

Specs

market_quote() :: Tai.Markets.Quote.t()

Specs

run_store() :: Tai.Advisor.State.run_store()

Specs

state() :: Tai.Advisor.State.t()
Link to this type

terminate_reason()

Specs

terminate_reason() :: :normal | :shutdown | {:shutdown, term()} | term()

Specs

trade() :: Tai.Markets.Trade.t()

Link to this section Callbacks

Link to this callback

after_start(state)

Specs

after_start(state()) :: {:ok, run_store()}
Link to this callback

handle_market_quote(market_quote, state)

Specs

handle_market_quote(market_quote(), state()) :: {:ok, run_store()}
Link to this callback

handle_trade(trade, state)

Specs

handle_trade(trade(), state()) :: {:ok, run_store()}
Link to this callback

on_terminate(terminate_reason, state)

Specs

on_terminate(terminate_reason(), state()) :: term()

Link to this section Functions

Link to this function

process_name(fleet_id, advisor_id)

Specs

process_name(fleet_id(), advisor_id()) :: advisor_name()