@@ -1220,7 +1220,7 @@ def test_EstimateTargetReachabilityCheckType(self):
12201220
12211221 # Test function call:
12221222 pIntegral , fIntegral = TradeRoutines .EstimateTargetReachability (
1223- seriesLowTF , seriesHighTF , currentPrice , targetPrice , 12 , 4 , ddof = 2
1223+ seriesLowTF , seriesHighTF , currentPrice , targetPrice , 12 , 4 , ddof = 2 , chaosTrust = 1.0 , phaseTrust = 1.0
12241224 )
12251225
12261226 # Check return types:
@@ -1230,25 +1230,21 @@ def test_EstimateTargetReachabilityCheckType(self):
12301230
12311231 def test_EstimateTargetReachabilityPositive (self ):
12321232 testCases = [
1233- (self .GenerateSeries (150 ), self .GenerateSeries (40 ), 12 , 3 ),
1234- (self .GenerateSeries (300 ), self .GenerateSeries (60 ), 20 , 5 ),
1235- (self .GenerateSeries (1000 ), self .GenerateSeries (100 ), 15 , 4 ),
1236- (
1237- self .GenerateSeries (250 ), self .GenerateSeries (80 ), 10 , 3 ,
1238- {"useChaos" : True , "chaosModel" : "hurst" , "chaosTail" : 100 , "usePhase" : True , "phaseDirection" : "Buy" }
1239- ),
1233+ (self .GenerateSeries (150 ), self .GenerateSeries (40 ), 12 , 3 , 1.0 , 1.0 ),
1234+ (self .GenerateSeries (300 ), self .GenerateSeries (60 ), 20 , 5 , 1.0 , 0.9 ),
1235+ (self .GenerateSeries (1000 ), self .GenerateSeries (100 ), 15 , 4 , 0.9 , 1.0 ),
1236+ (self .GenerateSeries (250 ), self .GenerateSeries (80 ), 10 , 3 , 0.9 , 0.8 ),
12401237 ]
12411238
12421239 for test in testCases :
1243- seriesLowTF , seriesHighTF , horizonLowTF , horizonHighTF = test [:4 ]
1244- kwargs = test [4 ] if len (test ) > 4 else {}
1240+ seriesLowTF , seriesHighTF , horizonLowTF , horizonHighTF , chaosTrust , phaseTrust = test
12451241
12461242 currentPrice = seriesLowTF .iloc [- 1 ]
12471243 targetPrice = currentPrice * 1.07
12481244
12491245 pIntegral , fIntegral = TradeRoutines .EstimateTargetReachability (
12501246 seriesLowTF , seriesHighTF , currentPrice , targetPrice ,
1251- horizonLowTF , horizonHighTF , ddof = 2 , ** kwargs
1247+ horizonLowTF , horizonHighTF , ddof = 2 , chaosTrust = chaosTrust , phaseTrust = phaseTrust
12521248 )
12531249
12541250 # Probability must be within [0, 1]:
@@ -1271,11 +1267,11 @@ def test_EstimateTargetReachabilityNegative(self):
12711267 (emptySeries , emptySeries , 100 , 110 , 10 , 5 ), # Empty Pandas series
12721268
12731269 # Edge cases with chaos/phase flags (should still return fallback):
1274- ([], [], 100 , 110 , 10 , 5 , {"useChaos " : True , "chaosTail " : 0 }),
1275- ([100 ], [100 ], 100 , 110 , 10 , 5 , {"usePhase " : True , "phaseDirection " : "Sell" }),
1276- (validSeries , validSeries , 100 , 110 , 10 , 0 , {"useChaos " : True , "chaosTail " : - 100 , "usePhase" : True }),
1277- (validSeries , validSeries , 100 , 110 , 10 , 0 , {"useChaos " : True , "chaosTail " : None , "usePhase" : True }),
1278- (validSeries , validSeries , 100 , 110 , 10 , 0 , {"useChaos " : True , "chaosTail " : 101 , "usePhase" : True }),
1270+ ([], [], 100 , 110 , 10 , 5 , {"chaosTrust " : 0 , "phaseTrust " : 0 }),
1271+ ([100 ], [100 ], 100 , 110 , 10 , 5 , {"chaosTrust " : - 1 , "phaseTrust " : - 1 }),
1272+ (validSeries , validSeries , 100 , 110 , 10 , 0 , {"chaosTrust " : 0 , "phaseTrust " : - 1 }),
1273+ (validSeries , validSeries , 100 , 110 , 10 , 0 , {"chaosTrust " : - 1 , "phaseTrust " : 0 }),
1274+ (validSeries , validSeries , 100 , 110 , 10 , 0 , {"chaosTrust " : 100 , "phaseTrust " : 100 }),
12791275 ]
12801276
12811277 for test in testCases :
@@ -1305,13 +1301,7 @@ def test_EstimateTargetReachabilityPerformance(self):
13051301 targetPrice = currentPrice * 1.05
13061302
13071303 # Enable chaos and phase modifiers with tail slicing:
1308- kwargs = {
1309- "useChaos" : True ,
1310- "chaosModel" : "hurst" ,
1311- "chaosTail" : 1001 ,
1312- "usePhase" : True ,
1313- "phaseDirection" : "Buy" ,
1314- }
1304+ kwargs = {"chaosTrust" : 0.8 , "phaseTrust" : 0.7 }
13151305
13161306 startTime = time .perf_counter ()
13171307
0 commit comments