Files
QTradeProgram/Sqbase/config.h

70 lines
1.2 KiB
C
Raw Normal View History

2025-08-15 15:56:40 +08:00
#ifndef CONFIG_H
#define CONFIG_H
#include <QString>
struct StockInfo {
QString strCode;
QString strName;
float fcurPrice;
float fShare;
};
/*
*
code str
name str
time_key str K 线
open float
close float
high float
low float
pe_ratio float
turnover_rate float
volume int
turnover float
change_rate float
last_close float
*
*/
struct StockKInfo {
QString code;
QString name;
QString timeKey;
float open;
float close;
float high;
float low;
float peRatio;
float turnoverRate;
int volume;
float turnover;
float changeRate;
float lastClose;
};
// 数据结构:存储每日价格和交易数据
struct DataPoint {
std::string date;
double open;
double close;
double sma_short;
double sma_long;
int signal;
int position;
double returns;
double strategy_returns;
};
// 性能统计结果
struct PerformanceResult {
int S;
int L;
double total_return;
double sharpe_ratio;
double max_drawdown;
};
#endif // CONFIG_H