TradingAgents
Documentation for TradingAgents.
TradingAgents.AdaptiveMM_run
— MethodAdaptiveMM_run(ticker::Int, parameters::Tuple{Float64, Int, Float64, Int, Int, Int},
init_conditions::Tuple{Float64, Int, Int, Int},
server_info::Tuple{String, String, String, String};
collect_data = false)
Simulate adaptive market-making agent activity.
Arguments
ticker::Int
: the ticker ID of the asset being traded by the Adaptive Market Makerparameters::Tuple{Float64, Int, Float64, Int, Int, Int}
: a tuple of parameters for specifying the Adaptive Market Maker's behavior. The tuple must be of the form(η_ms, γ, δ_tol, inventory_limit, unit_trade_size, trade_freq)
, whereη_ms::Float64
: the market share targetγ::Int
: the risk aversion parameterδ_tol::Float64
: the optimization toleranceinventory_limit::Int
: the maximum and minimum number of share holdings allowedunit_trade_size::Int
: the amount of shares behind each quotetrade_freq::Int
: the number of seconds between each trading invocation
init_conditions::Tuple{Float64, Int, Int, Int}
: a tuple of initial conditions for the Adaptive Market Maker. The tuple must be of the form(init_cash, init_z, num_init_quotes, num_init_rounds)
, whereinit_cash::Float64
: the initial cash balanceinit_z::Int
: the initial inventorynum_init_quotes::Int
: the number of random quotes to send out per initialization roundnum_init_rounds::Int
: the number of initialization rounds
server_info::Tuple{String, String, String, String}
: a tuple of server information for connecting to the brokerage/Exchange. The tuple is composed of the following elements:host_ip_address::String
: the IP address of the brokerage serverport::String
: the port number of the brokerage serverusername::String
: the username to be used for the brokerage accountpassword::String
: the password to be used for the brokerage account
Keywords
collect_data::Bool=false
: whether or not to collect data during the simulation
TradingAgents.PLP_run
— MethodPLP_run(num_traders::Int, num_assets::Int,
parameters::Tuple{StepRangeLen{Float64}, StepRangeLen{Int}, Int, Int},
server_info::Tuple{String, String, String, String};
print_msg:Bool=false)
Simulate zero-intelligence liquidity providers in parallel. To operate these agents in parallel, the Distributed
package is used. This function must be called after addprocs(n)
has been called, where n
is the number of workers to be used.
Arguments
num_traders::Int
: the number of liquidity providers to simulatenum_assets::Int
: the number of available assets for the agents to tradeparameters::Tuple{StepRangeLen{Float64}, StepRangeLen{Int}, Int, Int}
: a tuple of parameters for the simulation. The tuple is composed of the following elements:init_cash_range::StepRangeLen{Float64}
: the range of initial cash values for the liquidity providers. E.g.,init_cash_range = 10000.0:0.01:30000.0
defines a possible cash balance anywhere between $10,000.00 and $30,000.00.init_shares_range::StepRangeLen{Int}
: the range of initial share holdings for the liquidity providers. E.g.,init_shares_range = 0:1:120
defines a possible share holding (of each available asset) anywhere between 0 shares and 120 shares.trade_freq::Int
: the average number of seconds between trades for each liquidity provider. E.g.,trade_freq = 720
means that each liquidity provider will trade approximately once every 720 seconds (12 minutes).num_ids::Int
: the number of reserved ids set aside for all other agents in the simulation (e.g., liquidity takers and market makers)
server_info::Tuple{String, String, String, String}
: a tuple of server information for connecting to the brokerage. The tuple is composed of the following elements:host_ip_address::String
: the IP address of the brokerage serverport::String
: the port number of the brokerage serverusername::String
: the username to be used for the brokerage accountpassword::String
: the password to be used for the brokerage account
Keywords
print_msg::Bool=false
: whether or not to print messages to the console
TradingAgents.PLT_run
— MethodPLT_run(num_traders::Int, num_assets::Int,
parameters::Tuple{String, String, StepRangeLen{Float64}, StepRangeLen{Int}, Int, Int},
server_info::Tuple{String, String};
print_msg:Bool=false)
Simulate zero-intelligence liquidity takers in parallel. To operate these agents in parallel, the Distributed
package is used. This function must be called after addprocs(n)
has been called, where n
is the number of workers to be used.
Arguments
num_traders::Int
: the number of liquidity takers to simulatenum_assets::Int
: the number of available assets for the agents to tradeparameters::Tuple{String, String, StepRangeLen{Float64}, StepRangeLen{Int}, Int, Int}
: a tuple of parameters for the simulation. The tuple is composed of the following elements:username::String
: the username to be used for the brokerage accountpassword::String
: the password to be used for the brokerage accountinit_cash_range::StepRangeLen{Float64}
: the range of initial cash values for the liquidity takers. E.g.,init_cash_range = 10000.0:0.01:30000.0
defines a possible cash balance anywhere between $10,000.00 and $30,000.00.init_shares_range::StepRangeLen{Int}
: the range of initial share holdings for the liquidity takers. E.g.,init_shares_range = 0:1:120
defines a possible share holding (of each available asset) anywhere between 0 shares and 120 shares.trade_freq::Int
: the average number of seconds between trades for each liquidity taker. E.g.,trade_freq = 720
means that each liquidity taker will trade approximately once every 720 seconds (12 minutes).num_MM::Int
: the number of reserved ids set aside for non-brokerage users (e.g., market makers)
server_info::Tuple{String, String}
: a tuple of server information for connecting to the brokerage. The tuple is composed of the following elements:host_ip_address::String
: the IP address of the brokerage serverport::String
: the port number of the brokerage server
Keywords
print_msg::Bool=false
: whether or not to print messages to the console
TradingAgents.PMM_run
— MethodPMM_run(num_agents::Int, num_assets::Int,
parameters::Tuple{Float64, Float64, Int, Int},
server_info::Tuple{String, String, String, String};
collect_data::Bool=false, print_msg::Bool=false)
Simulate random market-making agent activity in "parallel" (asynchronous tasks).
Arguments
num_agents::Int
: the number of market-making agents to simulatenum_assets::Int
: the number of available assets for the agents to tradeparameters::Tuple{Float64, Float64, Int, Int}
: a tuple of parameters for the simulation. The tuple is composed of the following elements:ϵ_min::Float64
: the lower bound for the price deviation variableϵ_max::Float64
: the upper bound for the price deviation variableunit_trade_size::Int
: the amount of shares behind each quotetrade_freq::Int
: the average number of seconds between trades
server_info::Tuple{String, String, String, String}
: a tuple of server information for connecting to the brokerage. The tuple is composed of the following elements:host_ip_address::String
: the IP address of the brokerage serverport::String
: the port number of the brokerage serverusername::String
: the agent username for the brokerage serverpassword::String
: the agent password for the brokerage server
Keywords
collect_data::Bool=false
: whether or not to collect data from the simulationprint_msg::Bool=false
: whether or not to print messages during the simulation