designed a test which works!
This commit is contained in:
parent
fffd4b9e58
commit
fa46ed472f
@ -44,8 +44,9 @@ class trandeVoter():
|
|||||||
#заполнение матрицы вероятностей вычисляемыми значениями из матрицы сумм
|
#заполнение матрицы вероятностей вычисляемыми значениями из матрицы сумм
|
||||||
def generateMatrixProbability(self) -> None:
|
def generateMatrixProbability(self) -> None:
|
||||||
for i in range(self.matrixAmounts.shape[0]):
|
for i in range(self.matrixAmounts.shape[0]):
|
||||||
rowSum=sum(self.matrixAmounts.iloc[i])
|
print(self.matrixAmounts)
|
||||||
self.matrixProbability.iloc[i]['up'] = (self.matrixAmounts.iloc[i]['up'] / rowSum)
|
rowSum=sum(self.matrixAmounts.iloc[i]) + 1
|
||||||
|
self.matrixProbability.iloc[i]['up'] = self.matrixAmounts.iloc[i]['up'] / rowSum
|
||||||
self.matrixProbability.iloc[i]['none'] = self.matrixAmounts.iloc[i]['none'] / rowSum
|
self.matrixProbability.iloc[i]['none'] = self.matrixAmounts.iloc[i]['none'] / rowSum
|
||||||
self.matrixProbability.iloc[i]['down'] = self.matrixAmounts.iloc[i]['down'] / rowSum
|
self.matrixProbability.iloc[i]['down'] = self.matrixAmounts.iloc[i]['down'] / rowSum
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,19 @@ sigAgrRetroTemplate = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
retroAns = test.getRetroTrendAns(sigAgrRetroTemplate,df_candle[:5000],40)
|
retroAns = test.getRetroTrendAns(sigAgrRetroTemplate,df_candle[5000:6000].reset_index(drop=True),40)
|
||||||
|
|
||||||
print(test.generateMatrixProbabilityFromDict(retroAns))
|
test.generateMatrixProbabilityFromDict(retroAns)
|
||||||
|
|
||||||
|
sigAgrData = {
|
||||||
|
'sig_BB':{
|
||||||
|
'signalData': df_candle[990:1000],
|
||||||
|
'indicatorData' :{'ind_BB': df_candle[:1000]}
|
||||||
|
},
|
||||||
|
'sig_BB_2':{
|
||||||
|
'signalData': df_candle[990:1000],
|
||||||
|
'indicatorData' :{'ind_BB': df_candle[:1000]}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
test.getOnlineAns(sigAgrData, 0.0)
|
||||||
Loading…
x
Reference in New Issue
Block a user