1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
use crate::prelude::*;
use crate::signal::*;
pub struct MyAlgo;
#[register_algorithm]
impl StockTrekAlgorithm for MyAlgo {
fn create_signal(&self, _context: StockTrekContext) -> StockTrekSignal {
StockTrekSignal {
instrument: Instrument {
product: crate::signal::InstrumentProduct::Spot,
base: "BTC".into(),
quote: "USDT".into(),
},
market_context: MarketContext {
market_regime: MarketRegime {
classifications: MarketRegimeClassifications {
confidence: 0.5,
dominant: "".to_string(),
top_alternatives: std::collections::HashMap::from([
("dskfsd".into(), 0.21 + 0.0),
("irewtnvc".into(), 0.17),
("cfhwrehk".into(), 0.15),
]),
unclassified: 0.2,
},
cycle: MarketRegimeCycle {
accumulation: 0.3,
distribution: 0.5,
markdown: 0.1,
markup: 0.2,
neutral: 0.8,
},
trend: MarketRegimeTrend {
bearish: 0.6,
bullish: 0.2,
sideways: 0.2,
},
volatility: MarketRegimeVolatility {
snapshot: MarketRegimeVolatilitySnapshot {
high: 0.1,
low: 0.9,
},
trend: MarketRegimeVolatilityTrend {
compression: 0.5,
expansion: 0.5,
},
},
},
regime_persistence: RegimePersistence {
regime_persistence_confidence: 0.7,
remaining_durations_millis: 483648732,
},
},
prediction: Prediction {
horizon_confidences_by_millis: HorizonConfidencesByMillis(
std::collections::HashMap::from([
("vgfhgkfd".into(), 549357438),
("cdiotkjr".into(), 549357438),
]),
),
optimal_horizon_millis: 1000,
percentage_changes: ConfidencePercentageChanges {
p01: -10.2,
p05: -5.1,
p10: -0.4,
p25: 3.9,
p50: 10.2,
p75: 16.5,
p90: 19.4,
p95: 20.4,
p99: 20.8,
},
risk: PredictionRisk {
percentage_risks: PredictionRiskPercentageRisks {
cvar_95: -6.8,
cvar_99: -7.2,
max_drawdown_95: 25.3,
max_drawdown_99: 31.8,
var_95: -3.7,
var_99: -4.5,
},
risk_factors: std::collections::HashMap::from([
("dvxvxvvodsgrg".into(), 0.63),
("cnnfgvcxojtnn".into(), 0.41),
]),
},
validity_duration_millis: 1_000_000,
},
}
}
}