Files
PineSript/Saver/Config/SaverConfig.cs

80 lines
3.0 KiB
C#
Raw Normal View History

2026-04-26 19:00:54 +09:00
namespace Saver.Config
{
public class SaverConfig
{
public StorageConfig Storage { get; set; } = new();
public List<ExchangeConfig> Exchanges { get; set; } = new();
2026-04-27 17:45:32 +09:00
public RecoveryConfig Recovery { get; set; } = new();
}
public class RecoveryConfig
{
/// <summary>
/// 복구 모드.
/// 0 = 없음 (정상 동작)
/// 1 = 특정 시각 이후 데이터 삭제 후 재수집 (Mode1FromTime 필요)
/// 2 = 전체 기간 빈 1분봉 스캔 후 채우기
/// 복구 완료 후 정상 수집으로 자동 전환됩니다.
/// </summary>
public int Mode { get; set; } = 0;
/// <summary>[모드1] 이 시각 이후의 데이터를 삭제하고 재수집합니다.</summary>
public DateTimeOffset? Mode1FromTime { get; set; }
2026-04-26 19:00:54 +09:00
}
public class StorageConfig
{
/// <summary>캔들 데이터 저장 루트 경로</summary>
public string RootPath { get; set; } = "data";
}
public class ExchangeConfig
{
public string Name { get; set; } = "";
public bool Enabled { get; set; } = true;
/// <summary>초당 최대 API 요청 수 (Bitget 제한 20, 안전 마진 포함 기본 10)</summary>
public int MaxRequestsPerSec { get; set; } = 10;
/// <summary>1회 요청으로 가져올 최대 캔들 수</summary>
public int MaxCandlesPerRequest { get; set; } = 200;
/// <summary>요청 실패 시 재시도 횟수</summary>
public int RetryCount { get; set; } = 3;
/// <summary>재시도 대기 시간 (ms)</summary>
public int RetryDelayMs { get; set; } = 2000;
/// <summary>수집할 상품 목록 (USDT-FUTURES, SPOT, COIN-FUTURES)</summary>
public List<ProductConfig> Products { get; set; } = new();
/// <summary>수집 제외 심볼 목록 (블랙리스트)</summary>
public List<string> Blacklist { get; set; } = new();
2026-04-27 17:45:32 +09:00
/// <summary>
/// 수집 대상 심볼 화이트리스트.
/// 비어있으면 전체 심볼 수집 (기본 동작).
/// 값이 있으면 해당 심볼만 수집합니다.
/// </summary>
public List<string> Whitelist { get; set; } = new();
2026-04-26 19:00:54 +09:00
}
public class ProductConfig
{
/// <summary>상품 타입 (USDT-FUTURES | SPOT | COIN-FUTURES)</summary>
public string Type { get; set; } = "";
public bool Enabled { get; set; } = true;
2026-04-27 18:25:16 +09:00
/// <summary>
/// 수집할 캔들 인터벌 목록.
/// 지원값: "1m", "3m", "5m", "15m", "30m", "1h", "4h", "6h", "12h", "1d"
/// 기본값: 1분봉만 수집.
/// </summary>
/// <summary>
/// 비어있으면 SaverService에서 "1m" 기본값으로 처리합니다.
/// configuration.Bind()가 기존 리스트에 append하므로 기본값은 빈 리스트로 유지합니다.
/// </summary>
public List<string> Intervals { get; set; } = new();
2026-04-26 19:00:54 +09:00
}
}