code
stringlengths
3
6.57k
ask()
Path(csvpath)
csvpath.exists()
sys.exit(f"Oops! Can't find this path: {csvpath}")
load_csv(csvpath)
get_applicant_info()
questionary.text("What's your credit score?")
ask()
questionary.text("What's your current amount of monthly debt?")
ask()
questionary.text("What's your total monthly income?")
ask()
questionary.text("What's your desired loan amount?")
ask()
questionary.text("What's your home value?")
ask()
int(credit_score)
float(debt)
float(income)
float(loan_amount)
float(home_value)
find_qualifying_loans(bank_data, credit_score, debt, income, loan, home_value)
ratio (calculated)
ratio (calculated)
bank_data (list)
credit_score (int)
debt (float)
income (float)
loan (float)
home_value (float)
calculate_monthly_debt_ratio(debt, income)
print(f"The monthly debt to income ratio is {monthly_debt_ratio:.02f}")
calculate_loan_to_value_ratio(loan, home_value)
print(f"The loan to value ratio is {loan_to_value_ratio:.02f}.")
filter_max_loan_size(loan, bank_data)
filter_credit_score(credit_score, bank_data_filtered)
filter_debt_to_income(monthly_debt_ratio, bank_data_filtered)
filter_loan_to_value(loan_to_value_ratio, bank_data_filtered)
print(f"Found {len(bank_data_filtered)
save_qualifying_loans(qualifying_loans)
qualifying_loans (list of lists)
questionary.confirm ("Would you like to save the qualifying loans?")
ask()
if (choice == T)
questionary.text ("Please enter the file path")
ask()
save_csv(qualifying_loans, filepath)
run()
load_bank_data()
get_applicant_info()
save_qualifying_loans(qualifying_loans)
fire.Fire(run)
timedelta(minutes=1)
timedelta(hours=1)
timedelta(days=1)
__init__(self)
set()
clear_data(self)
self.limit_orders.clear()
self.active_limit_orders.clear()
self.trades.clear()
self.logs.clear()
self.daily_results.clear()
add_strategy(self, strategy_class: type, setting: dict)
copy(self.vt_symbols)
load_data(self)
self.output("开始加载历史数据")
datetime.now()
self.output("起始日期必须小于结束日期")
self.history_data.clear()
self.dts.clear()
timedelta(days=30)
min(end, self.end)
self.dts.add(bar.datetime)
min(progress, 1)
int(progress * 10)
self.output(f"{vt_symbol}加载进度:{progress_bar} [{progress:.0%}]")
self.output(f"{vt_symbol}历史数据加载完成,数据量:{data_count}")
self.output("所有历史数据加载完成")
run_backtesting(self)
self.strategy.on_init()
list(self.dts)
dts.sort()
enumerate(dts)
self.new_bars(dt)
self.output("触发异常,回测终止")
self.output(traceback.format_exc()
self.output("策略初始化完成")
self.strategy.on_start()
self.output("开始回放历史数据")
self.new_bars(dt)
self.output("触发异常,回测终止")
self.output(traceback.format_exc()
self.output("历史数据回放结束")
calculate_result(self)
self.output("开始计算逐日盯市盈亏")
self.output("成交记录为空,无法计算")
self.trades.values()
trade.datetime.date()
daily_result.add_trade(trade)