|
| 1 | +pub fn greed_config_template() -> &'static str { |
| 2 | + r#"# Greed configuration file |
| 3 | +
|
| 4 | +# Platform to use for trading. Currently only "alpaca" is supported. |
| 5 | +platform = "alpaca" |
| 6 | +
|
| 7 | +# How often (in seconds) to run the trading loop. |
| 8 | +interval = 60 |
| 9 | +
|
| 10 | +# Strategies allow you to compose multiple tactic configs together. |
| 11 | +# Each strategy references a file path or agent config, and gets a share of your portfolio. |
| 12 | +# [[strategies]] |
| 13 | +# name = "My Strategy" |
| 14 | +# portfolio_percent = 100.0 # Percentage of portfolio allocated to this strategy |
| 15 | +# path = "strategy.toml" # Path to a local tactic config file |
| 16 | +# # OR use an AI agent strategy: |
| 17 | +# # agent_path = "agent.toml" |
| 18 | +
|
| 19 | +# Tactics define buy/sell rules for individual assets. |
| 20 | +# [[tactics]] |
| 21 | +# name = "ETF" |
| 22 | +# [tactics.buy] |
| 23 | +# for = { stock = "VTI" } |
| 24 | +# when = { below_median_percent = 5.0, median_period = "month" } |
| 25 | +# do = { buy_percent = 10.0 } |
| 26 | +# [tactics.sell] |
| 27 | +# for = { stock = "VTI" } |
| 28 | +# when = { gain_above_percent = 5.0 } |
| 29 | +# do = { sell_all = true } |
| 30 | +"# |
| 31 | +} |
| 32 | + |
| 33 | +pub fn strategy_config_template() -> &'static str { |
| 34 | + r#"# Strategy configuration file |
| 35 | +# A strategy defines buy/sell tactics for one or more assets. |
| 36 | +
|
| 37 | +# Platform to use for trading. Currently only "alpaca" is supported. |
| 38 | +platform = "alpaca" |
| 39 | +
|
| 40 | +# How often (in seconds) to run the trading loop. |
| 41 | +interval = 60 |
| 42 | +
|
| 43 | +# Each [[tactics]] block defines buy/sell rules for one asset. |
| 44 | +[[tactics]] |
| 45 | +name = "VTI" |
| 46 | +
|
| 47 | +[tactics.buy] |
| 48 | +for = { stock = "VTI" } |
| 49 | +when = { below_median_percent = 1.0 } |
| 50 | +do = { buy_percent = 25 } |
| 51 | +
|
| 52 | +[tactics.sell] |
| 53 | +for = { stock = "VTI" } |
| 54 | +when = { gain_above_percent = 1.0 } |
| 55 | +do = { sell_all = true } |
| 56 | +"# |
| 57 | +} |
| 58 | + |
| 59 | +pub fn agent_config_template() -> &'static str { |
| 60 | + r#"# Agent configuration file |
| 61 | +# An agent uses an AI model to make trading decisions. |
| 62 | +
|
| 63 | +# The system prompt that describes the agent's trading strategy and behavior. |
| 64 | +prompt = "You are a trading agent. Analyze the current portfolio and market conditions, then decide whether to buy or sell." |
| 65 | +
|
| 66 | +# Provider configuration for the AI model. |
| 67 | +[agent_provider] |
| 68 | +# Provider type. Currently only "Ollama" is supported. |
| 69 | +type = "Ollama" |
| 70 | +# URL of the Ollama server. Can be a literal URL or an environment variable (e.g. "$OLLAMA_URL"). |
| 71 | +url = "http://localhost:11434" |
| 72 | +# The model to use (e.g. "llama3", "mistral"). |
| 73 | +model = "llama3" |
| 74 | +
|
| 75 | +# Optional allowlist of stock symbols the agent is permitted to trade. |
| 76 | +# If empty, all symbols are allowed. |
| 77 | +# allow = ["VTI", "SPY"] |
| 78 | +
|
| 79 | +# Optional denylist of stock symbols the agent is not permitted to trade. |
| 80 | +# deny = ["GME", "AMC"] |
| 81 | +
|
| 82 | +# Tool permissions — set any to false to disable that capability for the agent. |
| 83 | +[tools] |
| 84 | +account = true |
| 85 | +positions = true |
| 86 | +open_orders = true |
| 87 | +quotes = true |
| 88 | +buy = true |
| 89 | +sell = true |
| 90 | +web_fetch = true |
| 91 | +read_note = true |
| 92 | +write_note = true |
| 93 | +"# |
| 94 | +} |
0 commit comments