pub struct Cli {
pub config: Option<PathBuf>,
pub lenv: Option<PathBuf>,
pub log_level: String,
pub verbose: bool,
pub dry_run: bool,
pub plan: bool,
pub account: Option<String>,
pub user: Option<String>,
pub balance_interval: Option<u64>,
pub order_delay: Option<u64>,
pub run_once: bool,
pub demo: bool,
}Expand description
Trader Bot - A configurable trading bot with multi-strategy support.
Fields§
§config: Option<PathBuf>Path to configuration file (JSON format).
lenv: Option<PathBuf>Path to lenv file for environment variables.
log_level: StringLog level (trace, debug, info, warn, error).
verbose: boolEnable verbose output.
dry_run: boolRun in dry-run mode (no actual trades).
plan: boolRun in plan mode - connect to real market, calculate orders but don’t execute them. Displays detailed information about what orders would be placed.
account: Option<String>Account ID to use (if not specified, uses all configured accounts).
user: Option<String>User ID to use (for multi-user setups).
balance_interval: Option<u64>Rebalancing interval in seconds (overrides config).
order_delay: Option<u64>Delay between orders in milliseconds.
run_once: boolRun once and exit (instead of continuous operation).
demo: boolRun demo mode with simulated exchange.
Implementations§
Source§impl Cli
impl Cli
Sourcepub fn parse_with_lenv() -> Self
pub fn parse_with_lenv() -> Self
Parses CLI arguments with Links Notation configuration support.
This function:
- Attempts to auto-load lenv file
- Parses CLI arguments (which also reads env vars via clap)
- Applies priority chain for configuration
Sourcepub fn get_log_level(&self) -> Level
pub fn get_log_level(&self) -> Level
Gets the effective log level.
Sourcepub fn load_config(&self) -> Result<Option<AppConfig>, ConfigError>
pub fn load_config(&self) -> Result<Option<AppConfig>, ConfigError>
Loads configuration from file if specified.
Sourcepub fn merge_with_config(&self, config: AppConfig) -> AppConfig
pub fn merge_with_config(&self, config: AppConfig) -> AppConfig
Creates a merged configuration from CLI args and file config.
CLI arguments take priority over file config values.
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Cli
impl CommandFactory for Cli
Source§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.