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
//! Simpler macro to test that a strategy implements all required traits
/// Macro to test trait implementations for a specific strategy type.
///
/// This macro generates a module with a test function to ensure that the specified strategy type
/// implements all the necessary traits required by the system. It uses the `static_assertions` crate
/// to perform compile-time checks for these trait implementations.
///
/// # Parameters
///
/// * `$strategy_type:ty` - The type of the strategy to test.
/// * `$module_name:ident` - The name of the module to generate for the test code.
///
/// # Traits Tested
///
/// The macro asserts that the provided type `$strategy_type` implements the following traits:
///
/// - `Default`
/// - `StrategyConstructor`
/// - `BreakEvenable`
/// - `Positionable`
/// - `Strategable`
/// - `Strategies`
/// - `Validable`
/// - `Optimizable`
/// - `Profit`
/// - `Graph`
/// - `ProbabilityAnalysis`
/// - `Greeks`
/// - `DeltaNeutrality`
/// - `PnLCalculator`
/// - `Serialize`
/// - `Deserialize<'static>`
/// - `std::fmt::Display`
///
/// These traits are essential for strategies to function appropriately within the system.
///
/// This will generate a test module named `my_strategy_tests`, which contains a test function to
/// verify that `MyStrategyType` implements all the required traits.
///
/// # Note
///
/// This macro relies on the `static_assertions` crate to perform the compile-time checks. Ensure
/// that the crate is included in your `Cargo.toml`:
///
/// ```toml
/// [dev-dependencies]
/// static_assertions = "1.1"
/// ```
///
/// Additionally, ensure that `$crate::visualization::Graph` is correctly defined and accessible
/// in your project.